From 99a68f036b03fa85186d9c23e5c519a01c82df8a Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Wed, 26 Jun 2024 16:27:35 +0800 Subject: [PATCH] add --- pages/cart/cart.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index 08b170f..b805550 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -286,15 +286,18 @@ let checkAll = ref(0) const checkItem = (item, type) => { item.check = type; - let price = Number(cartInfo.value.total_price); + let price = Number(cartInfo.value.pay_price); if (type) { - price += item.sell * item.cart_num; + price += (priceKey.value.off_activity == 1 ? item[priceKey.value.price] : item[priceKey.value.op_price]) * + item + .cart_num; checkAll.value++; } else { - price -= item.sell * item.cart_num; + price -= (priceKey.value.off_activity == 1 ? item[priceKey.value.price] : item[priceKey.value.op_price]) * + item.cart_num; checkAll.value--; } - cartInfo.value.total_price = price.toFixed(2); + cartInfo.value.pay_price = price.toFixed(2); } const changeAll = (flag = false) => { let count = 0;