Commit 3c84cd30 by chenwq

```

feat(order): 使用uni-popup重构订单操作确认弹窗

- 将ActionConfirmPopup组件从原生view替换为uni-popup组件
- 添加popup引用和显示/隐藏方法(openPopupShell/closePopupShell)
- 移除zIndex属性,通过css样式控制层级
- 在OrderPaymentInfoPanel中添加付款凭证提交确认弹窗功能
- 在OrderTransferInfoPanel中移除不再需要的确认弹窗相关代码
```
1 parent e6dc50e9
<template>
<view v-if="show" class="action-confirm-popup" :style="{ zIndex: zIndex }">
<uni-popup ref="popup" class="action-confirm-popup" type="center" background-color="transparent"
mask-background-color="rgba(0,0,0,.55)" :mask-click="false" z-index="10002">
<view class="action-confirm-dialog">
<image class="action-confirm-icon" :src="iconSrc" mode="aspectFit"></image>
<text class="action-confirm-title">{{ title }}</text>
......@@ -14,11 +15,11 @@
</view>
</view>
</view>
</view>
</uni-popup>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-facing-decorator";
import { Component, Prop, Ref, Vue, Watch } from "vue-facing-decorator";
@Component({})
export default class ActionConfirmPopup extends Vue {
......@@ -43,8 +44,17 @@ export default class ActionConfirmPopup extends Vue {
@Prop({ type: Boolean, required: false, default: false })
loading: boolean;
@Prop({ type: Number, required: false, default: 10002 })
zIndex: number;
@Ref
popup: any;
@Watch("show", { immediate: true })
onShowChanged(): void {
if (this.show) {
this.openPopupShell();
return;
}
this.closePopupShell();
}
cancel(): void {
if (this.loading) return;
......@@ -55,20 +65,22 @@ export default class ActionConfirmPopup extends Vue {
if (this.loading) return;
this.$emit("confirm");
}
private openPopupShell(): void {
setTimeout(() => {
this.popup?.open?.("center");
}, 0);
}
private closePopupShell(): void {
this.popup?.close?.();
}
}
</script>
<style scoped lang="scss">
.action-confirm-popup {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, .55);
display: flex;
align-items: center;
justify-content: center;
.action-confirm-popup :deep(.uni-popup) {
z-index: 10002 !important;
}
.action-confirm-dialog {
......
......@@ -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 :show="voucherSubmitConfirmVisible" :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,8 @@ export default class OrderPaymentInfoPanel extends Vue {
transactionDesc = "";
voucherSubmitting = false;
voucherLimit = VOUCHER_LIMIT;
voucherSubmitConfirmVisible = false;
voucherSubmitConfirmIconSrc = "https://img02.glsx.com.cn/weapp/resource/dj-aus/images/order/icon_pay.png";
voucherImageStyles = {
height: 96,
......@@ -650,6 +657,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.voucherSubmitConfirmVisible = true;
}
closeVoucherSubmitConfirmPopup(): void {
if (this.voucherSubmitting) return;
this.voucherSubmitConfirmVisible = false;
}
confirmVoucherSubmit(): void {
if (this.voucherSubmitting) return;
this.voucherSubmitConfirmVisible = false;
this.uploadVoucher();
}
async uploadVoucher(): void {
if (this.voucherSubmitting) return;
if (this.paymentVouchers.length === 0) {
......
......@@ -168,16 +168,13 @@
<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 :show="submitConfirmVisible" :icon-src="submitConfirmIconSrc" title="确认提交付款凭证?"
cancel-text="取消" confirm-text="确认" loading-text="提交中..." :loading="isSubmitting"
@cancel="closeSubmitConfirmPopup" @confirm="confirmSubmitReview"></action-confirm-popup>
</view>
</template>
......@@ -188,7 +185,6 @@ 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,8 +239,6 @@ export default class OrderTransferInfoPanel extends Vue {
isSubmitting = false;
showPlateKeyboard = false;
newLicensePlate = "";
submitConfirmVisible = false;
submitConfirmIconSrc = "https://img02.glsx.com.cn/weapp/resource/dj-aus/images/order/icon_pay.png";
created(): void {
this.initFromOrder();
......@@ -676,23 +670,6 @@ export default class OrderTransferInfoPanel extends Vue {
this.showPlateKeyboard = false;
}
openSubmitConfirmPopup(): void {
if (this.isSubmitting) return;
if (!this.validateBeforeSubmitReview()) return;
this.submitConfirmVisible = true;
}
closeSubmitConfirmPopup(): void {
if (this.isSubmitting) return;
this.submitConfirmVisible = false;
}
confirmSubmitReview(): void {
if (this.isSubmitting) return;
this.submitConfirmVisible = false;
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!