更新计算公公式

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