zhengjinyi 1 rok pred
rodič
commit
d31b1e4405

+ 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) {