修改退款计算公式
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="packeFee>0||data.priceAmount>0||data.returnAmount>0">
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20"
|
||||
v-if="packeFee>0||data.priceAmount>0||data.returnAmount>0">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="font-bold">附加费</view>
|
||||
<template v-if="extraCanTuicai(orderInfo,data)">
|
||||
@@ -14,7 +15,7 @@
|
||||
<view class="u-flex u-row-between u-m-t-24" v-if="data.priceAmount*1>0">
|
||||
<view>{{data.productName||'餐位费'}}</view>
|
||||
<view>x{{data.num||0}}</view>
|
||||
<view class="price-min-width">¥{{data.priceAmount}}</view>
|
||||
<view class="price-min-width">¥{{seatFeePrice}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -24,7 +25,8 @@
|
||||
<view class="tag yitui u-m-l-10">{{data.status=='refunding'?'退款中': '已退'}}</view>
|
||||
</view>
|
||||
<view class="line-th">x{{data.num||0}}</view>
|
||||
<view class="line-th">¥{{data.priceAmount||data.returnAmount}}</view>
|
||||
<view class="line-th">¥{{seatFeePrice}}</view>
|
||||
<!-- <view class="line-th">¥{{data.priceAmount||data.returnAmount}}</view> -->
|
||||
</view>
|
||||
</template>
|
||||
<!-- <view class="u-flex u-row-right u-m-t-24">
|
||||
@@ -50,19 +52,30 @@
|
||||
computed
|
||||
} from 'vue'
|
||||
import {
|
||||
returnCanComputedGoodsArr,canComputedPackFee,
|
||||
returnPackFee
|
||||
returnCanComputedGoodsArr,
|
||||
canComputedPackFee,
|
||||
returnPackFee,isTui,
|
||||
isTuiCai,
|
||||
isGift,
|
||||
canTuiKuan,
|
||||
canTuicai,
|
||||
numSum
|
||||
} from '@/commons/utils/goodsUtil.js'
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
return {
|
||||
priceAmount: 0,
|
||||
returnAmount: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
orderInfo: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
amount: 0,
|
||||
detailList: []
|
||||
}
|
||||
}
|
||||
@@ -72,11 +85,34 @@
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
function extraCanTuicai(orderInfo,data){
|
||||
return orderInfo.status=='unpaid'&&data.status!='return'&&data.priceAmount*1>0
|
||||
const canTuiKuanPrice = computed(() => {
|
||||
return props.orderInfo.detailList.filter(v =>!isTui(v)&& !v.userCouponId)
|
||||
.reduce((a, b) => {
|
||||
return a + b.priceAmount * 1
|
||||
}, 0)
|
||||
})
|
||||
const seatFeePrice = computed(() => {
|
||||
const item = props.data
|
||||
if (props.data.returnAmount) {
|
||||
return props.data.returnAmount
|
||||
}
|
||||
console.log(item);
|
||||
if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
|
||||
const shengyuKeTui=(props.orderInfo.refundAmount||0)-canTuiKuanPrice.value
|
||||
const bili = Math.floor((item.priceAmount / shengyuKeTui) * 100) / 100
|
||||
console.log(bili);
|
||||
return Math.floor(props.orderInfo.amount * bili * 100) / 100
|
||||
} else {
|
||||
return item.priceAmount
|
||||
}
|
||||
})
|
||||
|
||||
function extraCanTuicai(orderInfo, data) {
|
||||
return orderInfo.status == 'unpaid' && data.status != 'return' && data.priceAmount * 1 > 0
|
||||
}
|
||||
function extraCanTuiKuan(orderInfo,data){
|
||||
return orderInfo.status=='closed'&&data.status!='refund'&&data.priceAmount*1>0
|
||||
|
||||
function extraCanTuiKuan(orderInfo, data) {
|
||||
return orderInfo.status == 'closed' && data.status != 'refund' && data.priceAmount * 1 > 0
|
||||
}
|
||||
const packeNumbber = computed(() => {
|
||||
if (!props.orderInfo.detailList) {
|
||||
|
||||
@@ -351,7 +351,7 @@
|
||||
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
|
||||
// return a+b.priceAmount*1
|
||||
// },0)
|
||||
const curTotal = cur.info.filter(v => !v.userCouponId)
|
||||
const curTotal = cur.info.filter(v => !isTui(v)&& !v.userCouponId)
|
||||
.reduce((a, b) => {
|
||||
return a + b.priceAmount * 1
|
||||
}, 0)
|
||||
@@ -384,9 +384,10 @@
|
||||
return returnTotalMoney(item)
|
||||
} else {
|
||||
if(props.orderInfo.pointsDiscountAmount>0||props.orderInfo.fullCouponDiscountAmount>0){
|
||||
const bili=(item.priceAmount/canTuiKuanPrice.value*100).toFixed(2)/100
|
||||
const shengyuKeTui=(props.orderInfo.refundAmount||0)-canTuiKuanPrice.value
|
||||
const bili=Math.floor((item.priceAmount/shengyuKeTui )*100)/100
|
||||
console.log(bili);
|
||||
return ((props.orderInfo.amount)*bili).toFixed(2)
|
||||
return Math.floor(props.orderInfo.amount*bili*100)/100
|
||||
// return (item.priceAmount / (canTuiKuanPrice.value + seatFeePrice.value * 1) * props.orderInfo.amount).toFixed(
|
||||
// 2)
|
||||
}else{
|
||||
|
||||
@@ -750,7 +750,8 @@
|
||||
return goodsPrice.toFixed(2)
|
||||
})
|
||||
const originPrice = computed(() => {
|
||||
return (order.amount || 0) * 1 + vipDiscount.value * 1
|
||||
const n=(order.amount || 0) * 1 + vipDiscount.value * 1
|
||||
return n.toFixed(2)
|
||||
})
|
||||
const fullCouponDiscountAmount = computed(() => {
|
||||
return pays.quan.filter(v => v.type == 1).reduce((prve, cur) => {
|
||||
|
||||
Reference in New Issue
Block a user