hookehuyr

fix

1 <!-- 1 <!--
2 * @Date: 2023-06-13 13:26:46 2 * @Date: 2023-06-13 13:26:46
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-08-25 17:33:44 4 + * @LastEditTime: 2023-08-25 21:39:03
5 * @FilePath: /bieyuan/src/App.vue 5 * @FilePath: /bieyuan/src/App.vue
6 - * @Description: 文件描述 6 + * @Description: 启动页
7 --> 7 -->
8 <template> 8 <template>
9 <div class="bg-wrapper"> 9 <div class="bg-wrapper">
...@@ -72,11 +72,11 @@ onMounted(async () => { ...@@ -72,11 +72,11 @@ onMounted(async () => {
72 <style lang="less"> 72 <style lang="less">
73 @prefix: ~'@{namespace}-x'; 73 @prefix: ~'@{namespace}-x';
74 74
75 -html, 75 +// html,
76 -body { 76 +// body {
77 - // width: 100%; 77 +// width: 100%;
78 - // height: 100%; 78 +// height: 100%;
79 -} 79 +// }
80 80
81 body { 81 body {
82 position: relative; 82 position: relative;
...@@ -88,6 +88,7 @@ body { ...@@ -88,6 +88,7 @@ body {
88 // --van-blue: #F9D95C; 88 // --van-blue: #F9D95C;
89 89
90 background-color: #F7EFEB; 90 background-color: #F7EFEB;
91 +
91 p { 92 p {
92 margin: 0; 93 margin: 0;
93 padding: 0; 94 padding: 0;
...@@ -112,22 +113,25 @@ body { ...@@ -112,22 +113,25 @@ body {
112 padding: 1rem; 113 padding: 1rem;
113 padding-bottom: 0; 114 padding-bottom: 0;
114 background-image: url('https://cdn.ipadbiz.cn/bieyuan/bg@2x~1.png'); 115 background-image: url('https://cdn.ipadbiz.cn/bieyuan/bg@2x~1.png');
115 - background-repeat:no-repeat; 116 + background-repeat: no-repeat;
116 } 117 }
118 +
117 .box-wrapper { 119 .box-wrapper {
118 background: #FFFFFF; 120 background: #FFFFFF;
119 - box-shadow: 0px 0px 13px 0px rgba(95,69,54,0.25); 121 + box-shadow: 0px 0px 13px 0px rgba(95, 69, 54, 0.25);
120 border-radius: 10px; 122 border-radius: 10px;
121 border-bottom-right-radius: 0; 123 border-bottom-right-radius: 0;
122 border-bottom-left-radius: 0; 124 border-bottom-left-radius: 0;
123 min-height: calc(100vh - 1rem); 125 min-height: calc(100vh - 1rem);
126 +
124 .box-top { 127 .box-top {
125 padding: 0 1rem 1rem; 128 padding: 0 1rem 1rem;
126 height: 1rem; 129 height: 1rem;
127 background-image: url('https://cdn.ipadbiz.cn/bieyuan/top@2x~1.png'); 130 background-image: url('https://cdn.ipadbiz.cn/bieyuan/top@2x~1.png');
128 - background-repeat:no-repeat; 131 + background-repeat: no-repeat;
129 background-size: calc(100% - 2rem); 132 background-size: calc(100% - 2rem);
130 - background-position: 1rem 0; /* 向右位移 1rem */ 133 + background-position: 1rem 0;
134 + /* 向右位移 1rem */
131 } 135 }
132 } 136 }
133 </style> 137 </style>
......
1 <!-- 1 <!--
2 * @Date: 2023-06-21 10:23:09 2 * @Date: 2023-06-21 10:23:09
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-08-25 16:31:01 4 + * @LastEditTime: 2023-08-25 21:39:47
5 * @FilePath: /bieyuan/src/views/index.vue 5 * @FilePath: /bieyuan/src/views/index.vue
6 - * @Description: 文件描述 6 + * @Description: 预约页首页
7 --> 7 -->
8 <template> 8 <template>
9 <div class="index-page"> 9 <div class="index-page">
...@@ -63,44 +63,37 @@ ...@@ -63,44 +63,37 @@
63 <div class="shortcut-bottom"></div> 63 <div class="shortcut-bottom"></div>
64 64
65 <div class="bookingBox"> 65 <div class="bookingBox">
66 - <van-row> 66 + <van-row>
67 - <van-col span="6" class="text">预约人数</van-col> 67 + <van-col span="6" class="text">预约人数</van-col>
68 - <van-col span="18" class="control"> 68 + <van-col span="18" class="control">
69 - <van-row style="line-height: 3rem;" gutter="10"> 69 + <van-row style="line-height: 3rem;" gutter="10">
70 - <van-col span="4" style="text-align: center;"> 70 + <van-col span="4" style="text-align: center;">
71 - <div @click="clickMinus" class="minus"> 71 + <div @click="clickMinus" class="minus">
72 <van-icon size="0.85rem" name="https://cdn.ipadbiz.cn/bieyuan/-@2x.png" /> 72 <van-icon size="0.85rem" name="https://cdn.ipadbiz.cn/bieyuan/-@2x.png" />
73 </div> 73 </div>
74 - </van-col> 74 + </van-col>
75 - <van-col span="12" style="text-align: center;"> 75 + <van-col span="12" style="text-align: center;">
76 - <input v-model="num" type="number" class="input_num"> 76 + <input v-model="num" type="number" class="input_num">
77 - </van-col> 77 + </van-col>
78 - <van-col span="4" style="text-align: center;"> 78 + <van-col span="4" style="text-align: center;">
79 - <span>人</span> 79 + <span>人</span>
80 - </van-col> 80 + </van-col>
81 - <van-col span="4" style="text-align: center;"> 81 + <van-col span="4" style="text-align: center;">
82 - <div @click="clickPlus" class="plus"> 82 + <div @click="clickPlus" class="plus">
83 <van-icon size="0.85rem" name="https://cdn.ipadbiz.cn/bieyuan/+@2x.png" /> 83 <van-icon size="0.85rem" name="https://cdn.ipadbiz.cn/bieyuan/+@2x.png" />
84 </div> 84 </div>
85 - </van-col> 85 + </van-col>
86 - </van-row> 86 + </van-row>
87 - </van-col> 87 + </van-col>
88 - </van-row> 88 + </van-row>
89 - </div> 89 + </div>
90 90
91 <div> 91 <div>
92 <div @click="clickNext" class="next-btn">下一步</div> 92 <div @click="clickNext" class="next-btn">下一步</div>
93 </div> 93 </div>
94 94
95 - <van-calendar 95 + <van-calendar v-model:show="show" type="multiple" :max-range="7" :formatter="formatter" :max-date="maxDate"
96 - v-model:show="show" 96 + color="#93663D" @confirm="onConfirm" />
97 - type="multiple"
98 - :max-range="7"
99 - :formatter="formatter"
100 - :max-date="maxDate"
101 - color="#93663D"
102 - @confirm="onConfirm"
103 - />
104 </div> 97 </div>
105 </template> 98 </template>
106 99
...@@ -290,17 +283,20 @@ const isMinValue = (array, value) => { // 判断输入值是否小于数组中 ...@@ -290,17 +283,20 @@ const isMinValue = (array, value) => { // 判断输入值是否小于数组中
290 <style lang="less" scoped> 283 <style lang="less" scoped>
291 .index-page { 284 .index-page {
292 padding: 1rem 1rem 0; 285 padding: 1rem 1rem 0;
286 +
293 .app-time { 287 .app-time {
294 padding-bottom: 0.5rem; 288 padding-bottom: 0.5rem;
295 border-bottom: 1px solid #D7D7D7; 289 border-bottom: 1px solid #D7D7D7;
296 font-weight: bold; 290 font-weight: bold;
297 font-size: 1.05rem; 291 font-size: 1.05rem;
298 } 292 }
293 +
299 .shortcut-wrapper { 294 .shortcut-wrapper {
300 padding-top: 2rem; 295 padding-top: 2rem;
301 display: flex; 296 display: flex;
302 align-items: flex-end; 297 align-items: flex-end;
303 } 298 }
299 +
304 .shortcut-bottom { 300 .shortcut-bottom {
305 width: 100%; 301 width: 100%;
306 height: 4px; 302 height: 4px;
...@@ -393,6 +389,7 @@ const isMinValue = (array, value) => { // 判断输入值是否小于数组中 ...@@ -393,6 +389,7 @@ const isMinValue = (array, value) => { // 判断输入值是否小于数组中
393 display: inline-block; 389 display: inline-block;
394 390
395 } 391 }
392 +
396 // .input-box { 393 // .input-box {
397 // width: 40%; 394 // width: 40%;
398 // display: inline-block; 395 // display: inline-block;
......
1 <!-- 1 <!--
2 * @Date: 2023-08-22 14:13:07 2 * @Date: 2023-08-22 14:13:07
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-08-25 19:20:46 4 + * @LastEditTime: 2023-08-25 21:39:23
5 * @FilePath: /bieyuan/src/views/next.vue 5 * @FilePath: /bieyuan/src/views/next.vue
6 - * @Description: 文件描述 6 + * @Description: 预约用户信息录入页
7 --> 7 -->
8 <template> 8 <template>
9 <div class="next-page"> 9 <div class="next-page">
...@@ -11,21 +11,26 @@ ...@@ -11,21 +11,26 @@
11 <div v-for="(item, index) in userInfo" :key="index" class="input-box"> 11 <div v-for="(item, index) in userInfo" :key="index" class="input-box">
12 <p class="title">{{ index + 1 }}.&nbsp;{{ index === 0 ? '我的信息' : '同行人' }}</p> 12 <p class="title">{{ index + 1 }}.&nbsp;{{ index === 0 ? '我的信息' : '同行人' }}</p>
13 <van-field :id="'name' + index" v-model="item.name" label="姓名:" type="text" placeholder="请输入姓名" :border="false" 13 <van-field :id="'name' + index" v-model="item.name" label="姓名:" type="text" placeholder="请输入姓名" :border="false"
14 - :rules="[{ required: true, message: '请填写姓名' }]" label-width="4em" class="input-text" @focus="onFocus" @keydown="handleKeyDown" /> 14 + :rules="[{ required: true, message: '请填写姓名' }]" label-width="4em" class="input-text" @focus="onFocus"
15 - <van-field :id="'phone' + index" v-model="item.phone" maxlength="11" label="手机号:" type="digit" placeholder="请输入手机号" :border="false" 15 + @keydown="handleKeyDown" />
16 - :rules="[{ validator: validatorPhone, message: '请输入正确手机号' }]" label-width="4em" class="input-text" @focus="onFocus" @keydown="handleKeyDown" /> 16 + <van-field :id="'phone' + index" v-model="item.phone" maxlength="11" label="手机号:" type="digit"
17 + placeholder="请输入手机号" :border="false" :rules="[{ validator: validatorPhone, message: '请输入正确手机号' }]"
18 + label-width="4em" class="input-text" @focus="onFocus" @keydown="handleKeyDown" />
17 <van-field label="证件类型:" :border="false" label-width="4.5em"> 19 <van-field label="证件类型:" :border="false" label-width="4.5em">
18 <template #input> 20 <template #input>
19 - <van-radio-group v-model="item.id_type" direction="horizontal" checked-color="#93663D" style="height: 2.5rem;"> 21 + <van-radio-group v-model="item.id_type" direction="horizontal" checked-color="#93663D"
22 + style="height: 2.5rem;">
20 <van-radio name="id_card">身份证</van-radio> 23 <van-radio name="id_card">身份证</van-radio>
21 <van-radio name="passport">护照</van-radio> 24 <van-radio name="passport">护照</van-radio>
22 </van-radio-group> 25 </van-radio-group>
23 </template> 26 </template>
24 </van-field> 27 </van-field>
25 - <van-field :id="'id_type' + index" v-if="item.id_type === 'id_card'" v-model="item.id_number" label="身份证:" type="text" placeholder="请输入身份证号" :border="false" 28 + <van-field :id="'id_type' + index" v-if="item.id_type === 'id_card'" v-model="item.id_number" label="身份证:"
26 - :rules="[{ validator: validatorId, message: '请填写正确身份证号' }]" label-width="4em" class="input-text" @focus="onFocus" @keydown="handleKeyDown" /> 29 + type="text" placeholder="请输入身份证号" :border="false" :rules="[{ validator: validatorId, message: '请填写正确身份证号' }]"
27 - <van-field :id="'id_type' + index" v-else v-model="item.id_number" label="护照:" type="text" placeholder="请输入护照号" :border="false" 30 + label-width="4em" class="input-text" @focus="onFocus" @keydown="handleKeyDown" />
28 - :rules="[{ required: true, message: '请填写正确护照号' }]" label-width="4em" class="input-text" @focus="onFocus" @keydown="handleKeyDown" /> 31 + <van-field :id="'id_type' + index" v-else v-model="item.id_number" label="护照:" type="text" placeholder="请输入护照号"
32 + :border="false" :rules="[{ required: true, message: '请填写正确护照号' }]" label-width="4em" class="input-text"
33 + @focus="onFocus" @keydown="handleKeyDown" />
29 </div> 34 </div>
30 <div style="padding: 2rem;"> 35 <div style="padding: 2rem;">
31 <van-button block type="primary" color="#93663D" native-type="submit"> 36 <van-button block type="primary" color="#93663D" native-type="submit">
...@@ -53,12 +58,6 @@ useTitle($route.meta.title); ...@@ -53,12 +58,6 @@ useTitle($route.meta.title);
53 const store = mainStore(); 58 const store = mainStore();
54 const { appUserInfo } = storeToRefs(store); 59 const { appUserInfo } = storeToRefs(store);
55 60
56 -// // 监听路由离开
57 -// onBeforeRouteLeave((to, from, next) => {
58 -// console.warn('leave');
59 -// next()
60 -// })
61 -
62 const userInfo = ref([]); // 用户预约信息 61 const userInfo = ref([]); // 用户预约信息
63 const num = ref(1); 62 const num = ref(1);
64 const keyDownList = ref([]); 63 const keyDownList = ref([]);
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
26 <van-row style="line-height: 3rem;" gutter="10"> 26 <van-row style="line-height: 3rem;" gutter="10">
27 <van-col span="4" style="text-align: center;"> 27 <van-col span="4" style="text-align: center;">
28 <div @click="clickMinus" class="minus"> 28 <div @click="clickMinus" class="minus">
29 - <van-icon size="0.85rem" name="https://cdn.ipadbiz.cn/bieyuan/-@2x.png" /> 29 + <van-icon size="0.85rem" name="https://cdn.ipadbiz.cn/bieyuan/-@2x.png" />
30 - </div> 30 + </div>
31 </van-col> 31 </van-col>
32 <van-col span="12" style="text-align: center;"> 32 <van-col span="12" style="text-align: center;">
33 <input v-model="num" type="number" class="input_num"> 33 <input v-model="num" type="number" class="input_num">
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
37 </van-col> 37 </van-col>
38 <van-col span="4" style="text-align: center;"> 38 <van-col span="4" style="text-align: center;">
39 <div @click="clickPlus" class="plus"> 39 <div @click="clickPlus" class="plus">
40 - <van-icon size="0.85rem" name="https://cdn.ipadbiz.cn/bieyuan/+@2x.png" /> 40 + <van-icon size="0.85rem" name="https://cdn.ipadbiz.cn/bieyuan/+@2x.png" />
41 - </div> 41 + </div>
42 </van-col> 42 </van-col>
43 </van-row> 43 </van-row>
44 </van-col> 44 </van-col>
...@@ -49,16 +49,8 @@ ...@@ -49,16 +49,8 @@
49 <div @click="clickNext" class="next-btn">下一步</div> 49 <div @click="clickNext" class="next-btn">下一步</div>
50 </div> 50 </div>
51 51
52 - <van-calendar 52 + <van-calendar v-model:show="show" :default-date="defaultDate" type="multiple" :max-range="7" :formatter="formatter"
53 - v-model:show="show" 53 + :max-date="maxDate" color="#93663D" @confirm="onConfirm" />
54 - :default-date="defaultDate"
55 - type="multiple"
56 - :max-range="7"
57 - :formatter="formatter"
58 - :max-date="maxDate"
59 - color="#93663D"
60 - @confirm="onConfirm"
61 - />
62 </div> 54 </div>
63 </template> 55 </template>
64 56
...@@ -85,7 +77,7 @@ onMounted(async () => { ...@@ -85,7 +77,7 @@ onMounted(async () => {
85 if (localStorage.getItem('save_selected_dates')) { // 如果缓存过以缓存为先 77 if (localStorage.getItem('save_selected_dates')) { // 如果缓存过以缓存为先
86 dates = JSON.parse(localStorage.getItem('save_selected_dates')); 78 dates = JSON.parse(localStorage.getItem('save_selected_dates'));
87 } 79 }
88 - const { data } = await orderRestCountAPI({ dates: dates.join(',')}); 80 + const { data } = await orderRestCountAPI({ dates: dates.join(',') });
89 shortcut.value = data; 81 shortcut.value = data;
90 // 上一页选择的预约人数 82 // 上一页选择的预约人数
91 num.value = $route.query.count ? +$route.query.count : 1; 83 num.value = $route.query.count ? +$route.query.count : 1;
...@@ -185,7 +177,7 @@ const onConfirm = async (dates) => { ...@@ -185,7 +177,7 @@ const onConfirm = async (dates) => {
185 defaultDate.value.push(dayjs(date).toDate()) 177 defaultDate.value.push(dayjs(date).toDate())
186 }); 178 });
187 // 后台请求数据 179 // 后台请求数据
188 - const { data } = await orderRestCountAPI({ dates : selectedDates.value.join(',') }); 180 + const { data } = await orderRestCountAPI({ dates: selectedDates.value.join(',') });
189 shortcut.value = data; 181 shortcut.value = data;
190 shortcut.value.forEach(item => { 182 shortcut.value.forEach(item => {
191 item.checked = true; 183 item.checked = true;
...@@ -201,7 +193,7 @@ const clickMinus = () => { // 减少预约数 ...@@ -201,7 +193,7 @@ const clickMinus = () => { // 减少预约数
201 } 193 }
202 const clickPlus = () => { // 新增预约数 194 const clickPlus = () => { // 新增预约数
203 if (num.value.toString().length < 3) { 195 if (num.value.toString().length < 3) {
204 - num.value = num.value + 1 196 + num.value = num.value + 1
205 } 197 }
206 } 198 }
207 199
...@@ -337,6 +329,7 @@ const clickNext = () => { // 点击下一步按钮 ...@@ -337,6 +329,7 @@ const clickNext = () => { // 点击下一步按钮
337 display: inline-block; 329 display: inline-block;
338 330
339 } 331 }
332 +
340 // .input-box { 333 // .input-box {
341 // width: 40%; 334 // width: 40%;
342 // display: inline-block; 335 // display: inline-block;
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
26 </van-col> 26 </van-col>
27 <van-col span="18" style="text-align: center;"> 27 <van-col span="18" style="text-align: center;">
28 <div class="qr-box"> 28 <div class="qr-box">
29 - <van-icon size="13rem" :name="app_info_list[checkedIndex]?.qr_code" style="border: 1px dashed #93663D; width: 100%; overflow: hidden;" /> 29 + <van-icon size="13rem" :name="app_info_list[checkedIndex]?.qr_code"
30 + style="border: 1px dashed #93663D; width: 100%; overflow: hidden;" />
30 </div> 31 </div>
31 </van-col> 32 </van-col>
32 <van-col span="3"> 33 <van-col span="3">
...@@ -68,36 +69,33 @@ onMounted(async () => { ...@@ -68,36 +69,33 @@ onMounted(async () => {
68 if (data) { 69 if (data) {
69 // 预约日期集合 70 // 预约日期集合
70 app_time.value = data.dates; 71 app_time.value = data.dates;
71 - // 72 + // 生成二维码列表
72 data.details.forEach((item, index) => { 73 data.details.forEach((item, index) => {
73 app_info_list.value.push({ 74 app_info_list.value.push({
74 name: item.name, 75 name: item.name,
75 - checked: index ? false : true, 76 + checked: index ? false : true, // 默认选中第一个
76 qr_code: 'http://oa.onwall.cn/admin?m=srv&a=get_qrcode&key=' + item.qrcode_content, 77 qr_code: 'http://oa.onwall.cn/admin?m=srv&a=get_qrcode&key=' + item.qrcode_content,
77 }); 78 });
78 }); 79 });
79 } 80 }
80 - // TAG: 清除用户填写信息
81 - store.changeUserInfo([]);
82 }) 81 })
83 82
84 const app_time = ref([]); 83 const app_time = ref([]);
85 -const appTimeShow = computed(() => { 84 +const appTimeShow = computed(() => { // 页面显示日期格式化
86 return app_time.value.join(',') 85 return app_time.value.join(',')
87 }); 86 });
88 87
89 -const handleLeftIcon = computed(() => { 88 +const handleLeftIcon = computed(() => { // 左滚动图标切换
90 return checkedIndex.value === 0 ? 'https://cdn.ipadbiz.cn/bieyuan/left002@2x.png' : 'https://cdn.ipadbiz.cn/bieyuan/left001@2x.png' 89 return checkedIndex.value === 0 ? 'https://cdn.ipadbiz.cn/bieyuan/left002@2x.png' : 'https://cdn.ipadbiz.cn/bieyuan/left001@2x.png'
91 }); 90 });
92 -const handleRightIcon = computed(() => { 91 +const handleRightIcon = computed(() => { // 右滚动图标切换
93 return app_info_list.value.length - 1 === checkedIndex.value ? 'https://cdn.ipadbiz.cn/bieyuan/right002@2x.png' : 'https://cdn.ipadbiz.cn/bieyuan/right001@2x.png' 92 return app_info_list.value.length - 1 === checkedIndex.value ? 'https://cdn.ipadbiz.cn/bieyuan/right002@2x.png' : 'https://cdn.ipadbiz.cn/bieyuan/right001@2x.png'
94 }); 93 });
95 94
96 const app_info_list = ref([]); 95 const app_info_list = ref([]);
97 -
98 const checkedIndex = ref(0); 96 const checkedIndex = ref(0);
99 97
100 -const toggleItem = (item) => { 98 +const toggleItem = (item) => { // 点击人名操作
101 app_info_list.value.forEach((info) => { 99 app_info_list.value.forEach((info) => {
102 info.checked = false; 100 info.checked = false;
103 }); 101 });
...@@ -107,13 +105,14 @@ const toggleItem = (item) => { ...@@ -107,13 +105,14 @@ const toggleItem = (item) => {
107 } 105 }
108 106
109 const show = ref(false); 107 const show = ref(false);
110 -const cancelApp = () => { 108 +const cancelApp = () => { // 点击取消预约按钮
111 show.value = true; 109 show.value = true;
112 nextTick(() => { 110 nextTick(() => {
113 $('.van-popup.van-popup--center.van-dialog').css('width', '320px') 111 $('.van-popup.van-popup--center.van-dialog').css('width', '320px')
114 }) 112 })
115 } 113 }
116 -const onConfirm = async () => { 114 +
115 +const onConfirm = async () => { // 确认取消预约
117 const { code } = await orderCancelAPI({ id: $route.query.id }); 116 const { code } = await orderCancelAPI({ id: $route.query.id });
118 if (code) { 117 if (code) {
119 showSuccessToast('取消成功!'); 118 showSuccessToast('取消成功!');
...@@ -240,8 +239,4 @@ const handleRight = () => { // 右侧滚动 ...@@ -240,8 +239,4 @@ const handleRight = () => { // 右侧滚动
240 margin: 0 auto; 239 margin: 0 auto;
241 } 240 }
242 } 241 }
243 -
244 -// .van-button--default {
245 -// background: #93663D;
246 -// }
247 </style> 242 </style>
......