index.vue
6.61 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!--
* @Date: 2023-06-21 10:23:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-02-05 18:36:21
* @FilePath: /xysBooking/src/views/index.vue
* @Description: 预约页首页
-->
<template>
<div class="index-page">
<div class="index-content">
<div style="height: 30vh;">
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item>
<img style="height: 30vh; width: 100vw;" src="https://cdn.ipadbiz.cn/xys/booking/banner.jpg" />
</van-swipe-item>
</van-swipe>
</div>
<!-- <div ref="root" class="index-control">
<div class="booking" @click="toBooking">
<van-icon size="1.5rem" color="#FFFFFF" :name="icon_1" />
立即预约
</div>
<div class="record" @click="toRecord">
<van-icon size="1.5rem" color="#A67939" :name="icon_2" />
预约记录
</div>
<div class="search" @click="toSearch">
<van-icon size="1.5rem" color="#A67939" :name="icon_6" />
邀请码
</div>
</div> -->
<div ref="root" class="index-circular">
<div class="booking-wrapper">
<div class="booking" @click="toBooking">
<div><van-icon size="3rem" color="#FFFFFF" :name="icon_1" /></div>
<div style="color: #FFF;">开始预约</div>
</div>
</div>
</div>
<div class="logo"></div>
</div>
<div class="index-nav">
<div class="nav-logo">
<van-icon size="1.5rem" :name="icon_3" color="#A67939" />
首页
</div>
<div class="nav-logo" @click="toCode">
<van-icon size="5rem" :name="icon_4" color="#A67939" style="position: absolute; top: -4rem;" />
<van-icon size="1.5rem" name="wap-home" color="#FFF" style="opacity: 0;" />
预约码
</div>
<div class="nav-logo" @click="toMy">
<van-icon size="1.5rem" :name="icon_5" color="#A67939" />
我的
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import dayjs from 'dayjs'
import { Cookies, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js'
//import { } from '@/utils/generateModules.js'
//import { } from '@/utils/generateIcons.js'
//import { } from '@/composables'
import { showSuccessToast, showFailToast } from 'vant';
import { billListAPI } from '@/api/index';
import { useGo } from '@/hooks/useGo'
import icon_1 from '@/assets/images/立即预约@2x.png'
import icon_2 from '@/assets/images/预约记录@2x.png'
import icon_3 from '@/assets/images/首页02@2x.png'
import icon_4 from '@/assets/images/二维码icon.png'
import icon_5 from '@/assets/images/我的01@2x.png'
import icon_6 from '@/assets/images/luru@2x.png'
import { sharePage } from '@/composables/useShare.js'
import { useClickAway } from '@vant/use';
const $route = useRoute();
const $router = useRouter();
useTitle($route.meta.title);
const go = useGo();
const toBooking = () => { // 跳转到预约须知
go('/notice');
}
const toRecord = () => { // 跳转到预约记录
go('/bookingList');
}
const toSearch = () => { // 跳转到寺院录入
go('/search');
}
const toCode = () => { // 跳转到预约码
// go('/bookingCode');
window.location.replace(location.origin + location.pathname + '#/bookingCode');
}
const toMy = () => { // 跳转到我的
// go('/me');
window.location.replace(location.origin + location.pathname + '#/my');
}
onMounted(async () => {
// TAG: 触发授权页面
await billListAPI({ page: 1, row_num: 1 });
});
const root = ref();
useClickAway(root, () => {
console.log('click outside!');
});
setTimeout(() => {
// TAG:微信分享
sharePage({});
}, 500)
</script>
<style lang="less" scoped>
.index-page {
position: relative;
height: 100vh;
background-image: url('https://cdn.ipadbiz.cn/xys/booking/bg.jpg');
background-repeat: no-repeat;
background-position: center;
.index-content {
height: 90vh;
.index-control {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 10vh;
// font-weight: bold;
font-size: 1.15rem;
.booking {
display: flex;
justify-content: center;
align-items: center;
background-color: #A67939;
border-radius: 7px;
color: #FFFFFF;
padding: 0.7rem 4rem;
border: 1px solid #A67939;
}
.record {
display: flex;
justify-content: center;
align-items: center;
color: #A67939;
border-radius: 7px;
padding: 0.7rem 4rem;
border: 1px solid #A67939;
margin-top: 1.5rem;
}
.search {
display: flex;
justify-content: center;
align-items: center;
color: #A67939;
border-radius: 7px;
padding: 0.7rem 4rem;
border: 1px solid #A67939;
margin-top: 1.5rem;
}
}
.index-circular {
position: relative;
display: flex;
align-items: center;
justify-content: center;
margin-top: 10vh;
// font-weight: bold;
font-size: 1.1rem;
.booking-wrapper {
height: 19vh;
width: 19vh;
border-radius: 50%;
background-color: rgba(166, 121, 57, 0.26);
display: flex;
align-items: center;
justify-content: center;
.booking {
height: 17vh;
width: 17vh;
border-radius: 50%;
background-color: #A67939;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
}
}
.logo {
position: absolute;
right: 0;
bottom: calc(15vh);
height: 30vh;
width: 20vw;
background-image: url('https://cdn.ipadbiz.cn/xys/booking/logo.png');
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
}
.my-swipe {
height: 30vh;
.van-swipe-item {
height: 30vh;
width: 100vw;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
}
.index-nav {
position: absolute;
bottom: 0;
left: 0;
width: 100vw;
height: 10vh;
background: #FFFFFF;
box-shadow: 0rem -0.33rem 0.25rem 0rem rgba(0,0,0,0.12);
display: flex;
align-items: center;
justify-content: space-around;
color: #A67939;
.nav-logo {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
}
}
}
</style>