代客下单bug修改2

This commit is contained in:
duan
2024-12-04 10:44:25 +08:00
parent ff1e6f60e0
commit 4dfa7d627e
2 changed files with 22 additions and 17 deletions

View File

@@ -369,21 +369,23 @@
// 单品打折
async function discountconfirm(form) {
let str = ''
if (form.notes) {
form.notes.forEach(ele => {
if (ele.checked) {
str = str + ele.name + ','
}
})
if (form.discountMoney != '.') {
let str = ''
if (form.notes) {
form.notes.forEach(ele => {
if (ele.checked) {
str = str + ele.name + ','
}
})
}
let obj = {
saleAmount: form.discountMoney,
note: str + form.note,
cartId: modelData.data.id
}
const res = await Api.$updatePrice(obj)
getCart()
}
let obj = {
saleAmount: form.discountMoney,
note: str + form.note,
cartId: modelData.data.id
}
const res = await Api.$updatePrice(obj)
getCart()
}
//用餐人数
@@ -449,9 +451,11 @@
skuId
}
par[key] = !item[key]
const res = await Api.$updateCart(par)
goods.list[index][key] = returnBoolean(res[key])
getCart()
}
//等叫
async function toggleWait(item) {
@@ -597,7 +601,6 @@
return ((goodsTotalPrice - discountSaleAmount.value) || 0).toFixed(2)
})
const allPrice = computed(() => {
console.log(goodsPrice.value, '调试2121');
const n = goodsPrice.value * 1 + $seatFee.totalAmount
return n.toFixed(2)
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
@@ -615,8 +618,10 @@
}, 0)
return goodsTotalPrice - allPrice.value
} else {
console.log(discountSaleAmount.value,'优惠金额')
return (discountSaleAmount.value)
}
console.log(discountSaleAmount.value,'优惠金额1')
return (goodsTotalPrice + discountSaleAmount.value * 1).toFixed(2)
})

View File

@@ -6,7 +6,7 @@
<view class="u-absolute goods bg-fff">
<view
class="u-p-t-32 color-666 border-bottom bg-fff u-absolute total u-p-r-28 u-p-b-32 u-p-l-28 u-flex u-row-between">
<view>已添加{{goodsNumber}}件商品</view>
<view>已添加{{goodsNumber.toFixed(0)}}件商品</view>
<view class="color-666">
<uni-icons color="#666" type="trash"></uni-icons>
<text class="u-m-l-10" @tap="setModalShow('clear',true)">清空</text>