Showing
8 changed files
with
296 additions
and
1 deletions
| ... | @@ -7,6 +7,8 @@ export {} | ... | @@ -7,6 +7,8 @@ export {} |
| 7 | 7 | ||
| 8 | declare module '@vue/runtime-core' { | 8 | declare module '@vue/runtime-core' { |
| 9 | export interface GlobalComponents { | 9 | export interface GlobalComponents { |
| 10 | + BookingCode: typeof import('./src/components/bookingCode.vue')['default'] | ||
| 11 | + QrCode: typeof import('./src/components/qrCode.vue')['default'] | ||
| 10 | RouterLink: typeof import('vue-router')['RouterLink'] | 12 | RouterLink: typeof import('vue-router')['RouterLink'] |
| 11 | RouterView: typeof import('vue-router')['RouterView'] | 13 | RouterView: typeof import('vue-router')['RouterView'] |
| 12 | VanButton: typeof import('vant/es')['Button'] | 14 | VanButton: typeof import('vant/es')['Button'] | ... | ... |
src/assets/images/刷新@2x.png
0 → 100644
7.61 KB
src/assets/images/右@2x.png
0 → 100644
1.32 KB
src/assets/images/左@2x.png
0 → 100644
1.34 KB
src/assets/images/暂无@2x.png
0 → 100644
16.6 KB
src/components/qrCode.vue
0 → 100644
| 1 | +<!-- | ||
| 2 | + * @Date: 2024-01-16 10:06:47 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2024-01-16 11:28:46 | ||
| 5 | + * @FilePath: /xysBooking/src/components/qrCode.vue | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | +--> | ||
| 8 | +<template> | ||
| 9 | + <div class="qr-code-page"> | ||
| 10 | + <div v-if="has_qrcode" class="show-qrcode"> | ||
| 11 | + <div class="qrcode-content"> | ||
| 12 | + <div class="user-info">{{ userinfo.name }} {{ userinfo.id }}</div> | ||
| 13 | + <div class="user-qrcode"> | ||
| 14 | + <div class="left" @click="prevCode"> | ||
| 15 | + <img src="https://cdn.ipadbiz.cn/xys/booking/%E5%B7%A6@2x.png"> | ||
| 16 | + </div> | ||
| 17 | + <div class="center"> | ||
| 18 | + <img src="https://cdn.ipadbiz.cn/xys/booking/WechatIMG576.jpg"> | ||
| 19 | + <div v-if="useStatus === '1'" class="qrcode-used"><p>二维码已使用</p></div> | ||
| 20 | + </div> | ||
| 21 | + <div class="right" @click="nextCode"> | ||
| 22 | + <img src="https://cdn.ipadbiz.cn/xys/booking/%E5%8F%B3@2x.png"> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + <div class="refresh" @click="refreshBtn"> | ||
| 26 | + <img src="https://cdn.ipadbiz.cn/xys/booking/%E5%88%B7%E6%96%B0@2x.png"> <div>刷新</div> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + <div class="user-list"> | ||
| 30 | + <div | ||
| 31 | + v-for="(item, index) in userList" | ||
| 32 | + :key="index" | ||
| 33 | + :class="['user-item', select_index === index ? 'checked' : '']"> | ||
| 34 | + {{ item.username }} | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + <div v-else class="no-qrcode"> | ||
| 39 | + <img src="https://cdn.ipadbiz.cn/xys/booking/%E6%9A%82%E6%97%A0@2x.png" style="width: 10rem;"> | ||
| 40 | + <div class="no-qrcode-title">您还没有预约过参观</div> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | +</template> | ||
| 44 | + | ||
| 45 | +<script setup> | ||
| 46 | +import { ref } from 'vue' | ||
| 47 | +import { useRoute, useRouter } from 'vue-router' | ||
| 48 | +import xctcCheck from "xctc-check" | ||
| 49 | +import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js' | ||
| 50 | +//import { } from '@/utils/generateModules.js' | ||
| 51 | +//import { } from '@/utils/generateIcons.js' | ||
| 52 | +//import { } from '@/composables' | ||
| 53 | +const $route = useRoute(); | ||
| 54 | +const $router = useRouter(); | ||
| 55 | +useTitle($route.meta.title); | ||
| 56 | + | ||
| 57 | +const id_number = ref('511522190103214279'); | ||
| 58 | + | ||
| 59 | +const formatId = computed(() => { | ||
| 60 | + return xctcCheck.formatInfoHide(id_number.value) | ||
| 61 | +}); | ||
| 62 | + | ||
| 63 | +const has_qrcode = ref(true); | ||
| 64 | + | ||
| 65 | +const select_index = ref(0); | ||
| 66 | +const userList = ref([{ | ||
| 67 | + id: '1', | ||
| 68 | + username: '张雨燕', | ||
| 69 | + id_code: '511522190103214279', | ||
| 70 | + qrcode: 'https://cdn.ipadbiz.cn/xys/booking/WechatIMG576.jpg', | ||
| 71 | + status: '0' | ||
| 72 | +}, { | ||
| 73 | + id: '2', | ||
| 74 | + username: '李仁和', | ||
| 75 | + id_code: '311522190103214279', | ||
| 76 | + qrcode: 'https://cdn.ipadbiz.cn/xys/booking/WechatIMG576.jpg', | ||
| 77 | + status: '1' | ||
| 78 | +}, { | ||
| 79 | + id: '3', | ||
| 80 | + username: '王二虎', | ||
| 81 | + id_code: '411522190103214279', | ||
| 82 | + qrcode: 'https://cdn.ipadbiz.cn/xys/booking/WechatIMG576.jpg', | ||
| 83 | + status: '0' | ||
| 84 | +}, { | ||
| 85 | + id: '4', | ||
| 86 | + username: '张雨燕2', | ||
| 87 | + id_code: '611522190103214279', | ||
| 88 | + qrcode: 'https://cdn.ipadbiz.cn/xys/booking/WechatIMG576.jpg', | ||
| 89 | + status: '1' | ||
| 90 | +}, { | ||
| 91 | + id: '5', | ||
| 92 | + username: '张雨燕3', | ||
| 93 | + id_code: '211522190103214279', | ||
| 94 | + qrcode: 'https://cdn.ipadbiz.cn/xys/booking/WechatIMG576.jpg', | ||
| 95 | + status: '0' | ||
| 96 | +}]); | ||
| 97 | + | ||
| 98 | +const prevCode = () => { | ||
| 99 | + select_index.value = select_index.value - 1; | ||
| 100 | + if (select_index.value < 0) { | ||
| 101 | + select_index.value = userList.value.length - 1; | ||
| 102 | + } | ||
| 103 | +}; | ||
| 104 | +const nextCode = () => { | ||
| 105 | + select_index.value = select_index.value + 1; | ||
| 106 | + if (select_index.value > userList.value.length - 1) { | ||
| 107 | + select_index.value = 0; | ||
| 108 | + } | ||
| 109 | +}; | ||
| 110 | + | ||
| 111 | +const userinfo = computed(() => { | ||
| 112 | + return { | ||
| 113 | + name: userList.value[select_index.value]['username'], | ||
| 114 | + id: xctcCheck.formatInfoHide(userList.value[select_index.value]['id_code']) | ||
| 115 | + }; | ||
| 116 | +}); | ||
| 117 | + | ||
| 118 | +const useStatus = computed(() => { | ||
| 119 | + return userList.value[select_index.value]['status']; | ||
| 120 | +}); | ||
| 121 | + | ||
| 122 | +const refreshBtn = () => { | ||
| 123 | + console.warn('refreshBtn'); | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | +onMounted(() => { | ||
| 127 | + | ||
| 128 | +}) | ||
| 129 | +</script> | ||
| 130 | + | ||
| 131 | +<style lang="less" scoped> | ||
| 132 | +.qr-code-page { | ||
| 133 | + .qrcode-content { | ||
| 134 | + padding: 1rem 0; | ||
| 135 | + display: flex; | ||
| 136 | + flex-direction: column; | ||
| 137 | + justify-content: center; | ||
| 138 | + align-items: center; | ||
| 139 | + // width: 100%; | ||
| 140 | + // height: 100%; | ||
| 141 | + background-color: #FFF; | ||
| 142 | + border-radius: 5px; | ||
| 143 | + box-shadow: 0rem 0rem 0.92rem 0rem rgba(106,106,106,0.27); | ||
| 144 | + .user-info { | ||
| 145 | + color: #A6A6A6; | ||
| 146 | + font-size: 1.15rem; | ||
| 147 | + margin-top: 0.5rem; | ||
| 148 | + margin-bottom: 1rem; | ||
| 149 | + } | ||
| 150 | + .user-qrcode { | ||
| 151 | + display: flex; | ||
| 152 | + align-items: center; | ||
| 153 | + .left { | ||
| 154 | + img { | ||
| 155 | + width: 1.75rem; margin-right: 0.5rem; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + .center { | ||
| 159 | + border: 1px solid #D1D1D1; | ||
| 160 | + border-radius: 20px; | ||
| 161 | + padding: 0.25rem; | ||
| 162 | + position: relative; | ||
| 163 | + img { | ||
| 164 | + width: 15rem; | ||
| 165 | + } | ||
| 166 | + div { | ||
| 167 | + position: absolute; | ||
| 168 | + top: 0; | ||
| 169 | + left: 0; | ||
| 170 | + right: 0; | ||
| 171 | + bottom: 0; | ||
| 172 | + background-color: rgba(106,106,106,0.6); | ||
| 173 | + // opacity: 0.49; | ||
| 174 | + border-radius: 20px; | ||
| 175 | + color: #FFF; | ||
| 176 | + text-align: center; | ||
| 177 | + p { | ||
| 178 | + position: absolute; | ||
| 179 | + top: 50%; | ||
| 180 | + left: 50%; | ||
| 181 | + transform: translate(-50%, -50%); | ||
| 182 | + font-size: 1.2rem; | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + .right { | ||
| 187 | + img { | ||
| 188 | + width: 1.75rem; | ||
| 189 | + margin-left: 0.5rem; | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + } | ||
| 193 | + .refresh { | ||
| 194 | + display: flex; | ||
| 195 | + justify-content: center; | ||
| 196 | + align-items: center; | ||
| 197 | + margin-top: 1rem; | ||
| 198 | + img { | ||
| 199 | + width: 3.5rem; | ||
| 200 | + } | ||
| 201 | + div { | ||
| 202 | + color: #A67939; font-size: 1.1rem; | ||
| 203 | + } | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + .user-list { | ||
| 207 | + display: flex; | ||
| 208 | + padding: 1rem; | ||
| 209 | + align-items: center; | ||
| 210 | + flex-wrap: wrap; | ||
| 211 | + .user-item { | ||
| 212 | + padding: 0.25rem 0.5rem; | ||
| 213 | + border: 1px solid #A67939; | ||
| 214 | + margin: 0.25rem; | ||
| 215 | + border-radius: 5px; | ||
| 216 | + color: #A67939; | ||
| 217 | + &.checked { | ||
| 218 | + color: #FFF; | ||
| 219 | + background-color: #A67939; | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + .no-qrcode { | ||
| 225 | + display: flex; | ||
| 226 | + justify-content: center; | ||
| 227 | + align-items: center; | ||
| 228 | + flex-direction: column; | ||
| 229 | + img { | ||
| 230 | + margin-top: 1rem; | ||
| 231 | + margin-bottom: 1rem; | ||
| 232 | + width: 10rem; | ||
| 233 | + } | ||
| 234 | + .no-qrcode-title { | ||
| 235 | + color: #A67939; | ||
| 236 | + font-size: 1.05rem; | ||
| 237 | + } | ||
| 238 | + } | ||
| 239 | +} | ||
| 240 | +</style> |
| 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: 2024-01-15 18:29:00 | 4 | + * @LastEditTime: 2024-01-16 10:07:28 |
| 5 | * @FilePath: /xysBooking/src/route.js | 5 | * @FilePath: /xysBooking/src/route.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -49,6 +49,13 @@ export default [ | ... | @@ -49,6 +49,13 @@ export default [ |
| 49 | }, | 49 | }, |
| 50 | }, | 50 | }, |
| 51 | { | 51 | { |
| 52 | + path: '/bookingCode', | ||
| 53 | + component: () => import('@/views/bookingCode.vue'), | ||
| 54 | + meta: { | ||
| 55 | + title: '预约码', | ||
| 56 | + }, | ||
| 57 | + }, | ||
| 58 | + { | ||
| 52 | path: '/auth', | 59 | path: '/auth', |
| 53 | component: () => import('@/views/auth.vue'), | 60 | component: () => import('@/views/auth.vue'), |
| 54 | meta: { | 61 | meta: { | ... | ... |
src/views/bookingCode.vue
0 → 100644
| 1 | +<!-- | ||
| 2 | + * @Date: 2024-01-16 10:06:47 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2024-01-16 11:27:36 | ||
| 5 | + * @FilePath: /xysBooking/src/views/bookingCode.vue | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | +--> | ||
| 8 | +<template> | ||
| 9 | + <div class="booking-code-page"> | ||
| 10 | + <qrCode></qrCode> | ||
| 11 | + <div class="warning"> | ||
| 12 | + <p><van-icon name="warning-o" /> 温馨提示</p> | ||
| 13 | + <p>一人一码,扫码或识别身份证成功后进入</p> | ||
| 14 | + </div> | ||
| 15 | + </div> | ||
| 16 | +</template> | ||
| 17 | + | ||
| 18 | +<script setup> | ||
| 19 | +import { ref } from 'vue' | ||
| 20 | +import { useRoute, useRouter } from 'vue-router' | ||
| 21 | +import xctcCheck from "xctc-check" | ||
| 22 | +import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js' | ||
| 23 | +//import { } from '@/utils/generateModules.js' | ||
| 24 | +//import { } from '@/utils/generateIcons.js' | ||
| 25 | +//import { } from '@/composables' | ||
| 26 | +import qrCode from '@/components/qrCode' | ||
| 27 | +const $route = useRoute(); | ||
| 28 | +const $router = useRouter(); | ||
| 29 | +useTitle($route.meta.title); | ||
| 30 | + | ||
| 31 | + | ||
| 32 | +onMounted(() => { | ||
| 33 | + | ||
| 34 | +}) | ||
| 35 | +</script> | ||
| 36 | + | ||
| 37 | +<style lang="less" scoped> | ||
| 38 | +.booking-code-page { | ||
| 39 | + padding: 1rem; | ||
| 40 | + | ||
| 41 | + .warning { | ||
| 42 | + text-align: center; | ||
| 43 | + color: #A67939; | ||
| 44 | + } | ||
| 45 | +} | ||
| 46 | +</style> |
-
Please register or login to post a comment