This commit is contained in:
zmj 2024-06-26 16:27:35 +08:00
parent d6c715bdd3
commit 99a68f036b
1 changed files with 7 additions and 4 deletions

View File

@ -286,15 +286,18 @@
let checkAll = ref(0) let checkAll = ref(0)
const checkItem = (item, type) => { const checkItem = (item, type) => {
item.check = type; item.check = type;
let price = Number(cartInfo.value.total_price); let price = Number(cartInfo.value.pay_price);
if (type) { 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++; checkAll.value++;
} else { } 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--; checkAll.value--;
} }
cartInfo.value.total_price = price.toFixed(2); cartInfo.value.pay_price = price.toFixed(2);
} }
const changeAll = (flag = false) => { const changeAll = (flag = false) => {
let count = 0; let count = 0;