BackPress.uvue
1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!-- 退出弹框 -->
<template>
<MessageBox ref="finishRef" :content="finishContene" :isFooter="false">
<view class="footer">
<view class="footer-btn confirm flex" @click="$emit('openStep')">
<template v-if="finishDoneText">
{{ finishDoneText }}
</template>
<template v-else>
完成接待
<text class="btn-text">
(推荐)
</text>
</template>
</view>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
仍要退出
<text class="btn-text">
(不推荐)
</text>
</view>
</view>
</MessageBox>
</template>
<script setup lang="uts">
import MessageBox from './MessageBox.uvue'
import { callComponentMethod } from '@/utils/common.uts'
const props = defineProps({
finishDoneText: String,
finishContene: {
type: String,
default: '当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」'
}
})
const finishRef = ref(null)
function open(): void {
callComponentMethod(finishRef, 'open')
}
function hide(): void {
callComponentMethod(finishRef, 'close')
}
const emit = defineEmits(['openStep', 'backHome'])
defineExpose({ open, hide })
</script>
<style lang="scss">
.footer {
border-top: 2rpx solid #eff0f2;
font-weight: 600;
font-size: 32rpx;
margin-top: 48rpx;
.footer-btn {
justify-content: center;
margin: 16rpx auto 0;
flex-direction: row;
align-items: center;
}
.confirm {
width: 608rpx;
height: 80rpx;
background: #2c66f7;
border-radius: 40rpx;
color: #fff;
}
.cancel {
width: 608rpx;
height: 80rpx;
background: #ffffff00;
border-radius: 40rpx;
color: #2c66f7;
}
.btn-text { // ✅ UVUE 只支持类名选择器,不能使用元素选择器 text
font-size: 24rpx;
}
}
</style>