diff --git a/components/ProductWindow.vue b/components/ProductWindow.vue index 3fbd413..a75f2f9 100644 --- a/components/ProductWindow.vue +++ b/components/ProductWindow.vue @@ -46,7 +46,14 @@ 购买数量 - - {{ cartNum }} + 1) { + num.cart_num = changeValue + } else { + num.cart_num++ + } if (num.cart_num > stock) { if(stock < 1) { this.$set(this.attr.productSelect, 'cart_num', 1) @@ -291,7 +295,7 @@ export default { this.$set(this, 'cart_num', 1) } else { this.$set(this.attr.productSelect, 'cart_num', num.cart_num) - this.$set(this, 'cart_num', num.cart_num) + // this.$set(this, 'cart_num', num.cart_num) } } } else { diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index 970f8a0..6eacf90 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -1244,7 +1244,12 @@ export default { let stock = productSelect.stock || 0 let num = this.attr.productSelect if (changeValue) { - num.cart_num++ + console.log(changeValue); + if(changeValue > 1) { + num.cart_num = changeValue + } else { + num.cart_num++ + } if (num.cart_num > stock) { if(stock < 1) { this.$set(this.attr.productSelect, 'cart_num', 1) @@ -1259,7 +1264,7 @@ export default { this.$set(this, 'cart_num', 1) } else { this.$set(this.attr.productSelect, 'cart_num', num.cart_num) - this.$set(this, 'cart_num', num.cart_num) + // this.$set(this, 'cart_num', num.cart_num) } } } else {