订单支付详情修改部分逻辑

This commit is contained in:
2024-11-23 09:35:22 +08:00
parent d36afe0969
commit 0f2e791557
2 changed files with 46 additions and 10 deletions

View File

@@ -168,10 +168,19 @@
</template>
<view class="u-flex u-row-between u-m-t-20">
<view></view>
<view>
<text>总计</text>
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
</view>
<template v-if="orderInfo.status=='unpaid'">
<view>
<text>总计</text>
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
</view>
</template>
<template v-else>
<view>
<text>总计</text>
<text class="font-bold u-font-32">{{orderInfo.amount}}</text>
</view>
</template>
</view>
<!-- <view class="u-flex u-row-between u-m-t-20" v-if="orderInfo.status=='closed'">
<view></view>
@@ -466,7 +475,8 @@
const youhuiAllPrice = computed(() => {
if(props.orderInfo.status!='unpaid'){
return (goodsOriginAllPrice.value-allPrice.value-discountAmount.value).toFixed(2)
const seatfee=(props.orderInfo.amount==0&&allPrice.value==0)?seatFeePrice.value:0
return (goodsOriginAllPrice.value-allPrice.value-discountAmount.value+seatfee*1).toFixed(2)
}
return (freePrice.value * 1 + vipDiscountPrice.value * 1 + props.orderInfo.fullCouponDiscountAmount + props
.orderInfo.pointsDiscountAmount + (props.orderInfo.status == 'unpaid' ? productCoupPrice.value :
@@ -494,7 +504,8 @@
const seatFee=props.orderInfo.seatInfo?(props.orderInfo.seatInfo.priceAmount||props.orderInfo.seatInfo.returnAmount):0
console.log('seatFee');
console.log(seatFee);
return (props.orderInfo.amount-seatFee).toFixed(2)
const total=props.orderInfo.amount-seatFee
return (total<=0?0:total).toFixed(2)
})
const goodsNumber = computed(() => {

View File

@@ -91,7 +91,8 @@
<text class="u-m-l-10 no-wrap">{{item.payName}}</text>
</view>
<view class="u-flex color-999 u-font-24">
<view class="u-m-r-20" v-if="item.payType=='vipPay'&&user.id" @click.stop="chooseUser">
<view class="u-m-r-20" v-if="item.payType=='vipPay'&&user.id"
@click.stop="chooseUser">
<view>
<text>会员</text>
<text class="u-m-r-4">{{user.telephone||user.nickName}}</text>
@@ -210,6 +211,7 @@
<edit-accountPoints @confirm="pointsConfirm" :price="accountPoints.num" :accountPoints="accountPoints"
ref="refPoints"></edit-accountPoints>
</view>
</template>
@@ -257,6 +259,14 @@
})
function confirmModelCancel() {
if (modal.key == 'fullCoupon') {
// 取消改价
discount.discount = 100
discount.value = 0
}
confirmModelClose()
}
function confirmModelClose() {
modal.show = false
modal.key = ''
modal.data = ''
@@ -271,6 +281,13 @@
if (modal.key == 'cash') {
await pay()
confirmModelCancel()
return
}
if (modal.key == 'fullCoupon') {
//删除满减券
const index = pays.quan.findIndex(v => v.type == 1)
pays.quan.splice(index, 1)
return
}
}
@@ -310,7 +327,7 @@
}
const res = await Api.$calcUsablePoints({
memberId: order.memberId,
orderAmount:payPrice.value
orderAmount: payPrice.value
})
accountPoints.calcRes = res
accountPoints.num = res.maxUsablePoints
@@ -535,6 +552,14 @@
...form,
value: form.price - form.currentPrice
})
const fullCoupon = pays.quan.find(v => v.type == 1)
if (fullCoupon && form.currentPrice < fullCoupon.fullAmount) {
modal.content = '改价后价格不满足满减券最低满减需求' + fullCoupon.fullAmount + '元'
modal.key = 'fullCoupon'
modal.show = true
modal.cancelText = '取消改价'
modal.confirmText = '删除满减券'
}
getPayUrl()
}
@@ -553,7 +578,7 @@
return infoBox.showToast(item.payName + '不可用')
}
pays.payTypes.selIndex = i
if (item.payType == 'vipPay'&&!user.value.id) {
if (item.payType == 'vipPay' && !user.value.id) {
chooseUser()
}
}
@@ -732,7 +757,7 @@
})
const pointCanDicountPrice = computed(() => {
const total = (order.amount || 0) - productCouponDiscountAmount.value - discount.value -
fullCouponDiscountAmount.value
fullCouponDiscountAmount.value
return (total < 0 ? 0 : total).toFixed(2)
})
watch(() => pointCanDicountPrice.value, (newval) => {