Commit e6dc50e9 by chenwq

```

feat(order): 替换uni-popup组件为原生view实现确认弹窗

- 移除uni-popup依赖,使用原生view组件重构ActionConfirmPopup
- 添加show属性控制弹窗显示隐藏
- 移除open/close方法,通过v-if控制组件渲染
- 更新OrderTransferInfoPanel中弹窗的调用方式
- 调整样式定位,使用flex布局居中显示弹窗内容
```
1 parent b96e4b79
<template> <template>
<uni-popup ref="popup" class="action-confirm-popup" type="center" background-color="transparent" <view v-if="show" class="action-confirm-popup" :style="{ zIndex: zIndex }">
mask-background-color="rgba(0,0,0,.55)" :mask-click="false" :z-index="zIndex"
@change="$emit('change', $event)">
<view class="action-confirm-dialog"> <view class="action-confirm-dialog">
<image class="action-confirm-icon" :src="iconSrc" mode="aspectFit"></image> <image class="action-confirm-icon" :src="iconSrc" mode="aspectFit"></image>
<text class="action-confirm-title">{{ title }}</text> <text class="action-confirm-title">{{ title }}</text>
...@@ -16,7 +14,7 @@ ...@@ -16,7 +14,7 @@
</view> </view>
</view> </view>
</view> </view>
</uni-popup> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -24,6 +22,9 @@ import { Component, Prop, Vue } from "vue-facing-decorator"; ...@@ -24,6 +22,9 @@ import { Component, Prop, Vue } from "vue-facing-decorator";
@Component({}) @Component({})
export default class ActionConfirmPopup extends Vue { export default class ActionConfirmPopup extends Vue {
@Prop({ type: Boolean, required: false, default: false })
show: boolean;
@Prop({ type: String, required: true }) @Prop({ type: String, required: true })
iconSrc: string; iconSrc: string;
...@@ -45,20 +46,9 @@ export default class ActionConfirmPopup extends Vue { ...@@ -45,20 +46,9 @@ export default class ActionConfirmPopup extends Vue {
@Prop({ type: Number, required: false, default: 10002 }) @Prop({ type: Number, required: false, default: 10002 })
zIndex: number; zIndex: number;
open(): void {
setTimeout(() => {
(this.$refs.popup as any)?.open?.("center");
}, 0);
}
close(): void {
(this.$refs.popup as any)?.close?.();
}
cancel(): void { cancel(): void {
if (this.loading) return; if (this.loading) return;
this.$emit("cancel"); this.$emit("cancel");
this.close();
} }
confirm(): void { confirm(): void {
...@@ -69,8 +59,16 @@ export default class ActionConfirmPopup extends Vue { ...@@ -69,8 +59,16 @@ export default class ActionConfirmPopup extends Vue {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.action-confirm-popup :deep(.uni-popup) { .action-confirm-popup {
z-index: 10002 !important; 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-dialog { .action-confirm-dialog {
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
<plate-input v-if="showPlateKeyboard" :plate="newLicensePlate" @export="setPlate" <plate-input v-if="showPlateKeyboard" :plate="newLicensePlate" @export="setPlate"
@close="showPlateKeyboard = false"></plate-input> @close="showPlateKeyboard = false"></plate-input>
<action-confirm-popup ref="submitConfirmPopup" :icon-src="submitConfirmIconSrc" title="确认提交付款凭证?" <action-confirm-popup :show="submitConfirmVisible" :icon-src="submitConfirmIconSrc" title="确认提交付款凭证?"
cancel-text="取消" confirm-text="确认" loading-text="提交中..." :loading="isSubmitting" cancel-text="取消" confirm-text="确认" loading-text="提交中..." :loading="isSubmitting"
@cancel="closeSubmitConfirmPopup" @confirm="confirmSubmitReview"></action-confirm-popup> @cancel="closeSubmitConfirmPopup" @confirm="confirmSubmitReview"></action-confirm-popup>
</view> </view>
...@@ -243,6 +243,7 @@ export default class OrderTransferInfoPanel extends Vue { ...@@ -243,6 +243,7 @@ export default class OrderTransferInfoPanel extends Vue {
isSubmitting = false; isSubmitting = false;
showPlateKeyboard = false; showPlateKeyboard = false;
newLicensePlate = ""; newLicensePlate = "";
submitConfirmVisible = false;
submitConfirmIconSrc = "https://img02.glsx.com.cn/weapp/resource/dj-aus/images/order/icon_pay.png"; submitConfirmIconSrc = "https://img02.glsx.com.cn/weapp/resource/dj-aus/images/order/icon_pay.png";
created(): void { created(): void {
...@@ -678,17 +679,17 @@ export default class OrderTransferInfoPanel extends Vue { ...@@ -678,17 +679,17 @@ export default class OrderTransferInfoPanel extends Vue {
openSubmitConfirmPopup(): void { openSubmitConfirmPopup(): void {
if (this.isSubmitting) return; if (this.isSubmitting) return;
if (!this.validateBeforeSubmitReview()) return; if (!this.validateBeforeSubmitReview()) return;
(this.$refs.submitConfirmPopup as any)?.open?.(); this.submitConfirmVisible = true;
} }
closeSubmitConfirmPopup(): void { closeSubmitConfirmPopup(): void {
if (this.isSubmitting) return; if (this.isSubmitting) return;
(this.$refs.submitConfirmPopup as any)?.close?.(); this.submitConfirmVisible = false;
} }
confirmSubmitReview(): void { confirmSubmitReview(): void {
if (this.isSubmitting) return; if (this.isSubmitting) return;
(this.$refs.submitConfirmPopup as any)?.close?.(); this.submitConfirmVisible = false;
this.submitReview(); this.submitReview();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!