BookingGuideDialog.vue
2.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!--
* @Date: 2026-02-13
* @Description: 预约引导弹窗组件
* @component BookingGuideDialog
* @example
* <BookingGuideDialog v-model:show="showDialog" />
-->
<template>
<van-popup
v-model:show="visible"
round
position="center"
:style="{ width: '80vw', 'max-width': '320px' }"
closeable
@click-close-icon="handleClose"
>
<div class="booking-guide-popup">
<!-- 标题 -->
<div class="popup-title">预约提示</div>
<!-- 内容 -->
<div class="popup-content">
<p>请前往小程序进行预约</p>
<p class="highlight">如已在 H5 端完成预约,可在预约记录中查看,并进行核销</p>
</div>
<!-- 按钮组 -->
<div class="popup-footer">
<van-button
class="footer-btn cancel-btn"
@click="handleClose"
>
关闭
</van-button>
<van-button
class="footer-btn confirm-btn"
type="primary"
color="#A67939"
@click="goToBookingList"
>
预约记录
</van-button>
</div>
</div>
</van-popup>
</template>
<script setup>
/**
* 预约引导弹窗组件
*
* @description 提示用户前往小程序预约,H5 预约可在预约记录中查看
* @component BookingGuideDialog
* @example
* <BookingGuideDialog v-model:visible="showDialog" />
*/
import { computed } from 'vue'
import { useRouter } from 'vue-router'
const props = defineProps({
/** 是否显示弹窗 */
modelValue: {
type: Boolean,
default: false
}
})
const emit = defineEmits({
/** 更新显示状态 */
'update:modelValue': (value) => typeof value === 'boolean'
})
const router = useRouter()
const visible = computed({
get: () => props.modelValue,
set: (val) => emit('update:modelValue', val)
})
/**
* 关闭弹窗
*/
const handleClose = () => {
visible.value = false
}
/**
* 跳转到预约记录页面
*/
const goToBookingList = () => {
visible.value = false
router.push('/bookingList')
}
</script>
<style lang="less" scoped>
.booking-guide-popup {
padding: 24px 20px 20px;
text-align: center;
.popup-title {
font-size: 18px;
font-weight: 600;
color: #1E1E1E;
margin-bottom: 16px;
}
.popup-content {
line-height: 1.8;
font-size: 15px;
color: #595959;
margin-bottom: 24px;
p {
margin: 0 0 12px 0;
}
p:last-child {
margin-bottom: 0;
}
.highlight {
color: #A67939;
font-weight: 500;
}
}
.popup-footer {
display: flex;
gap: 12px;
.footer-btn {
flex: 1;
height: 44px;
border-radius: 8px;
font-size: 15px;
border: none;
}
.cancel-btn {
background-color: #F5F5F5;
color: #595959;
&:active {
background-color: #E6E6E6;
}
}
.confirm-btn {
background-color: #A67939;
color: #FFFFFF;
&:active {
background-color: #8A6B30;
}
}
}
}
</style>