hookehuyr

feat(recall): 添加完善信息页并更新引导页样式

添加新的完善信息页面组件,包含表单验证和提交功能
更新引导页按钮样式以匹配设计规范
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 11:40:33 4 + * @LastEditTime: 2025-12-23 13:45:36
5 * @FilePath: /mlaj/src/router/routes.js 5 * @FilePath: /mlaj/src/router/routes.js
6 * @Description: 路由地址映射配置 6 * @Description: 路由地址映射配置
7 */ 7 */
...@@ -115,6 +115,12 @@ export const routes = [ ...@@ -115,6 +115,12 @@ export const routes = [
115 meta: { title: '召回老客户-引导页' }, 115 meta: { title: '召回老客户-引导页' },
116 }, 116 },
117 { 117 {
118 + path: '/recall/complete-info',
119 + name: 'CompleteInfo',
120 + component: () => import('../views/recall/CompleteInfoPage.vue'),
121 + meta: { title: '完善信息页' },
122 + },
123 + {
118 path: '/checkout', 124 path: '/checkout',
119 name: 'CheckoutPage', 125 name: 'CheckoutPage',
120 component: () => import('../views/checkout/CheckoutPage.vue'), 126 component: () => import('../views/checkout/CheckoutPage.vue'),
......
1 +<template>
2 + <div class="complete-info-page w-full min-h-screen relative overflow-hidden flex flex-col items-center">
3 + <!-- Starry Background Effect -->
4 + <StarryBackground :bg-image="bgImg" />
5 +
6 + <!-- Header Section -->
7 + <div class="mt-16 flex flex-col items-center z-10 w-full px-8 text-center">
8 + <h1 class="text-white text-3xl font-bold tracking-wider mb-3 drop-shadow-lg">完善信息</h1>
9 + <p class="text-white/80 text-sm tracking-wide font-medium">请确认和补全您的个人信息</p>
10 + </div>
11 +
12 + <!-- Form Card -->
13 + <div class="w-full px-6 mt-10 z-10">
14 + <FrostedGlass class="p-6 !rounded-2xl !border-white/20 !shadow-none" :bg-opacity="10" blur-level="md">
15 + <div class="space-y-6">
16 + <!-- Name Input -->
17 + <div class="form-item">
18 + <label class="block text-white font-bold text-base mb-2 tracking-wide">姓名</label>
19 + <van-field
20 + v-model="form.name"
21 + placeholder="请输入姓名"
22 + class="custom-input rounded-lg !bg-white/10 !text-white !border-[1px] !border-solid !border-[rgba(255,255,255,0.57)] !p-3"
23 + :border="false"
24 + />
25 + </div>
26 +
27 + <!-- Phone Input -->
28 + <div class="form-item">
29 + <label class="block text-white font-bold text-base mb-2 tracking-wide">手机号</label>
30 + <van-field
31 + v-model="form.phone"
32 + placeholder="请输入手机号"
33 + class="custom-input rounded-lg !bg-white/10 !text-white !border-[1px] !border-solid !border-[rgba(255,255,255,0.57)] !p-3"
34 + :border="false"
35 + type="tel"
36 + maxlength="11"
37 + />
38 + </div>
39 +
40 + <!-- ID Card Input -->
41 + <div class="form-item">
42 + <label class="block text-white font-bold text-base mb-2 tracking-wide">身份证号</label>
43 + <van-field
44 + v-model="form.idCard"
45 + placeholder="请输入您的身份证号"
46 + class="custom-input rounded-lg !bg-white/10 !text-white !border-[1px] !border-solid !border-[rgba(255,255,255,0.57)] !p-3"
47 + :border="false"
48 + />
49 + </div>
50 +
51 + <!-- Note -->
52 + <div class="flex items-start gap-2 mt-2">
53 + <img :src="starImg" class="w-3 h-3 mt-0.5 shrink-0" alt="star" />
54 + <p class="text-xs text-white/90 leading-relaxed tracking-wide text-justify">
55 + 时光机为每个身份证号找到的历史数据,只能参与一次(即一个账号的)星球币累积
56 + </p>
57 + </div>
58 + </div>
59 + </FrostedGlass>
60 + </div>
61 +
62 + <!-- Confirm Button -->
63 + <div class="w-full px-6 mt-auto z-10 mb-8">
64 + <van-button block
65 + class="submit-btn !rounded-lg !bg-transparent !border-[#FFDD01] !text-[#FFDD01] !font-bold !text-lg !h-[48px]"
66 + @click="handleConfirm">
67 + 确认
68 + </van-button>
69 + </div>
70 + </div>
71 +</template>
72 +
73 +<script setup>
74 +import { ref, reactive } from 'vue'
75 +import { useRoute, useRouter } from 'vue-router'
76 +import { useTitle } from '@vueuse/core'
77 +import { showToast } from 'vant'
78 +
79 +// Assets
80 +import bgImg from '@/assets/images/recall/bg01@2x.png'
81 +import starImg from '@/assets/images/recall/xing@2x.png'
82 +
83 +// Route
84 +const route = useRoute()
85 +const router = useRouter()
86 +useTitle(route.meta.title || '完善信息')
87 +
88 +// Form Data
89 +const form = reactive({
90 + name: '张开心', // Mock initial data as per design
91 + phone: '15658666022', // Mock initial data as per design
92 + idCard: ''
93 +})
94 +
95 +// Actions
96 +const handleConfirm = () => {
97 + if (!form.name) {
98 + showToast('请输入姓名')
99 + return
100 + }
101 + if (!form.phone) {
102 + showToast('请输入手机号')
103 + return
104 + }
105 + if (!form.idCard) {
106 + showToast('请输入身份证号')
107 + return
108 + }
109 +
110 + // 身份证号正则校验 (15位或18位)
111 + const idCardRegex = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
112 + if (!idCardRegex.test(form.idCard)) {
113 + showToast('请输入正确的身份证号')
114 + return
115 + }
116 +
117 + // Validation passed
118 + showToast('提交成功')
119 + // Navigate to next step or handle submission logic here
120 +}
121 +</script>
122 +
123 +<style lang="less" scoped>
124 +.submit-btn {
125 + background: linear-gradient(180deg, rgba(249, 243, 157, 0.19) 0%, rgba(219, 243, 48, 0.3) 100%) !important;
126 + backdrop-filter: blur(4px);
127 + box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
128 +
129 + &:active {
130 + transform: scale(0.99);
131 + }
132 +}
133 +
134 +:deep(.van-field__control) {
135 + color: white !important;
136 + &::placeholder {
137 + color: rgba(255, 255, 255, 0.5) !important;
138 + }
139 +}
140 +</style>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
39 <!-- Action Button --> 39 <!-- Action Button -->
40 <div class="w-full px-6 mt-auto z-10 mb-8"> 40 <div class="w-full px-6 mt-auto z-10 mb-8">
41 <van-button block 41 <van-button block
42 - class="submit-btn !rounded-lg !bg-[#3B82F6] !border-[#FFDD01] !text-[#FFDD01] !font-bold !text-lg !h-[48px]" 42 + class="submit-btn !rounded-lg !bg-transparent !border-[#FFDD01] !text-[#FFDD01] !font-bold !text-lg !h-[48px]"
43 @click="handleNext"> 43 @click="handleNext">
44 完善个人信息 44 完善个人信息
45 </van-button> 45 </van-button>
...@@ -68,7 +68,7 @@ const handleNext = () => { ...@@ -68,7 +68,7 @@ const handleNext = () => {
68 <style lang="less" scoped> 68 <style lang="less" scoped>
69 .submit-btn { 69 .submit-btn {
70 // Add a subtle gradient for better visual 70 // Add a subtle gradient for better visual
71 - background: linear-gradient(180deg, rgba(59, 130, 246, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%) !important; 71 + background: linear-gradient(180deg, rgba(249, 243, 157, 0.19) 0%, rgba(219, 243, 48, 0.3) 100%) !important;
72 backdrop-filter: blur(4px); 72 backdrop-filter: blur(4px);
73 box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); 73 box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
74 74
......