修改订单详情支付逻辑

This commit is contained in:
2024-11-25 13:49:28 +08:00
parent a2a4a1bf96
commit c9caed9579
3 changed files with 104 additions and 70 deletions

View File

@@ -98,10 +98,10 @@
}
console.log(item);
if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
const shengyuKeTui=canTuiKuanPrice.value
const bili = Math.floor((item.priceAmount / shengyuKeTui) * 100) / 100
console.log(bili);
return Math.floor((props.orderInfo.amount-props.orderInfo.refundAmount) * bili * 100) / 100
return item.canReturnAmount
// const shengyuKeTui=canTuiKuanPrice.value
// const bili = Math.floor((item.priceAmount / shengyuKeTui) * 100) / 100
// return Math.floor((props.orderInfo.amount-props.orderInfo.refundAmount) * bili * 100) / 100
} else {
return item.priceAmount
}
@@ -141,7 +141,7 @@
}
function tuikuan() {
emits('tuikuan', {...props.data,priceAmount:seatFeePrice.value})
emits('tuikuan', {...props.data,priceAmount:props.data.canReturnAmount})
}
function tuicai() {

View File

@@ -171,7 +171,7 @@
<template v-if="orderInfo.status=='unpaid'">
<view>
<text>总计</text>
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
<text class="font-bold u-font-32">{{orderInfo.amount }}</text>
</view>
</template>
<template v-else>
@@ -358,6 +358,7 @@
return prve + curTotal
}, 0)
console.log(goodsTotal);
console.log(seatFeePrice.value);
return (goodsTotal+seatFeePrice.value*1).toFixed(2)
})
const TuiKuanPrice = computed(() => {
@@ -388,16 +389,14 @@
return seatFee
})
function returnCanTuiMoney(item) {
return item.canReturnAmount
if (props.orderInfo.status == 'unpaid') {
return returnTotalMoney(item)
} else {
if(props.orderInfo.pointsDiscountAmount>0||props.orderInfo.fullCouponDiscountAmount>0){
console.log(canTuiKuanPrice.value);
const bili=Math.floor((item.priceAmount/canTuiKuanPrice.value )*100)/100
console.log(bili);
return Math.floor((allPrice.value)*bili*100)/100
// return (item.priceAmount / (canTuiKuanPrice.value + seatFeePrice.value * 1) * props.orderInfo.amount).toFixed(
// 2)
return item.canReturnAmount
// const bili=Math.floor((item.priceAmount/canTuiKuanPrice.value )*100)/100
// return Math.floor((allPrice.value)*bili*100)/100
}else{
return item.priceAmount
}
@@ -420,7 +419,7 @@
if (res) {
emits('tuikuan', {
...item,
priceAmount: returnCanTuiMoney(item)
priceAmount: item.canReturnAmount
}, index)
}
})
@@ -504,14 +503,16 @@
})
const youhuiAllPrice = computed(() => {
if(props.orderInfo.status!='unpaid'){
const seatfee=(props.orderInfo.amount==0&&allPrice.value==0)?seatFeePrice.value:0
return (goodsOriginAllPrice.value-allPrice.value+seatfee*1).toFixed(2)
}
return (freePrice.value * 1 + vipDiscountPrice.value * 1 + props.orderInfo.fullCouponDiscountAmount + props
.orderInfo.pointsDiscountAmount + (props.orderInfo.status == 'unpaid' ? productCoupPrice.value :
productCouponDiscountAmount.value) * 1 + (props.orderInfo.discountAmount ||
0)).toFixed(2)
const n= props.orderInfo.originAmount-props.orderInfo.amount+vipDiscountPrice.value*1
return (n<0?0:n).toFixed(2)
// if(props.orderInfo.status!='unpaid'){
// const seatfee=(props.orderInfo.amount==0&&allPrice.value==0)?seatFeePrice.value:0
// return (goodsOriginAllPrice.value-allPrice.value+seatfee*1).toFixed(2)
// }
// return (freePrice.value * 1 + vipDiscountPrice.value * 1 + props.orderInfo.fullCouponDiscountAmount + props
// .orderInfo.pointsDiscountAmount + (props.orderInfo.status == 'unpaid' ? productCoupPrice.value :
// productCouponDiscountAmount.value) * 1 + (props.orderInfo.discountAmount ||
// 0)).toFixed(2)
})
const packFee = computed(() => {
@@ -527,13 +528,21 @@
})
const allPrice = computed(() => {
const goodsPrice = props.data.reduce((prve, cur) => {
const curTotal = cur.info.reduce((a,
b) => {
return a + 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)
}
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)
const canReturnAmount=props.orderInfo.seatInfo&&props.orderInfo.seatInfo.canReturnAmount?props.orderInfo.seatInfo.canReturnAmount:0
const total=props.orderInfo.amount-(returnAmount?returnAmount:canReturnAmount)
return (total<=0?0:total).toFixed(2)
})