订单详情,退菜,小计和优惠
This commit is contained in:
parent
db6b1af326
commit
13a4e21be5
|
|
@ -541,12 +541,12 @@
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
const curTotal = cur.info.reduce((a,
|
const curTotal = cur.info.reduce((a,
|
||||||
b) => {
|
b) => {
|
||||||
return a + (props.orderInfo.status == 'unpaid' ? b.priceAmount : b
|
return a + (b.status == 'unpaid' ? b.priceAmount : b.status == 'return' ? 0 : b.canReturnAmount * 1)
|
||||||
.canReturnAmount * 1)
|
|
||||||
}, 0)
|
}, 0)
|
||||||
return prve + curTotal
|
return prve + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
return goodsPrice.toFixed(2)
|
return goodsPrice.toFixed(2)
|
||||||
|
|
||||||
if (props.orderInfo.status == 'unpaid') {
|
if (props.orderInfo.status == 'unpaid') {
|
||||||
const n = goodsOriginAllPrice.value - youhuiAllPrice.value
|
const n = goodsOriginAllPrice.value - youhuiAllPrice.value
|
||||||
return (n < 0 ? 0 : n).toFixed(2)
|
return (n < 0 ? 0 : n).toFixed(2)
|
||||||
|
|
|
||||||
|
|
@ -124,19 +124,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTuiCai(goods, index) {
|
function onTuiCai(goods, index) {
|
||||||
console.log(goods);
|
|
||||||
tuicai.show = true
|
tuicai.show = true
|
||||||
tuicai.selGoods = goods
|
tuicai.selGoods = goods
|
||||||
}
|
}
|
||||||
async function tuicaiConfirm(e) {
|
async function tuicaiConfirm(e) {
|
||||||
console.log(tuicai.selGoods);
|
|
||||||
const res = await Api.$returnCart({
|
const res = await Api.$returnCart({
|
||||||
...e,
|
...e,
|
||||||
cartId: tuicai.selGoods.hasOwnProperty('cartId') ? tuicai.selGoods.cartId : tuicai.selGoods.id,
|
cartId: tuicai.selGoods.hasOwnProperty('cartId') ? tuicai.selGoods.cartId : tuicai.selGoods.id,
|
||||||
tableId: orderDetail.info.tableId,
|
tableId: orderDetail.info.tableId,
|
||||||
})
|
})
|
||||||
tuicai.show = false
|
tuicai.show = false
|
||||||
|
if(res){
|
||||||
|
go.back()
|
||||||
|
}else{
|
||||||
|
|
||||||
init()
|
init()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -307,6 +310,7 @@
|
||||||
}))
|
}))
|
||||||
console.log(orderDetail.goodsList);
|
console.log(orderDetail.goodsList);
|
||||||
}
|
}
|
||||||
|
console.log(res,'debug121')
|
||||||
orderDetail.info = res
|
orderDetail.info = res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue