diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index 67be1fd..5227a94 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -1174,11 +1174,21 @@ export default { if (changeValue) { num.cart_num++; if (num.cart_num > stock) { - this.$set(this.attr.productSelect, "cart_num", stock); - this.$set(this, "cart_num", stock); + if(stock < 1) { + this.$set(this.attr.productSelect, "cart_num", 1); + this.$set(this, "cart_num", 1); + } else { + this.$set(this.attr.productSelect, "cart_num", stock); + this.$set(this, "cart_num", stock); + } } else { - this.$set(this.attr.productSelect, "cart_num", num.cart_num); - this.$set(this, "cart_num", num.cart_num); + if (num.cart_num < 1) { + this.$set(this.attr.productSelect, "cart_num", 1); + 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); + } } } else { num.cart_num--;