更新计算公公式

This commit is contained in:
2024-11-23 16:56:18 +08:00
parent 35160c63b4
commit a2a4a1bf96

View File

@@ -347,7 +347,7 @@
}
const canTuiKuanPrice = computed(() => {
return props.data.reduce((prve, cur) => {
const goodsTotal= props.data.reduce((prve, cur) => {
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1
// },0)
@@ -357,6 +357,8 @@
}, 0)
return prve + curTotal
}, 0)
console.log(goodsTotal);
return (goodsTotal+seatFeePrice.value*1).toFixed(2)
})
const TuiKuanPrice = computed(() => {
return props.data.reduce((prve, cur) => {
@@ -379,15 +381,21 @@
return prve + curTotal
}, 0)
})
const cantuiSeatFee=computed(()=>{
let seatFee=props.orderInfo.seatInfo?(props.orderInfo.seatInfo.priceAmount):0
const bili = Math.floor((seatFee / canTuiKuanPrice.value) * 100) / 100
seatFee= Math.floor((props.orderInfo.amount-props.orderInfo.refundAmount) * bili * 100) / 100
return seatFee
})
function returnCanTuiMoney(item) {
if (props.orderInfo.status == 'unpaid') {
return returnTotalMoney(item)
} else {
if(props.orderInfo.pointsDiscountAmount>0||props.orderInfo.fullCouponDiscountAmount>0){
const shengyuKeTui=canTuiKuanPrice.value
const bili=Math.floor((item.priceAmount/shengyuKeTui )*100)/100
console.log(canTuiKuanPrice.value);
const bili=Math.floor((item.priceAmount/canTuiKuanPrice.value )*100)/100
console.log(bili);
return Math.floor((props.orderInfo.amount-props.orderInfo.refundAmount)*bili*100)/100
return Math.floor((allPrice.value)*bili*100)/100
// return (item.priceAmount / (canTuiKuanPrice.value + seatFeePrice.value * 1) * props.orderInfo.amount).toFixed(
// 2)
}else{
@@ -523,10 +531,9 @@
const n = goodsOriginAllPrice.value - youhuiAllPrice.value
return (n < 0 ? 0 : n).toFixed(2)
}
let seatFee=props.orderInfo.seatInfo?(props.orderInfo.seatInfo.priceAmount):0
const bili = Math.floor((seatFee / canTuiKuanPrice.value) * 100) / 100
seatFee= Math.floor((props.orderInfo.amount-props.orderInfo.refundAmount) * bili * 100) / 100
const total=props.orderInfo.amount-(props.orderInfo.seatInfo.returnAmount?props.orderInfo.seatInfo.returnAmount:seatFee)
const returnAmount=props.orderInfo.seatInfo&&props.orderInfo.seatInfo.returnAmount?props.orderInfo.seatInfo.returnAmount:0
console.log(cantuiSeatFee.value);
const total=props.orderInfo.amount-(returnAmount?returnAmount:cantuiSeatFee.value*1)
return (total<=0?0:total).toFixed(2)
})