Commit 1b14ae35 by zhangxw

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

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