Ver Fonte

Merge remote-tracking branch 'remotes/origin/developer' into developerA

zhengjinyi há 1 ano atrás
pai
commit
3e4370f54c
1 ficheiros alterados com 16 adições e 6 exclusões
  1. 16 6
      components/cm-module/productDetails/cm-unit-popup.vue

+ 16 - 6
components/cm-module/productDetails/cm-unit-popup.vue

@@ -266,13 +266,23 @@ export default {
 			} else if (_value < this.handleMinNumber) {
 				this.$util.msg(`该商品最小起订量为${this.handleMinNumber}`, 2000)
 				this.productCount = this.handleMinNumber
-			} else if (_value % this.handleMinNumber != 0) {
-				this.$util.msg('购买量必须为起订量的整数倍', 2000)
-				this.productCount = this.handleMinNumber
-			} else if (_value > this.handleStock) {
-				this.productCount = this.handleStock
 			} else {
-				this.productCount = e.detail.value
+				if (this.skuProduct.step == 2) {
+					if (_value % this.handleMinNumber != 0) {
+						this.$util.msg('购买量必须为起订量的整数倍', 2000)
+						this.productCount = this.handleMinNumber
+					} else if (_value > this.handleStock) {
+						this.productCount = this.handleStock
+					} else {
+						this.productCount = _value
+					}
+				}else{
+					if (_value > this.handleStock) {
+						this.productCount = this.handleStock
+					} else {
+						this.productCount = _value
+					}
+				}
 			}
 		},
 		handleBuyConfirm(type) {