订单管理详情,支付价格计算逻辑修改

This commit is contained in:
2024-11-21 18:10:19 +08:00
parent 84855194e8
commit b69159d965
6 changed files with 89 additions and 34 deletions

View File

@@ -38,7 +38,7 @@
</uni-tag>
</view>
<view class="u-m-r-20 u-flex " v-if="item.userCouponId">
<uni-tag text="商品券抵扣"
<uni-tag :text="'商品券抵扣'+item.priceAmount"
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
</uni-tag>
</view>
@@ -68,6 +68,15 @@
</template>
<template v-else>
<template
v-if="item.priceAmount*1!=returnTotalMoney(item)*1">
<view>{{item.priceAmount}}</view>
<view class=" color-666 line-th">
{{returnTotalMoney(item)}}</view>
</template>
<template v-else>
<view>{{returnTotalMoney(item)}}</view>
</template>
<!-- <template
v-if="user.isVip&&item.isMember&&returnVipMoney(item)>0&&returnVipMoney(item)!=returnTotalMoney(item)">
<view>{{returnVipMoney(item)}}</view>
<view class=" color-666 line-th">
@@ -75,7 +84,7 @@
</template>
<template v-else>
<view>{{returnTotalMoney(item)}}</view>
</template>
</template> -->
</template>
<view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
</view>
@@ -92,7 +101,7 @@
<template v-if="canTuiKuan(orderInfo,item)">
<view class="u-flex u-row-right gap-20 u-m-t-20">
<my-button :width="128" :height="48" plain shape="circle" @tap="tuikuan(item,index)"><text
class="no-wrap">退款</text> </my-button>
class="no-wrap">{{item.userCouponId?'退券':'退款' }}</text> </my-button>
</view>
</template>
@@ -162,6 +171,20 @@
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
</view>
</view>
<view class="u-flex u-row-between u-m-t-20" v-if="orderInfo.status=='closed'">
<view></view>
<view>
<text>实付</text>
<text class="font-bold u-font-32">{{to2(orderInfo.amount) }}</text>
</view>
</view>
<!-- <view class="u-flex u-row-between u-m-t-20">
<view></view>
<view>
<text>原价</text>
<text class="font-bold u-font-32">{{to2(orderInfo.originAmount||0) }}</text>
</view>
</view> -->
<view class="u-m-t-24">
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
</view>
@@ -177,11 +200,11 @@
<text>{{vipDiscountPrice}}</text>
</view>
</view>
<view class="u-flex u-row-between u-m-b-18" v-if="orderInfo.discountAmount*1>0">
<view class="u-flex u-row-between u-m-b-18" v-if="discountAmount">
<view>打折</view>
<view class="color-red">
<text></text>
<text>{{to2(orderInfo.discountAmount) }}</text>
<text>{{to2(discountAmount) }}</text>
</view>
</view>
<view class="u-flex u-row-between " v-if="orderInfo.fullCouponDiscountAmount*1>0">
@@ -308,6 +331,13 @@
const n = props.seatFee.priceAmount * (isTui(props.seatFee) ? 0 : 1)
return n.toFixed(2)
})
const discountAmount=computed(()=>{
if(props.orderInfo.discountAmount){
return props.orderInfo.discountAmount
}
console.log(props.orderInfo.originAmount*(1-props.orderInfo.discountRatio));
return (props.orderInfo.originAmount*(1-props.orderInfo.discountRatio))
})
const goodsOriginAllPrice = computed(() => {
const goodsPrice = props.data.reduce((prve, cur) => {
const curTotal = cur.info.reduce((a,
@@ -318,6 +348,13 @@
}, 0)
return goodsPrice.toFixed(2)
})
const canTuiKuanPrice=computed(()=>{
const discountAmount=props.orderInfo.originAmount||(100-props.orderInfo.discountRatio)*props.orderInfo.originAmount/100
const n= props.orderInfo.originAmount-discountAmount
console.log(n);
return m
})
const freePrice = computed(() => {
const goodsPrice = props.data.reduce((prve, cur) => {
@@ -335,8 +372,7 @@
return 0
}
const goodsPrice = props.data.reduce((prve, cur) => {
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return" && !v
.userCouponId && (v.isMember && v.memberPrice) && (v.memberPrice != v.price)).reduce((
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return" && (v.isMember && v.memberPrice) && (v.memberPrice != v.price)).reduce((
a,
b) => {
return a + (b.num * (b.price - b.memberPrice))
@@ -365,8 +401,6 @@
})
const youhuiAllPrice = computed(() => {
console.log(freePrice.value * 1 , vipDiscountPrice.value * 1 , props.orderInfo.fullCouponDiscountAmount ,props
.orderInfo.pointsDiscountAmount , productCoupPrice.value * 1 , props.orderInfo.discountAmount);
return (freePrice.value * 1 + vipDiscountPrice.value * 1 + props.orderInfo.fullCouponDiscountAmount + props
.orderInfo.pointsDiscountAmount + productCoupPrice.value * 1 + (props.orderInfo.discountAmount ||
0)).toFixed(2)