fix: 移除表单默认值和优化功能逻辑
- 移除IDQueryPage、CompleteInfoPage和PosterPage中的默认表单值 - 在PointsPage中添加localStorage缓存清理逻辑 - 优化pointsPage中的余额显示格式 - 调整ActivityHistoryPage中的路由参数和日期排序逻辑
Showing
6 changed files
with
13 additions
and
11 deletions
| ... | @@ -199,7 +199,7 @@ const onLoad = async () => { | ... | @@ -199,7 +199,7 @@ const onLoad = async () => { |
| 199 | 199 | ||
| 200 | if (res && res.data) { | 200 | if (res && res.data) { |
| 201 | if (res.data.balance !== undefined) { | 201 | if (res.data.balance !== undefined) { |
| 202 | - balance.value = res.data.balance | 202 | + balance.value = res.data.balance ? Number(res.data.balance).toLocaleString() : '0' |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | const newItems = res.data.point_list || [] | 205 | const newItems = res.data.point_list || [] | ... | ... |
| ... | @@ -123,8 +123,7 @@ const missingInfo = ref('') | ... | @@ -123,8 +123,7 @@ const missingInfo = ref('') |
| 123 | 123 | ||
| 124 | // 处理生成海报 | 124 | // 处理生成海报 |
| 125 | const handleGeneratePoster = (item) => { | 125 | const handleGeneratePoster = (item) => { |
| 126 | - router.push({ path: '/recall/poster', query: { id: item.id, stu_uid: item.stu_uid, campaign_id: item.campaign_id } }) | 126 | + router.push({ path: '/recall/poster', query: { title: item.title, stu_uid: item.stu_uid, campaign_id: item.campaign_id } }) |
| 127 | - // showToast('生成海报: ' + item.title) | ||
| 128 | } | 127 | } |
| 129 | 128 | ||
| 130 | const handleCollectCoins = async () => { | 129 | const handleCollectCoins = async () => { |
| ... | @@ -160,8 +159,6 @@ const handleSubmitMissing = () => { | ... | @@ -160,8 +159,6 @@ const handleSubmitMissing = () => { |
| 160 | return | 159 | return |
| 161 | } | 160 | } |
| 162 | 161 | ||
| 163 | - // TODO: Submit to API | ||
| 164 | - | ||
| 165 | showToast({ | 162 | showToast({ |
| 166 | message: '感谢您为我们找回偏轨的星球活动', | 163 | message: '感谢您为我们找回偏轨的星球活动', |
| 167 | icon: 'success' | 164 | icon: 'success' |
| ... | @@ -224,7 +221,9 @@ onMounted(async () => { | ... | @@ -224,7 +221,9 @@ onMounted(async () => { |
| 224 | count: item.stu_cnt || 0, | 221 | count: item.stu_cnt || 0, |
| 225 | date: item.create_time?.substring(0, 10) || '', | 222 | date: item.create_time?.substring(0, 10) || '', |
| 226 | total: item.fee_stu * item.stu_cnt || 0 | 223 | total: item.fee_stu * item.stu_cnt || 0 |
| 227 | - })) | 224 | + })); |
| 225 | + const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b)) | ||
| 226 | + recordDate.value = sortedDates[0]?.substring(0, 4) + '-' + sortedDates[sortedDates.length - 1]?.substring(0, 4) || '' | ||
| 228 | } | 227 | } |
| 229 | } | 228 | } |
| 230 | } | 229 | } | ... | ... |
| ... | @@ -88,9 +88,9 @@ useTitle(route.meta.title || '完善信息') | ... | @@ -88,9 +88,9 @@ useTitle(route.meta.title || '完善信息') |
| 88 | 88 | ||
| 89 | // Form Data | 89 | // Form Data |
| 90 | const form = reactive({ | 90 | const form = reactive({ |
| 91 | - name: '张开心', // Mock initial data as per design | 91 | + name: '', |
| 92 | - phone: '15658666022', // Mock initial data as per design | 92 | + phone: '', |
| 93 | - idCard: '44030619900101001X' | 93 | + idCard: '' |
| 94 | }) | 94 | }) |
| 95 | 95 | ||
| 96 | // Actions | 96 | // Actions | ... | ... |
| ... | @@ -115,7 +115,7 @@ useTitle('身份证号查询') | ... | @@ -115,7 +115,7 @@ useTitle('身份证号查询') |
| 115 | 115 | ||
| 116 | const name = ref('') | 116 | const name = ref('') |
| 117 | const phone = ref('') | 117 | const phone = ref('') |
| 118 | -const idCard = ref('44030619900101001X') | 118 | +const idCard = ref('') |
| 119 | 119 | ||
| 120 | // ID Card Validation | 120 | // ID Card Validation |
| 121 | const validateIdCard = (id) => { | 121 | const validateIdCard = (id) => { | ... | ... |
| ... | @@ -143,6 +143,9 @@ const harvestMethods = [ | ... | @@ -143,6 +143,9 @@ const harvestMethods = [ |
| 143 | const handleExplore = () => { | 143 | const handleExplore = () => { |
| 144 | // 路由跳转逻辑 | 144 | // 路由跳转逻辑 |
| 145 | router.push('/') | 145 | router.push('/') |
| 146 | + | ||
| 147 | + // 收集成功后删除缓存 | ||
| 148 | + localStorage.removeItem('cached_user_info') | ||
| 146 | } | 149 | } |
| 147 | 150 | ||
| 148 | const totalPoints = ref(0); | 151 | const totalPoints = ref(0); | ... | ... |
| ... | @@ -56,7 +56,7 @@ const qrCodeUrl = 'https://cdn.ipadbiz.cn/mlaj/recall/poster/%E4%BA%8C%E7%BB%B4% | ... | @@ -56,7 +56,7 @@ const qrCodeUrl = 'https://cdn.ipadbiz.cn/mlaj/recall/poster/%E4%BA%8C%E7%BB%B4% |
| 56 | 56 | ||
| 57 | // State | 57 | // State |
| 58 | const posterBg = ref(defaultBg) | 58 | const posterBg = ref(defaultBg) |
| 59 | -const title = ref('2017.7.6-7.11 【自然的恩典】“爱我中华”优秀传统文化夏令营-天津场开启~') | 59 | +const title = ref('') |
| 60 | 60 | ||
| 61 | /** | 61 | /** |
| 62 | * 获取文件哈希(与七牛云ETag一致) | 62 | * 获取文件哈希(与七牛云ETag一致) | ... | ... |
-
Please register or login to post a comment