Commit 1b14ae35 by zhangxw

订单上传付款凭证添加用户签平台合同判断

1 parent 39326684
......@@ -101,6 +101,9 @@
<order-coupon-verify-popup ref="couponVerifyPopup" :illu-src="couponVerifyDialogIlluSrc"
:loading="couponVerifyLoading" @dismiss="onCouponVerifyDismiss"
@confirm="onCouponVerifyConfirm" @change="onCouponVerifyDialogChange"></order-coupon-verify-popup>
<van-dialog use-slot :show="showCertifyDialog" :show-cancel-button="false" :show-confirm-button="false">
<certification-dialog @close="onCertifyDialogClosed"></certification-dialog>
</van-dialog>
</view>
</template>
......@@ -115,6 +118,7 @@ import { BankAccount } from "lib/src/entity/finance/entity/BankAccount";
import { TransactionController } from "@/api/TransactionController";
import { OrderTransaction } from "lib/src/entity/finance/entity/OrderTransaction";
import type { FileInfo } from "lib/src/core/bean/FileInfo";
import {AccountController} from "@/api/AccountController";
import {
CouponController,
parseCouponVerifyResponse,
......@@ -135,7 +139,7 @@ import { AuthService } from "@/common/AuthService";
import { getUploadErrorMessage, uploadFiles } from "@/common/UploadHelper";
import OrderCouponSheetPopup from "@/module/order/detail/OrderCouponSheetPopup.vue";
import OrderCouponVerifyPopup from "@/module/order/detail/OrderCouponVerifyPopup.vue";
import CertificationDialog from "@/pages/tabbar/home/CertificationDialog.vue";
const COUPON_SELECT_NONE = "__none__";
const VOUCHER_LIMIT = 5;
type OrderWithPendingPaymentAudit = AuctionOrder & {
......@@ -146,7 +150,7 @@ type OrderWithPendingPaymentAudit = AuctionOrder & {
};
@Component({
components: { OrderCouponSheetPopup, OrderCouponVerifyPopup },
components: { OrderCouponSheetPopup, OrderCouponVerifyPopup, CertificationDialog },
})
export default class OrderPaymentInfoPanel extends Vue {
@Prop({ type: Object, required: true })
......@@ -225,6 +229,10 @@ export default class OrderPaymentInfoPanel extends Vue {
return this.isPaymentAuditRejected ? "background: #EE3140; border-color: #EE3140;" : "";
}
/** 认证弹窗延迟定时器(避免重复 onShow 叠加多个定时器) */
certifyDelayTimer: ReturnType<typeof setTimeout> | null = null;
showCertifyDialog = false;
syncOrderVouchers(): void {
if (this.order?.orderState !== "UNPAID") return;
const pendingVouchers = (this.order as OrderWithPendingPaymentAudit)?.pendingPaymentAudit?.payVouchers;
......@@ -646,17 +654,38 @@ export default class OrderPaymentInfoPanel extends Vue {
});
}
uploadVoucher(): void {
async uploadVoucher(): void {
if (this.voucherSubmitting) return;
if (this.paymentVouchers.length === 0) {
uni.showToast({ title: "请上传支付凭证", icon: "none" });
return;
}
if (this.shouldVerifyCouponBeforeSubmit()) {
this.confirmVerifyCouponBeforeSubmit();
return;
try {
const res = await AccountController.getAccountInfo(this.axios)
const accountInfo = res.data
if (!accountInfo.platformContractSigned) {
if (this.certifyDelayTimer != null) {
clearTimeout(this.certifyDelayTimer)
this.certifyDelayTimer = null
}
this.certifyDelayTimer = setTimeout(() => {
this.certifyDelayTimer = null
this.showCertifyDialog = true
}, 500)
return
}
if (this.shouldVerifyCouponBeforeSubmit()) {
this.confirmVerifyCouponBeforeSubmit()
return
}
this.submitVoucher()
} catch (error) {
console.error("获取账号信息失败:", error);
}
this.submitVoucher();
}
onCertifyDialogClosed(): void {
this.showCertifyDialog = false;
}
shouldVerifyCouponBeforeSubmit(): boolean {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!