From 884b7e5b38fa2b55427b9607d64776f20fef1363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Fri, 24 Oct 2025 17:26:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=95=86=E5=93=81=E7=9A=84=E6=95=B0=E9=87=8F=E4=B8=8D?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=9B=B4=E6=96=B0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shop/search/index.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/shop/search/index.vue b/packages/shop/search/index.vue index 68840013..27376f50 100644 --- a/packages/shop/search/index.vue +++ b/packages/shop/search/index.vue @@ -185,7 +185,7 @@ export default { }, // 获取购物车数据 getShopCarList() { - request(apiArr.getCar, "POST").then((res) => { + return request(apiArr.getCar, "POST").then((res) => { this.value = res.total; // 合并当日达和普通商品数据 this.goodsDetail = [].concat(res.same_day_cart_list || [], res.normal_cart_list || []) @@ -408,7 +408,12 @@ export default { this.isSearched = false; }, onShow() { - this.getShopCarList(); + this.getShopCarList().then(() => { + // 延迟一小段时间确保购物车数据已完全更新,然后同步商品数量 + setTimeout(() => { + this.syncGoodsQuantities(); + }, 100); + }); }, onReachBottom() { if (this.flag) {