修改可退款金额计算公式
This commit is contained in:
@@ -69,6 +69,10 @@
|
|||||||
price: {
|
price: {
|
||||||
type: [Number,String],
|
type: [Number,String],
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
nowPrice:{
|
||||||
|
type: [Number,String],
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
function currentPriceInput(newval){
|
function currentPriceInput(newval){
|
||||||
|
|||||||
@@ -347,27 +347,48 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const canTuiKuanPrice = computed(() => {
|
const canTuiKuanPrice = computed(() => {
|
||||||
|
return props.data.reduce((prve, cur) => {
|
||||||
|
// 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)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.priceAmount * 1
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
const TuiKuanPrice = computed(() => {
|
||||||
|
return props.data.reduce((prve, cur) => {
|
||||||
|
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
|
||||||
|
// return a+b.priceAmount*1
|
||||||
|
// },0)
|
||||||
|
const curTotal = cur.info.filter(v => isTui(v)&&!v.userCouponId)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.priceAmount * 1
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
const noTuiKuanPrice=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 => !isTui(v)&&!v.userCouponId)
|
||||||
// return a+b.priceAmount*1
|
|
||||||
// },0)
|
|
||||||
const curTotal = cur.info.filter(v => canTuiKuan(props.orderInfo, v) && !v.userCouponId)
|
|
||||||
.reduce((a, b) => {
|
.reduce((a, b) => {
|
||||||
return a + b.priceAmount * 1
|
return a + b.priceAmount * 1
|
||||||
}, 0)
|
}, 0)
|
||||||
return prve + curTotal
|
return prve + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
function returnCanTuiMoney(item) {
|
function returnCanTuiMoney(item) {
|
||||||
console.log(canTuiKuanPrice.value);
|
|
||||||
if (props.orderInfo.status == 'unpaid') {
|
if (props.orderInfo.status == 'unpaid') {
|
||||||
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
|
||||||
return (item.priceAmount / (canTuiKuanPrice.value + seatFeePrice.value * 1) * canTuiKuanPrice.value).toFixed(
|
console.log(bili);
|
||||||
2)
|
return ((props.orderInfo.amount)*bili).toFixed(2)
|
||||||
|
// return (item.priceAmount / (canTuiKuanPrice.value + seatFeePrice.value * 1) * props.orderInfo.amount).toFixed(
|
||||||
|
// 2)
|
||||||
}else{
|
}else{
|
||||||
return item.priceAmount
|
return item.priceAmount
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="bg-gray min-page u-p-30 u-font-28">
|
<view class="bg-gray min-page u-p-30 u-font-28">
|
||||||
<view class="u-p-t-60 u-p-b-60 u-text-center">
|
<view class="u-p-t-60 u-p-b-60 u-text-center">
|
||||||
<template v-if="order.amount!=payPrice">
|
<template v-if="originPrice!=payPrice">
|
||||||
<view class="u-font-32 ">
|
<view class="u-font-32 ">
|
||||||
<text class="price-fuhao">¥</text>
|
<text class="price-fuhao">¥</text>
|
||||||
<!-- <text class="font-bold price">{{discount.currentPrice?discount.currentPrice:order.amount}}</text> -->
|
<!-- <text class="font-bold price">{{discount.currentPrice?discount.currentPrice:order.amount}}</text> -->
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10 color-999 old-price">
|
<view class="u-m-t-10 color-999 old-price">
|
||||||
<text class="">¥</text>
|
<text class="">¥</text>
|
||||||
<text class=" ">{{order.amount}}</text>
|
<text class=" ">{{originPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10 u-flex u-row-center color-main">
|
<view class="u-m-t-10 u-flex u-row-center color-main">
|
||||||
<view @click="discountShow">修改</view>
|
<view @click="discountShow">修改</view>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="u-font-32 ">
|
<view class="u-font-32 ">
|
||||||
<text class="price-fuhao">¥</text>
|
<text class="price-fuhao">¥</text>
|
||||||
<text class="font-bold price">{{order.amount}}</text>
|
<text class="font-bold price">{{originPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10 u-flex u-row-center color-main">
|
<view class="u-m-t-10 u-flex u-row-center color-main">
|
||||||
<view @click="discountShow">修改</view>
|
<view @click="discountShow">修改</view>
|
||||||
@@ -27,8 +27,17 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="content bg-fff border-r-12">
|
<view class="content bg-fff border-r-12">
|
||||||
<view class=" u-p-t-30 u-p-l-26 u-p-r-26 card top u-m-t-30">
|
<view class="u-p-l-26 u-p-r-26 card top u-m-t-30">
|
||||||
<view class="border-bottom-dashed u-p-b-30">
|
<view class="border-bottom-dashed u-p-b-30 u-p-t-30" v-if="vipDiscount*1>0">
|
||||||
|
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between ">
|
||||||
|
<view>会员优惠</view>
|
||||||
|
<view class="color-red">
|
||||||
|
-¥{{vipDiscount}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="border-bottom-dashed u-p-b-30 u-p-t-30">
|
||||||
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between " @click="toQuan">
|
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between " @click="toQuan">
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
<view class="color-999 u-flex u-col-center">
|
<view class="color-999 u-flex u-col-center">
|
||||||
@@ -202,7 +211,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<edit-discount @confirm="editDiscountConfirm" title="优惠金额" :ref="setModel" name="editMoney"
|
<edit-discount :nowPrice="order.amount-productCouponDiscountAmount-fullCouponDiscountAmount"
|
||||||
|
@confirm="editDiscountConfirm" title="优惠金额" :ref="setModel" name="editMoney"
|
||||||
:price="order.amount-productCouponDiscountAmount" :discount="discount.discount"></edit-discount>
|
:price="order.amount-productCouponDiscountAmount" :discount="discount.discount"></edit-discount>
|
||||||
|
|
||||||
<up-modal :title="modal.title" :content="modal.content" :show="modal.show" :confirmText="modal.confirmText"
|
<up-modal :title="modal.title" :content="modal.content" :show="modal.show" :confirmText="modal.confirmText"
|
||||||
@@ -266,6 +276,7 @@
|
|||||||
}
|
}
|
||||||
confirmModelClose()
|
confirmModelClose()
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmModelClose() {
|
function confirmModelClose() {
|
||||||
modal.show = false
|
modal.show = false
|
||||||
modal.key = ''
|
modal.key = ''
|
||||||
@@ -726,6 +737,21 @@
|
|||||||
fullCouponDiscountAmount.value - accountPoints.price * (accountPoints.sel ? 1 : 0)
|
fullCouponDiscountAmount.value - accountPoints.price * (accountPoints.sel ? 1 : 0)
|
||||||
return (total < 0 ? 0 : total).toFixed(2)
|
return (total < 0 ? 0 : total).toFixed(2)
|
||||||
})
|
})
|
||||||
|
const vipDiscount = computed(() => {
|
||||||
|
if (!user.value.isVip) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
const goodsPrice = order.detailList.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))
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
})
|
||||||
|
const originPrice = computed(() => {
|
||||||
|
return (order.amount || 0) * 1 + vipDiscount.value * 1
|
||||||
|
})
|
||||||
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) => {
|
||||||
return prve + cur.discountAmount * 1
|
return prve + cur.discountAmount * 1
|
||||||
|
|||||||
Reference in New Issue
Block a user