订单详情,退菜,小计和优惠

This commit is contained in:
duan 2024-12-20 14:01:33 +08:00
parent db6b1af326
commit 13a4e21be5
2 changed files with 8 additions and 4 deletions

View File

@ -541,12 +541,12 @@
const goodsPrice = props.data.reduce((prve, cur) => {
const curTotal = cur.info.reduce((a,
b) => {
return a + (props.orderInfo.status == 'unpaid' ? b.priceAmount : b
.canReturnAmount * 1)
return a + (b.status == 'unpaid' ? b.priceAmount : b.status == 'return' ? 0 : b.canReturnAmount * 1)
}, 0)
return prve + curTotal
}, 0)
return goodsPrice.toFixed(2)
if (props.orderInfo.status == 'unpaid') {
const n = goodsOriginAllPrice.value - youhuiAllPrice.value
return (n < 0 ? 0 : n).toFixed(2)

View File

@ -124,19 +124,22 @@
}
function onTuiCai(goods, index) {
console.log(goods);
tuicai.show = true
tuicai.selGoods = goods
}
async function tuicaiConfirm(e) {
console.log(tuicai.selGoods);
const res = await Api.$returnCart({
...e,
cartId: tuicai.selGoods.hasOwnProperty('cartId') ? tuicai.selGoods.cartId : tuicai.selGoods.id,
tableId: orderDetail.info.tableId,
})
tuicai.show = false
if(res){
go.back()
}else{
init()
}
}
@ -307,6 +310,7 @@
}))
console.log(orderDetail.goodsList);
}
console.log(res,'debug121')
orderDetail.info = res
}