处理购物车商品数量的错误

This commit is contained in:
luofei 2023-05-20 14:30:35 +08:00
parent d47a19d330
commit 72162b0759

View File

@ -569,7 +569,7 @@
cart_num: goods.cart_num + 1 cart_num: goods.cart_num + 1
}).then(res => { }).then(res => {
goods.cart_num = Number(goods.cart_num) + 1 goods.cart_num = Number(goods.cart_num) + 1
that.cartTotalCount = Number(that.cartTotalCount) + 1; // that.cartTotalCount = Number(that.cartTotalCount) + 1;
if (goods.hasOwnProperty('productAttr') && goods.cart_num > goods.productAttr.stock) { if (goods.hasOwnProperty('productAttr') && goods.cart_num > goods.productAttr.stock) {
goods.cart_num = goods.productAttr.stock; goods.cart_num = goods.productAttr.stock;
goods.numAdd = true; goods.numAdd = true;
@ -635,7 +635,7 @@
goods.numSub = true; goods.numSub = true;
} }
goods.cart_num = Number(goods.cart_num) - 1 goods.cart_num = Number(goods.cart_num) - 1
this.cartTotalCount = Number(this.cartTotalCount) - 1; // this.cartTotalCount = Number(this.cartTotalCount) - 1;
this.cartAllCheck('goodsCheck') this.cartAllCheck('goodsCheck')
}).catch(error => { }).catch(error => {
this.$util.Tips({ this.$util.Tips({