From dfbfb0440e212c482239346e1c4af08bc656ccd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Fri, 18 Jul 2025 10:16:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E6=94=B9=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=95=86=E5=93=81=E5=8A=A0=E5=85=A5=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E6=97=B6=E7=9A=84=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E9=87=8F=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shop/index/index.vue | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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() {