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