From f488693a25eace0d78e3d5959305ce24be3945f1 Mon Sep 17 00:00:00 2001 From: liudan <18634735655@163.com> Date: Wed, 17 Jul 2024 19:43:40 +0800 Subject: [PATCH] 1 --- pages/order_addcart/order_addcart.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pages/order_addcart/order_addcart.vue b/pages/order_addcart/order_addcart.vue index f7624e3..79a22a6 100644 --- a/pages/order_addcart/order_addcart.vue +++ b/pages/order_addcart/order_addcart.vue @@ -269,6 +269,7 @@ console.log(resArr) let finishArr = []; let totalMoney = 0 + let totalNum = 0 this.selectCountPrice = 0.00 if (this.isLogin == true) { // this.getCartList(); @@ -299,11 +300,12 @@ finishArr.forEach(e => { if (e.check) { totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.price, e.cart_num)) - + totalNum += e.cart_num } }) this.selectCountPrice = totalMoney + this.cartCount = totalNum if(!hasSelected){ this.selectCountPrice = 0.00 this.cartCount = 0 @@ -450,8 +452,8 @@ cart_id:type_id, }).then(res=>{ this.selectCountPrice = 0.00 - this.cartCount = 0 - this.getCartList(); + this.cartCount = 0; + this.getCartList(true); this.getCartNum(); return that.$util.Tips({ title: res.message, @@ -838,18 +840,20 @@ // this.checkboxAllChange(true) if(isChange){ let totalMoney = 0; + let totalNum = 0 console.log(this.cartList.valid,"liudan") this.cartList.valid.forEach(el=>{ el.list.forEach(e => { if (e.check) { totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.price, e.cart_num)) - + totalNum += e.cart_num } }) }) this.selectCountPrice = totalMoney + this.cartCount = totalNum } });