修改可退款金额计算公式

This commit is contained in:
2024-11-23 14:23:11 +08:00
parent 0906ab8523
commit 00b81e9f1b
3 changed files with 66 additions and 15 deletions

View File

@@ -347,27 +347,48 @@
}
const canTuiKuanPrice = computed(() => {
return props.data.reduce((prve, cur) => {
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1
// },0)
const curTotal = cur.info.filter(v => !v.userCouponId)
.reduce((a, b) => {
return a + b.priceAmount * 1
}, 0)
return prve + curTotal
}, 0)
})
const TuiKuanPrice = computed(() => {
return props.data.reduce((prve, cur) => {
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1
// },0)
const curTotal = cur.info.filter(v => isTui(v)&&!v.userCouponId)
.reduce((a, b) => {
return a + b.priceAmount * 1
}, 0)
return prve + curTotal
}, 0)
})
const noTuiKuanPrice=computed(()=>{
return props.data.reduce((prve, cur) => {
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1
// },0)
const curTotal = cur.info.filter(v => canTuiKuan(props.orderInfo, v) && !v.userCouponId)
const curTotal = cur.info.filter(v => !isTui(v)&&!v.userCouponId)
.reduce((a, b) => {
return a + b.priceAmount * 1
}, 0)
return prve + curTotal
}, 0)
})
function returnCanTuiMoney(item) {
console.log(canTuiKuanPrice.value);
if (props.orderInfo.status == 'unpaid') {
return returnTotalMoney(item)
} else {
if(props.orderInfo.pointsDiscountAmount>0||props.orderInfo.fullCouponDiscountAmount>0){
return (item.priceAmount / (canTuiKuanPrice.value + seatFeePrice.value * 1) * canTuiKuanPrice.value).toFixed(
2)
const bili=(item.priceAmount/canTuiKuanPrice.value*100).toFixed(2)/100
console.log(bili);
return ((props.orderInfo.amount)*bili).toFixed(2)
// return (item.priceAmount / (canTuiKuanPrice.value + seatFeePrice.value * 1) * props.orderInfo.amount).toFixed(
// 2)
}else{
return item.priceAmount
}