feat(recall): 添加身份证号查询页面和路由配置
新增身份证号查询页面组件(IDQueryPage.vue)并配置对应路由 添加相关静态资源图片用于页面展示
Showing
3 changed files
with
130 additions
and
1 deletions
src/assets/images/recall/no@2x.png
0 → 100644
41.4 KB
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-03-20 20:36:36 | 2 | * @Date: 2025-03-20 20:36:36 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-23 13:45:36 | 4 | + * @LastEditTime: 2025-12-23 14:27:58 |
| 5 | * @FilePath: /mlaj/src/router/routes.js | 5 | * @FilePath: /mlaj/src/router/routes.js |
| 6 | * @Description: 路由地址映射配置 | 6 | * @Description: 路由地址映射配置 |
| 7 | */ | 7 | */ |
| ... | @@ -121,6 +121,18 @@ export const routes = [ | ... | @@ -121,6 +121,18 @@ export const routes = [ |
| 121 | meta: { title: '完善信息页' }, | 121 | meta: { title: '完善信息页' }, |
| 122 | }, | 122 | }, |
| 123 | { | 123 | { |
| 124 | + path: '/recall/id-query', | ||
| 125 | + name: 'IDQuery', | ||
| 126 | + component: () => import('../views/recall/IDQueryPage.vue'), | ||
| 127 | + meta: { title: '身份证号查询信息页' }, | ||
| 128 | + }, | ||
| 129 | + { | ||
| 130 | + path: '/recall/timeline', | ||
| 131 | + name: 'Timeline', | ||
| 132 | + component: () => import('../views/recall/timeline.vue'), | ||
| 133 | + meta: { title: '加入时间/活动记录' }, | ||
| 134 | + }, | ||
| 135 | + { | ||
| 124 | path: '/checkout', | 136 | path: '/checkout', |
| 125 | name: 'CheckoutPage', | 137 | name: 'CheckoutPage', |
| 126 | component: () => import('../views/checkout/CheckoutPage.vue'), | 138 | component: () => import('../views/checkout/CheckoutPage.vue'), | ... | ... |
src/views/recall/IDQueryPage.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="id-query-page w-full min-h-screen relative overflow-hidden flex flex-col items-center"> | ||
| 3 | + <!-- Starry Background --> | ||
| 4 | + <StarryBackground :bg-image="bgImg" /> | ||
| 5 | + | ||
| 6 | + <!-- Main Content Card --> | ||
| 7 | + <div class="w-full px-6 mt-20 z-10"> | ||
| 8 | + <FrostedGlass class="p-6 !rounded-2xl !border-white/20 !shadow-none" :bg-opacity="10" blur-level="md"> | ||
| 9 | + <!-- Illustration --> | ||
| 10 | + <div class="flex justify-center mb-2"> | ||
| 11 | + <!-- Placeholder for the illustration --> | ||
| 12 | + <img :src="emptyStateImg" class="w-32 h-32 object-contain" alt="No Data" /> | ||
| 13 | + </div> | ||
| 14 | + | ||
| 15 | + <!-- Description Text --> | ||
| 16 | + <p class="text-[#FFDD01] text-center text-sm mb-6 leading-relaxed tracking-wide"> | ||
| 17 | + 时光机没有找到您的历史活动信息,<br /> | ||
| 18 | + 试试输入活动报名时登记的身份证号吧~ | ||
| 19 | + </p> | ||
| 20 | + | ||
| 21 | + <!-- Dashed Separator --> | ||
| 22 | + <div class="w-full h-[1px] border-t border-dashed border-white/30 my-8"></div> | ||
| 23 | + | ||
| 24 | + <!-- ID Card Input Section --> | ||
| 25 | + <div class="space-y-4"> | ||
| 26 | + <label class="block text-white font-bold text-lg tracking-wide">身份证号</label> | ||
| 27 | + <van-field | ||
| 28 | + v-model="idCard" | ||
| 29 | + placeholder="请输入您的身份证号" | ||
| 30 | + class="custom-input rounded-lg !bg-white/10 !text-white !border-[1px] !border-solid !border-[rgba(255,255,255,0.57)] !p-3" | ||
| 31 | + :border="false" | ||
| 32 | + clearable | ||
| 33 | + /> | ||
| 34 | + | ||
| 35 | + <!-- Notes --> | ||
| 36 | + <div class="space-y-4" style="margin-top: 2rem;"> | ||
| 37 | + <!-- Note 1 --> | ||
| 38 | + <div class="flex items-start gap-2"> | ||
| 39 | + <img :src="starImg" class="w-3 h-3 mt-0.5 shrink-0" alt="star" /> | ||
| 40 | + <p class="text-xs text-white/90 leading-relaxed tracking-wide text-justify"> | ||
| 41 | + 时光机为该身份证号找到的历史数据,收集到的星球币都将计入您的账号中,请谨慎如实填写 | ||
| 42 | + </p> | ||
| 43 | + </div> | ||
| 44 | + <!-- Note 2 --> | ||
| 45 | + <div class="flex items-start gap-2"> | ||
| 46 | + <img :src="starImg" class="w-3 h-3 mt-0.5 shrink-0" alt="star" /> | ||
| 47 | + <p class="text-xs text-white/90 leading-relaxed tracking-wide text-justify"> | ||
| 48 | + 时光机为每个身份证号找到的历史数据,只能参与一次(即一个账号的)星球币累积 | ||
| 49 | + </p> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | + </FrostedGlass> | ||
| 54 | + </div> | ||
| 55 | + | ||
| 56 | + <!-- Confirm Button --> | ||
| 57 | + <div class="w-full px-6 mt-auto z-10 mb-8"> | ||
| 58 | + <van-button block | ||
| 59 | + class="submit-btn !rounded-lg !bg-transparent !border-[#FFDD01] !text-[#FFDD01] !font-bold !text-lg !h-[48px]" | ||
| 60 | + @click="handleConfirm"> | ||
| 61 | + 确认 | ||
| 62 | + </van-button> | ||
| 63 | + </div> | ||
| 64 | + </div> | ||
| 65 | +</template> | ||
| 66 | + | ||
| 67 | +<script setup> | ||
| 68 | +import { ref } from 'vue' | ||
| 69 | +import { useRoute, useRouter } from 'vue-router' | ||
| 70 | +import { useTitle } from '@vueuse/core' | ||
| 71 | +import { showToast } from 'vant' | ||
| 72 | + | ||
| 73 | +// Assets | ||
| 74 | +import bgImg from '@/assets/images/recall/bg01@2x.png' | ||
| 75 | +import starImg from '@/assets/images/recall/xing@2x.png' | ||
| 76 | +import emptyStateImg from '@/assets/images/recall/no@2x.png' | ||
| 77 | + | ||
| 78 | +const route = useRoute() | ||
| 79 | +const router = useRouter() | ||
| 80 | +useTitle('身份证号查询') | ||
| 81 | + | ||
| 82 | +const idCard = ref('') | ||
| 83 | + | ||
| 84 | +// ID Card Validation | ||
| 85 | +const validateIdCard = (id) => { | ||
| 86 | + // 15 or 18 digit validation | ||
| 87 | + const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ | ||
| 88 | + return reg.test(id) | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +const handleConfirm = () => { | ||
| 92 | + if (!idCard.value) { | ||
| 93 | + showToast('请输入身份证号') | ||
| 94 | + return | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + if (!validateIdCard(idCard.value)) { | ||
| 98 | + showToast('请输入正确的身份证号') | ||
| 99 | + return | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + // TODO: Submit logic | ||
| 103 | + showToast('验证通过') | ||
| 104 | + // router.push(...) | ||
| 105 | +} | ||
| 106 | +</script> | ||
| 107 | + | ||
| 108 | +<style lang="less" scoped> | ||
| 109 | +.custom-input { | ||
| 110 | + ::v-deep(.van-field__control) { | ||
| 111 | + color: #fff; | ||
| 112 | + &::placeholder { | ||
| 113 | + color: rgba(255, 255, 255, 0.5); | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | +} | ||
| 117 | +</style> |
-
Please register or login to post a comment