修改订单详情价格展示

This commit is contained in:
YeMingfei666 2024-11-22 16:56:51 +08:00
parent 70933ce1e4
commit 75161519f2
2 changed files with 27 additions and 15 deletions

View File

@ -47,6 +47,10 @@
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;" custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
size="small" text="打包" inverted type="success" /> size="small" text="打包" inverted type="success" />
</view> </view>
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnAmount">
<view class="color-666">退款金额:</view>
<view class="color-999 u-m-l-6">{{item.returnAmount}}</view>
</view>
</view> </view>
<view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</view> <view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</view>
@ -192,7 +196,7 @@
<view class="u-p-30" style="width: 80vw;"> <view class="u-p-30" style="width: 80vw;">
<view class="font-bold u-text-center">优惠详情</view> <view class="font-bold u-text-center">优惠详情</view>
<view class="u-m-t-32"> <view class="u-m-t-32">
<view class="u-flex u-row-between u-m-b-18"> <view class="u-flex u-row-between u-m-b-18" v-if="vipDiscountPrice*1>0">
<view>会员优惠</view> <view>会员优惠</view>
<view class="color-red"> <view class="color-red">
<text></text> <text></text>
@ -336,18 +340,23 @@
const canTuiKuanPrice = computed(() => { const canTuiKuanPrice = computed(() => {
return props.data.reduce((prve,cur)=>{ return 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
},0)
// const curTotal=cur.info.filter(v=>canTuiKuan(props.orderInfo,v)&&!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1 // return a+b.priceAmount*1
// },0) // },0)
const curTotal=cur.info.filter(v=>canTuiKuan(props.orderInfo,v)&&!v.userCouponId).reduce((a,b)=>{
return a+b.priceAmount*1
},0)
return prve+curTotal return prve+curTotal
},0) },0)
}) })
function returnCanTuiMoney(item) { function returnCanTuiMoney(item) {
console.log(canTuiKuanPrice.value);
if(props.orderInfo.status=='unpaid'){
return returnTotalMoney(item)
}else{
return (item.priceAmount/canTuiKuanPrice.value*props.orderInfo.amount).toFixed(2) return (item.priceAmount/canTuiKuanPrice.value*props.orderInfo.amount).toFixed(2)
} }
}
function to2(n) { function to2(n) {
if (!n) { if (!n) {
@ -454,8 +463,9 @@
}) })
const packFee = computed(() => { const packFee = computed(() => {
//退
const goodsPrice = props.data.reduce((prve, cur) => { const goodsPrice = props.data.reduce((prve, cur) => {
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return").reduce((a, const curTotal = cur.info.filter(v => v.status !== "return").reduce((a,
b) => { b) => {
return a + b.packAmount return a + b.packAmount
}, 0) }, 0)
@ -465,12 +475,14 @@
}) })
const allPrice = computed(() => { const allPrice = computed(() => {
if (props.orderInfo.status == 'unpaid') {
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)
}
return props.orderInfo.amount // if (props.orderInfo.status == 'unpaid') {
// const n = goodsOriginAllPrice.value - youhuiAllPrice.value
// return (n < 0 ? 0 : n).toFixed(2)
// }
// return props.orderInfo.amount
}) })
const goodsNumber = computed(() => { const goodsNumber = computed(() => {

View File

@ -91,7 +91,7 @@
<text class="u-m-l-10 no-wrap">{{item.payName}}</text> <text class="u-m-l-10 no-wrap">{{item.payName}}</text>
</view> </view>
<view class="u-flex color-999 u-font-24"> <view class="u-flex color-999 u-font-24">
<view class="u-m-r-20" v-if="item.payType=='vipPay'&&user.id"> <view class="u-m-r-20" v-if="item.payType=='vipPay'&&user.id" @click.stop="chooseUser">
<view> <view>
<text>会员</text> <text>会员</text>
<text class="u-m-r-4">{{user.telephone||user.nickName}}</text> <text class="u-m-r-4">{{user.telephone||user.nickName}}</text>
@ -553,7 +553,7 @@
return infoBox.showToast(item.payName + '不可用') return infoBox.showToast(item.payName + '不可用')
} }
pays.payTypes.selIndex = i pays.payTypes.selIndex = i
if (item.payType == 'vipPay') { if (item.payType == 'vipPay'&&!user.value.id) {
chooseUser() chooseUser()
} }
} }