From 50a366062159218aa782264eae3c8591e38ab49f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Wed, 12 Nov 2025 14:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=92=8C=E8=B4=AD=E7=89=A9=E8=BD=A6=E9=A1=B5=E9=9D=A2=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/myOrders/goodDetails/index.vue | 17 +++++++++-------- packages/shop/goods/index.vue | 17 +++++++++-------- packages/shop/groupPurchaseDetail/index.vue | 20 ++++++++++---------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/packages/myOrders/goodDetails/index.vue b/packages/myOrders/goodDetails/index.vue index 0d9f84fc..33e59b4e 100644 --- a/packages/myOrders/goodDetails/index.vue +++ b/packages/myOrders/goodDetails/index.vue @@ -460,11 +460,11 @@ export default { }, //获取购物车数量 - getShopCar() { - request(apiArr.getCarCount, "POST", {}).then((res) => { - this.prevCarNum = res.total; - }); - }, + // getShopCar() { + // request(apiArr.getCarCount, "POST", {}).then((res) => { + // this.prevCarNum = res.total; + // }); + // }, getShopCarList() { return request(apiArr.getCar, "POST", {}).then((res) => { @@ -472,6 +472,7 @@ export default { this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list) .flatMap(supplier => supplier.commodity_cart_and_goods_model); this.carNum = res.total; + this.prevCarNum = res.total; return res; }); }, @@ -510,7 +511,7 @@ export default { //因为是当前商品没有 调用update就是增加商品。增加商品之后再获取购物车数量 request(apiArr.updateCar, "POST", params).then((res) => { - that.getShopCar(); + // that.getShopCar(); that.getShopCarList(); }); }, @@ -548,7 +549,7 @@ export default { request(apiArr.updateCar, "POST", params).then((res) => { console.log(res); this.getShopCarList(); - this.getShopCar(); + // this.getShopCar(); uni.showToast({ title: "操作成功!", success() { }, @@ -598,7 +599,7 @@ export default { onShow() { this.getShopCarList().then(() => { this.getGoodsInfo(); - this.getShopCar(); + // this.getShopCar(); this.getComment(); }); }, diff --git a/packages/shop/goods/index.vue b/packages/shop/goods/index.vue index 46d7edcf..39b77e3e 100644 --- a/packages/shop/goods/index.vue +++ b/packages/shop/goods/index.vue @@ -515,11 +515,11 @@ export default { }, //获取购物车数量 - getShopCar() { - request(apiArr.getCarCount, "POST", {}).then((res) => { - this.prevCarNum = res.total; - }); - }, + // getShopCar() { + // request(apiArr.getCarCount, "POST", {}).then((res) => { + // this.prevCarNum = res.total; + // }); + // }, getShopCarList() { return request(apiArr.getCar, "POST", {}).then((res) => { @@ -527,6 +527,7 @@ export default { this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list) .flatMap(supplier => supplier.commodity_cart_and_goods_model); this.carNum = res.total; + this.prevCarNum = res.total; return res; }); }, @@ -565,7 +566,7 @@ export default { //因为是当前商品没有 调用update就是增加商品。增加商品之后再获取购物车数量 request(apiArr.updateCar, "POST", params).then((res) => { - that.getShopCar(); + // that.getShopCar(); that.getShopCarList(); }); }, @@ -603,7 +604,7 @@ export default { request(apiArr.updateCar, "POST", params).then((res) => { console.log(res); this.getShopCarList(); - this.getShopCar(); + // this.getShopCar(); uni.showToast({ title: "操作成功!", success() { }, @@ -660,7 +661,7 @@ export default { onShow() { this.getShopCarList().then(() => { this.getGoodsInfo(); - this.getShopCar(); + // this.getShopCar(); this.getComment(); }); }, diff --git a/packages/shop/groupPurchaseDetail/index.vue b/packages/shop/groupPurchaseDetail/index.vue index ec8cdaaf..1598f44e 100644 --- a/packages/shop/groupPurchaseDetail/index.vue +++ b/packages/shop/groupPurchaseDetail/index.vue @@ -174,7 +174,6 @@ - 购物车 @@ -1089,12 +1088,12 @@ export default { }, //获取购物车数量 - getShopCar() { - request(apiArr.getCarCount, "POST", {}).then((res) => { - this.carNum = res.total; - this.prevCarNum = res.total; - }); - }, + // getShopCar() { + // request(apiArr.getCarCount, "POST", {}).then((res) => { + // this.carNum = res.total; + // this.prevCarNum = res.total; + // }); + // }, getShopCarList() { const params = { @@ -1104,6 +1103,7 @@ export default { // 合并当日达和普通商品数据 this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list) .flatMap(supplier => supplier.commodity_cart_and_goods_model); + this.carNum = res.total; return res; }); }, @@ -1134,7 +1134,7 @@ export default { group_buy_id: this.info.commodity_goods_info_list[this.currentGGIndex].group_buy_activity_id, } request(apiArr.updateCar, "POST", params).then((res) => { - that.getShopCar(); + // that.getShopCar(); that.getShopCarList(); }); }, @@ -1163,7 +1163,7 @@ export default { title: "操作成功!", success() { }, }); - this.getShopCar(); + // this.getShopCar(); this.getGoodsInfo(); }); }, @@ -1282,7 +1282,7 @@ export default { this.getShopCarList().then(() => { this.getGoodsInfo(); }); - this.getShopCar(); + // this.getShopCar(); this.getZTAddress() },