Commit 559a5663 by chenwq

```

feat(order): 添加付款凭证提交确认弹窗

- 在OrderPaymentInfoPanel中添加ActionConfirmPopup组件用于确认提交付款凭证
- 将直接提交改为先弹出确认弹窗,增加用户体验和操作安全性
- 移除OrderTransferInfoPanel中的重复确认弹窗逻辑,统一交互流程

BREAKING CHANGE: 提交付款凭证的操作现在需要用户二次确认
```
1 parent 35eaa3cd
......@@ -81,9 +81,10 @@
<!-- <van-button v-if="order.orderState !== 'UNPAID'" type="primary" hairline round @click="navigateBack"
block>已完成付款</van-button>
<template v-else> -->
<van-button v-if="isAuditPending" type="primary" hairline round block :loading="voucherSubmitting" @click="uploadVoucher">重新提交</van-button>
<van-button v-if="isAuditPending" type="primary" hairline round block :loading="voucherSubmitting"
@click="openVoucherSubmitConfirmPopup">重新提交</van-button>
<van-button v-else type="primary" hairline round :loading="voucherSubmitting"
:custom-style="voucherSubmitButtonStyle" @click="uploadVoucher" block>
:custom-style="voucherSubmitButtonStyle" @click="openVoucherSubmitConfirmPopup" block>
{{ voucherSubmitButtonText }}
</van-button>
<!-- </template> -->
......@@ -99,6 +100,9 @@
<order-coupon-verify-popup ref="couponVerifyPopup" :illu-src="couponVerifyDialogIlluSrc"
:loading="couponVerifyLoading" @dismiss="onCouponVerifyDismiss"
@confirm="onCouponVerifyConfirm" @change="onCouponVerifyDialogChange"></order-coupon-verify-popup>
<action-confirm-popup ref="voucherSubmitConfirmPopup" :icon-src="voucherSubmitConfirmIconSrc" title="确认提交付款凭证?"
cancel-text="取消" confirm-text="确认" loading-text="提交中..." :loading="voucherSubmitting"
@cancel="closeVoucherSubmitConfirmPopup" @confirm="confirmVoucherSubmit"></action-confirm-popup>
<van-dialog use-slot :show="showCertifyDialog" :show-cancel-button="false" :show-confirm-button="false">
<certification-dialog @close="onCertifyDialogClosed"></certification-dialog>
</van-dialog>
......@@ -135,6 +139,7 @@ import {
} from "@/common/eventTracking";
import { AuthService } from "@/common/AuthService";
import { getUploadErrorMessage, uploadFiles } from "@/common/UploadHelper";
import ActionConfirmPopup from "./ActionConfirmPopup.vue";
import OrderCouponSheetPopup from "@/module/order/detail/OrderCouponSheetPopup.vue";
import OrderCouponVerifyPopup from "@/module/order/detail/OrderCouponVerifyPopup.vue";
import CertificationDialog from "@/pages/tabbar/home/CertificationDialog.vue";
......@@ -148,7 +153,7 @@ type OrderWithPendingPaymentAudit = AuctionOrder & {
};
@Component({
components: { OrderCouponSheetPopup, OrderCouponVerifyPopup, CertificationDialog },
components: { ActionConfirmPopup, OrderCouponSheetPopup, OrderCouponVerifyPopup, CertificationDialog },
})
export default class OrderPaymentInfoPanel extends Vue {
@Prop({ type: Object, required: true })
......@@ -174,6 +179,7 @@ export default class OrderPaymentInfoPanel extends Vue {
transactionDesc = "";
voucherSubmitting = false;
voucherLimit = VOUCHER_LIMIT;
voucherSubmitConfirmIconSrc = "https://img02.glsx.com.cn/weapp/resource/dj-aus/images/order/icon_pay.png";
voucherImageStyles = {
height: 96,
......@@ -192,6 +198,9 @@ export default class OrderPaymentInfoPanel extends Vue {
@Ref
couponVerifyPopup: any;
@Ref
voucherSubmitConfirmPopup: any;
mounted(): void {
this.syncOrderVouchers();
this.reloadOrderCoupons();
......@@ -650,6 +659,26 @@ export default class OrderPaymentInfoPanel extends Vue {
});
}
openVoucherSubmitConfirmPopup(): void {
if (this.voucherSubmitting) return;
if (this.paymentVouchers.length === 0) {
uni.showToast({ title: "请上传支付凭证", icon: "none" });
return;
}
this.voucherSubmitConfirmPopup?.open?.();
}
closeVoucherSubmitConfirmPopup(): void {
if (this.voucherSubmitting) return;
this.voucherSubmitConfirmPopup?.close?.();
}
confirmVoucherSubmit(): void {
if (this.voucherSubmitting) return;
this.voucherSubmitConfirmPopup?.close?.();
this.uploadVoucher();
}
async uploadVoucher(): void {
if (this.voucherSubmitting) return;
if (this.paymentVouchers.length === 0) {
......
......@@ -168,27 +168,23 @@
<view class="footer">
<view class="appeal-button" @click="appealOrder">申诉</view>
<view class="submit-button" :class="{ 'submit-button--disabled': !canSubmit }" @click="openSubmitConfirmPopup">
<view class="submit-button" :class="{ 'submit-button--disabled': !canSubmit }" @click="submitReview">
{{ submitButtonText }}
</view>
</view>
<plate-input v-if="showPlateKeyboard" :plate="newLicensePlate" @export="setPlate"
@close="showPlateKeyboard = false"></plate-input>
<action-confirm-popup ref="submitConfirmPopup" :icon-src="submitConfirmIconSrc" title="确认提交付款凭证?"
cancel-text="取消" confirm-text="确认" loading-text="提交中..." :loading="isSubmitting"
@cancel="closeSubmitConfirmPopup" @confirm="confirmSubmitReview"></action-confirm-popup>
</view>
</template>
<script lang="ts">
import { Component, Prop, Ref, Vue } from "vue-facing-decorator";
import { Component, Prop, Vue } from "vue-facing-decorator";
import { AuctionOrder } from "lib/src/entity/auction/entity/AuctionOrder";
import type { FileInfo } from "lib/src/core/bean/FileInfo";
import type { AuthService } from "@/common/AuthService";
import { AuctionOrderController } from "@/api/AuctionOrderController";
import { getUploadErrorMessage, uploadFiles } from "@/common/UploadHelper";
import ActionConfirmPopup from "./ActionConfirmPopup.vue";
import plateInput from "@/components/uni-plate-input/uni-plate-input.vue";
import {
buildTransferUploadPayload,
......@@ -223,7 +219,7 @@ function newUploadClientId(slot: ExtraTransferSlot): string {
}
@Component({
components: { plateInput, ActionConfirmPopup },
components: { plateInput },
})
export default class OrderTransferInfoPanel extends Vue {
@Prop({ type: Object, required: true })
......@@ -243,10 +239,6 @@ export default class OrderTransferInfoPanel extends Vue {
isSubmitting = false;
showPlateKeyboard = false;
newLicensePlate = "";
submitConfirmIconSrc = "https://img02.glsx.com.cn/weapp/resource/dj-aus/images/order/icon_pay.png";
@Ref
submitConfirmPopup: any;
created(): void {
this.initFromOrder();
......@@ -678,23 +670,6 @@ export default class OrderTransferInfoPanel extends Vue {
this.showPlateKeyboard = false;
}
openSubmitConfirmPopup(): void {
if (this.isSubmitting) return;
if (!this.validateBeforeSubmitReview()) return;
this.submitConfirmPopup?.open?.();
}
closeSubmitConfirmPopup(): void {
if (this.isSubmitting) return;
this.submitConfirmPopup?.close?.();
}
confirmSubmitReview(): void {
if (this.isSubmitting) return;
this.submitConfirmPopup?.close?.();
this.submitReview();
}
validateBeforeSubmitReview(): boolean {
const allUploadItems = [
...this.registrationItems,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!