From 56e0d60f34226f3e865c1c119e019262637a2211 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 15:46:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8=E5=95=86?= =?UTF-8?q?=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5=E5=8A=A0=E5=85=A5=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E6=95=B0=E9=87=8F=E4=B8=8D=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/advertising/goodsDetail/index.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/advertising/goodsDetail/index.vue b/packages/advertising/goodsDetail/index.vue index 99808f2d..c28c0fbd 100644 --- a/packages/advertising/goodsDetail/index.vue +++ b/packages/advertising/goodsDetail/index.vue @@ -649,9 +649,8 @@ export default { addCar() { let that = this; this.info.commodity_goods_info_list[this.currentGGIndex].cart_count = { - count: 1, + count: this.itemObj.one_one === 1 ? 2 : 1, }; - console.log("🚀 ~ this.info.commodity_goods_info_list[this.currentGGIndex]:", this.info.commodity_goods_info_list[this.currentGGIndex]) // this.info.commodity_goods_info_list.forEach((item) => { // console.log(item.cart_count); // goods_id_and_count.push({ @@ -660,7 +659,7 @@ export default { // }); // }); - let countVal = 1 + let countVal = this.itemObj.one_one === 1 ? 2 : 1; const params = { goods_id_and_count: [ @@ -684,7 +683,7 @@ export default { // 获取当前商品的购物车数量,如果不存在则设为0 const currentCount = this.info.commodity_goods_info_list[this.currentGGIndex].cart_count?.count; // 新的数量为当前数量加一 - const newCount = currentCount + 1; + const newCount = this.itemObj.one_one === 1 ? currentCount + 2 : currentCount + 1; const params = { user_id: uni.getStorageSync("userId"), @@ -699,7 +698,8 @@ export default { }; request(apiArr.updateCar, "POST", params).then((res) => { - this.getShopCarList(); + return this.getShopCarList(); + }).then(() => { uni.showToast({ title: "操作成功!", success() { },