diff --git a/packages/shop/index/index.vue b/packages/shop/index/index.vue index 4bcdc7e3..5f4e6789 100644 --- a/packages/shop/index/index.vue +++ b/packages/shop/index/index.vue @@ -176,7 +176,7 @@ @@ -244,7 +244,7 @@ @@ -452,9 +452,7 @@ export default { this.getGoodsList(); }, //商品数量变化 - handleQuantityChange(item) { - console.log("🚀 ~ handleQuantityChange ~ value:", item); - const goodsId = ""; + handleQuantityChange(val,item) { if (item.commodity_goods_info_list.length) { this.goodsId = item.commodity_goods_info_list[0].id; } else { @@ -465,19 +463,16 @@ export default { goods_id_and_count: [ { goods_id: this.goodsId, - count: item.quantity ? item.quantity + 1 : 1, + count: val.value, }, ], }; - console.log("🚀 ~ handleQuantityChange ~ params:", params); request(apiArr.updateCar, "POST", params).then((res) => { console.log(res); + this.getShopCarList(); uni.showToast({ title: "操作成功!", success() { - // setTimeout(() => { - // that.getBanlance() - // }, 1500) }, }); }); @@ -488,6 +483,9 @@ export default { this.top = meun.top; this.localHeight = meun.height; this.getCateList(); + // this.getShopCarList(); + }, + onShow() { this.getShopCarList(); }, onReachBottom() {