uniapp【修复】: 售后金额为0的问题

This commit is contained in:
15093570141
2024-11-01 09:35:22 +08:00
parent b8a3ceb1b3
commit 4bbc66248f
2 changed files with 5 additions and 2 deletions

View File

@@ -128,6 +128,7 @@
images : Array<any>; images : Array<any>;
reason : string; reason : string;
refundPrice : number; /** 退款金额 */ refundPrice : number; /** 退款金额 */
payedAmount : number; /** 订单金额 */
}>({ }>({
orderId: "", orderId: "",
goodsList: [], goodsList: [],
@@ -139,6 +140,7 @@
images: [], images: [],
reason: "", reason: "",
refundPrice: 0, refundPrice: 0,
payedAmount: 0,
}); });
const loading = ref(false); const loading = ref(false);
@@ -185,6 +187,7 @@
} }
return item; return item;
}) })
state.payedAmount = orderDetail.data.payedAmount;
state.maxRefund = (orderDetail.data.orderAmount * 10000 - orderDetail.data.refunded * 10000) / 10000; state.maxRefund = (orderDetail.data.orderAmount * 10000 - orderDetail.data.refunded * 10000) / 10000;
state.costFreight = orderDetail.data.costFreight; state.costFreight = orderDetail.data.costFreight;
state.refundShow = (orderDetail.data.payedAmount * 10000 - orderDetail.data.refunded * 10000) / 10000; state.refundShow = (orderDetail.data.payedAmount * 10000 - orderDetail.data.refunded * 10000) / 10000;
@@ -292,7 +295,7 @@
/** 提交 */ /** 提交 */
async function onSubmit() { async function onSubmit() {
if (!amount(state.refundPrice)) { if (state.payedAmount != 0 && !amount(state.refundPrice)) {
handleShowToast('请输入正确金额'); return; handleShowToast('请输入正确金额'); return;
} }
if (state.refundPrice > state.refundShow) { if (state.refundPrice > state.refundShow) {

View File

@@ -223,7 +223,7 @@
</view> </view>
<view class="msg-box"> <view class="msg-box">
<view class="lab">{{ shopConfigStore?.config?.pointShowName }}优惠</view> <view class="lab">{{ shopConfigStore?.config?.pointShowName }}优惠</view>
<view class="val">{{ state.orderDetail?.pointMoney }}</view> <view class="val">-{{ state.orderDetail?.pointMoney }}</view>
</view> </view>
<view class="msg-box" v-if="state.orderDetail?.orderDiscountAmount > 0"> <view class="msg-box" v-if="state.orderDetail?.orderDiscountAmount > 0">
<view class="lab">订单优惠</view> <view class="lab">订单优惠</view>