修改订单详情优惠计算公司

This commit is contained in:
2024-11-20 15:06:27 +08:00
parent d588fd16ce
commit b0986065f4

View File

@@ -58,12 +58,7 @@
<view class="u-text-right u-m-t-28"> <view class="u-text-right u-m-t-28">
<template v-if="isTui(item)"> <template v-if="isTui(item)">
<view>0.00</view> <view>0.00</view>
<template <view class="line-th color-666 " >{{returnTotalMoney(item)}}
v-if="user.isVip&&item.isMember&&returnVipMoney(item)>0&&returnVipMoney(item)!=returnTotalMoney(item)">
<view class="line-th color-666 ">{{returnVipMoney(item)}}</view>
</template>
<view class="line-th color-666 " v-else>{{returnTotalMoney(item)}}
</view> </view>
</template> </template>
<template v-else-if="isGift(item)||item.userCouponId"> <template v-else-if="isGift(item)||item.userCouponId">
@@ -175,25 +170,25 @@
<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">
<view>会员优惠</view> <view>会员优惠</view>
<view class="color-red"> <view class="color-red">
<text></text> <text></text>
<text>{{vipDiscountPrice}}</text> <text>{{vipDiscountPrice}}</text>
</view> </view>
</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="orderInfo.discountAmount*1>0">
<view>打折</view> <view>打折</view>
<view class="color-red"> <view class="color-red">
<text></text> <text></text>
<text>{{orderInfo.discountAmount}}</text> <text>{{to2(orderInfo.discountAmount) }}</text>
</view> </view>
</view> </view>
<view class="u-flex u-row-between " v-if="orderInfo.fullCouponDiscountAmount*1>0"> <view class="u-flex u-row-between " v-if="orderInfo.fullCouponDiscountAmount*1>0">
<view>满减券抵扣</view> <view>满减券抵扣</view>
<view class="color-red"> <view class="color-red">
<text></text> <text></text>
<text>{{orderInfo.fullCouponDiscountAmount}}</text> <text>{{to2(orderInfo.fullCouponDiscountAmount) }}</text>
</view> </view>
</view> </view>
<view class="u-flex u-row-between u-m-t-18" <view class="u-flex u-row-between u-m-t-18"
@@ -201,14 +196,14 @@
<view>商品券抵扣</view> <view>商品券抵扣</view>
<view class="color-red"> <view class="color-red">
<text></text> <text></text>
<text>{{orderInfo.productCouponDiscountAmount||productCoupPrice}}</text> <text> {{to2(orderInfo.productCouponDiscountAmount||productCoupPrice) }}</text>
</view> </view>
</view> </view>
<view class="u-flex u-row-between u-m-t-18" v-if="orderInfo.pointsDiscountAmount"> <view class="u-flex u-row-between u-m-t-18" v-if="orderInfo.pointsDiscountAmount">
<view>积分抵扣</view> <view>积分抵扣</view>
<view class="color-red"> <view class="color-red">
<text></text> <text></text>
<text>{{orderInfo.pointsDiscountAmount}}</text> <text>{{to2(orderInfo.pointsDiscountAmount) }}</text>
</view> </view>
</view> </view>
@@ -228,7 +223,8 @@
hasPermission hasPermission
} from '@/commons/utils/hasPermission.js' } from '@/commons/utils/hasPermission.js'
import { import {
isTui,isTuiCai, isTui,
isTuiCai,
isGift, isGift,
canTuiKuan, canTuiKuan,
canTuicai, canTuicai,
@@ -327,7 +323,7 @@
const goodsPrice = props.data.reduce((prve, cur) => { const goodsPrice = props.data.reduce((prve, cur) => {
const curTotal = cur.info.filter(v => v.gift == true || isGift(v)).reduce((a, const curTotal = cur.info.filter(v => v.gift == true || isGift(v)).reduce((a,
b) => { b) => {
const price=(b.isMember && b.memberPrice)?b.memberPrice:b.price const price = (b.isMember && b.memberPrice) ? b.memberPrice : b.price
return a + (b.num * price) return a + (b.num * price)
}, 0) }, 0)
return prve + curTotal return prve + curTotal
@@ -369,11 +365,13 @@
}) })
const youhuiAllPrice = computed(() => { const youhuiAllPrice = computed(() => {
console.log(freePrice.value * 1 , vipDiscountPrice.value * 1 , props.orderInfo.fullCouponDiscountAmount ,props // console.log(freePrice.value * 1 , vipDiscountPrice.value * 1 , props.orderInfo.fullCouponDiscountAmount ,props
.orderInfo.pointsDiscountAmount , productCoupPrice.value * 1 , props.orderInfo.discountAmount); // .orderInfo.pointsDiscountAmount , productCoupPrice.value * 1 , props.orderInfo.discountAmount);
return (freePrice.value * 1 + vipDiscountPrice.value * 1 + props.orderInfo.fullCouponDiscountAmount + props return (freePrice.value * 1 + vipDiscountPrice.value * 1 + props.orderInfo.fullCouponDiscountAmount + props
.orderInfo.pointsDiscountAmount + productCoupPrice.value * 1 + (props.orderInfo.discountAmount || .orderInfo.pointsDiscountAmount + productCoupPrice.value * 1 + (props.orderInfo.discountAmount ||
0)).toFixed(2) 0)).toFixed(2)
}) })
const packFee = computed(() => { const packFee = computed(() => {
const goodsPrice = props.data.reduce((prve, cur) => { const goodsPrice = props.data.reduce((prve, cur) => {