feat(recall): 添加活动历史页面及路由配置
- 新增活动历史页面组件 ActivityHistoryPage.vue - 在路由配置中添加活动历史页面路径 - 添加活动历史页面所需的背景图片资源
Showing
3 changed files
with
196 additions
and
2 deletions
src/assets/images/recall/history_bg@2x.png
0 → 100644
142 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 14:27:58 | 4 | + * @LastEditTime: 2025-12-23 15:31:50 |
| 5 | * @FilePath: /mlaj/src/router/routes.js | 5 | * @FilePath: /mlaj/src/router/routes.js |
| 6 | * @Description: 路由地址映射配置 | 6 | * @Description: 路由地址映射配置 |
| 7 | */ | 7 | */ |
| ... | @@ -132,7 +132,12 @@ export const routes = [ | ... | @@ -132,7 +132,12 @@ export const routes = [ |
| 132 | component: () => import('../views/recall/timeline.vue'), | 132 | component: () => import('../views/recall/timeline.vue'), |
| 133 | meta: { title: '时光机旅程' }, | 133 | meta: { title: '时光机旅程' }, |
| 134 | }, | 134 | }, |
| 135 | - | 135 | + { |
| 136 | + path: '/recall/activity-history', | ||
| 137 | + name: 'ActivityHistory', | ||
| 138 | + component: () => import('../views/recall/ActivityHistoryPage.vue'), | ||
| 139 | + meta: { title: '活动历史' }, | ||
| 140 | + }, | ||
| 136 | { | 141 | { |
| 137 | path: '/checkout', | 142 | path: '/checkout', |
| 138 | name: 'CheckoutPage', | 143 | name: 'CheckoutPage', | ... | ... |
src/views/recall/ActivityHistoryPage.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="activity-history-page w-full min-h-screen bg-[#F7F8FA] relative pb-[140px]"> | ||
| 3 | + <!-- Header Banner --> | ||
| 4 | + <div class="w-full relative h-[180px] overflow-hidden"> | ||
| 5 | + <img :src="historyBg" class="w-full h-full object-cover" alt="History Banner" /> | ||
| 6 | + <div class="absolute inset-0 flex flex-col justify-center items-center text-center px-4"> | ||
| 7 | + <h1 class="text-[#FFDD01] text-3xl font-bold mb-2 tracking-wider drop-shadow-md mt-3">2020-2025</h1> | ||
| 8 | + <h2 class="text-white text-2xl font-bold mb-4 tracking-wider drop-shadow-md">您的活动历史</h2> | ||
| 9 | + | ||
| 10 | + <div class="w-full max-w-md rounded-lg px-4 py-2" | ||
| 11 | + style="background: linear-gradient(96deg, rgba(82,88,254,0) 0%, #5258FE 47%, rgba(92,106,241,0) 100%);"> | ||
| 12 | + <p class="text-white text-xs leading-tight opacity-90"> | ||
| 13 | + 查看并确认您参与的星球活动记录,<br> | ||
| 14 | + 如果有缺失,点击没找到我的星球活动,进行补充 | ||
| 15 | + </p> | ||
| 16 | + </div> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + | ||
| 20 | + <!-- Filter Bar --> | ||
| 21 | + <div class="bg-white px-4 py-3 flex justify-between items-center sticky top-0 z-20 shadow-sm"> | ||
| 22 | + <span class="text-[#333] font-medium text-sm">活动记录</span> | ||
| 23 | + <div class="flex items-center text-[#666] text-sm"> | ||
| 24 | + <span>{{ activities.length }}条</span> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 27 | + | ||
| 28 | + <!-- List --> | ||
| 29 | + <div class="px-4 py-4 space-y-4"> | ||
| 30 | + <div v-for="item in activities" :key="item.id" class="bg-white rounded-xl py-4 pr-4 pl-0 shadow-sm relative overflow-hidden flex"> | ||
| 31 | + | ||
| 32 | + <!-- Blue Marker (Absolute or Flex) --> | ||
| 33 | + <!-- Based on image, it is sticking to the left edge but inside the card padding area potentially, or flush left --> | ||
| 34 | + <!-- Looking at image, it is flush left to the card container --> | ||
| 35 | + <div class="w-1 h-4 bg-[#0052D9] rounded-r-sm mt-1 shrink-0 self-start"></div> | ||
| 36 | + | ||
| 37 | + <div class="pl-3 flex-1"> | ||
| 38 | + <h3 class="text-[#333] font-bold text-base leading-snug"> | ||
| 39 | + {{ item.title }} | ||
| 40 | + </h3> | ||
| 41 | + | ||
| 42 | + <div class="border-t border-dashed border-gray-200 my-3"></div> | ||
| 43 | + | ||
| 44 | + <div class="flex justify-between items-center text-xs text-[#666] mb-2"> | ||
| 45 | + <span>单价: ¥{{ item.price.toFixed(2) }}/人</span> | ||
| 46 | + <span>人数: {{ item.count }}</span> | ||
| 47 | + </div> | ||
| 48 | + | ||
| 49 | + <div class="flex justify-between items-center text-xs text-[#666] mb-4"> | ||
| 50 | + <span>下单时间: {{ item.date }}</span> | ||
| 51 | + <span class="text-[#FF3B30] font-bold">实付金额: ¥{{ item.total.toFixed(0) }}</span> | ||
| 52 | + </div> | ||
| 53 | + | ||
| 54 | + <div class="flex justify-end"> | ||
| 55 | + <van-button size="small" plain color="#0052D9" class="!rounded-full !px-4 !h-[28px] !text-xs" | ||
| 56 | + @click="handleGeneratePoster(item)"> | ||
| 57 | + 生成活动海报 | ||
| 58 | + </van-button> | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + | ||
| 64 | + <!-- Fixed Bottom Buttons --> | ||
| 65 | + <div | ||
| 66 | + class="fixed bottom-0 left-0 right-0 bg-white/60 backdrop-blur-md p-4 pb-8 z-30 shadow-[0_-2px_10px_rgba(0,0,0,0.05)]"> | ||
| 67 | + <van-button block color="#0052D9" class="!rounded-lg !mb-3 !h-[44px] !text-base !font-bold" | ||
| 68 | + @click="handleCollectCoins"> | ||
| 69 | + 收集星球币 | ||
| 70 | + </van-button> | ||
| 71 | + | ||
| 72 | + <van-button block plain color="#0052D9" class="!rounded-lg !h-[44px] !text-base !font-medium" | ||
| 73 | + @click="showMissingPopup = true"> | ||
| 74 | + <template #icon> | ||
| 75 | + <van-icon name="question-o" class="mr-1" /> | ||
| 76 | + </template> | ||
| 77 | + 没找到我的星球活动 | ||
| 78 | + </van-button> | ||
| 79 | + </div> | ||
| 80 | + | ||
| 81 | + <!-- Missing Activity Popup --> | ||
| 82 | + <van-popup v-model:show="showMissingPopup" round position="bottom" :style="{ height: '60%' }" class="flex flex-col"> | ||
| 83 | + <div class="p-4 flex-1 flex flex-col"> | ||
| 84 | + <h3 class="text-center font-bold text-lg mb-6 text-[#333]">补充活动信息</h3> | ||
| 85 | + | ||
| 86 | + <div class="flex-1 bg-[#F7F8FA] rounded-lg p-3 mb-6"> | ||
| 87 | + <textarea v-model="missingInfo" | ||
| 88 | + class="w-full h-full bg-transparent border-none outline-none resize-none text-sm text-[#333] placeholder:text-[#999]" | ||
| 89 | + placeholder="请把缺失的星球活动,补充在这里,留下活动的名称、时间、地点、参加人数等信息"></textarea> | ||
| 90 | + </div> | ||
| 91 | + | ||
| 92 | + <van-button block color="#0052D9" class="!rounded-lg !h-[44px] !text-base !font-bold" | ||
| 93 | + @click="handleSubmitMissing"> | ||
| 94 | + 提交 | ||
| 95 | + </van-button> | ||
| 96 | + </div> | ||
| 97 | + </van-popup> | ||
| 98 | + | ||
| 99 | + </div> | ||
| 100 | +</template> | ||
| 101 | + | ||
| 102 | +<script setup> | ||
| 103 | +import { ref } from 'vue' | ||
| 104 | +import { useRouter } from 'vue-router' | ||
| 105 | +import { useTitle } from '@vueuse/core' | ||
| 106 | +import { showToast } from 'vant' | ||
| 107 | + | ||
| 108 | +// Assets | ||
| 109 | +import historyBg from '@/assets/images/recall/history_bg@2x.png' | ||
| 110 | + | ||
| 111 | +const router = useRouter() | ||
| 112 | +useTitle('活动历史') | ||
| 113 | + | ||
| 114 | +// Mock Data | ||
| 115 | +const activities = ref([ | ||
| 116 | + { | ||
| 117 | + id: 1, | ||
| 118 | + title: '2025.11月3日-10日江苏东台养生营,邀您一起进入童话世界!', | ||
| 119 | + price: 3200.00, | ||
| 120 | + count: 2, | ||
| 121 | + date: '2025-11-03', | ||
| 122 | + total: 6400 | ||
| 123 | + }, | ||
| 124 | + { | ||
| 125 | + id: 2, | ||
| 126 | + title: '【自然的恩典】青少年成长营-贵阳百花湖3(小学初中专场)', | ||
| 127 | + price: 3999.00, | ||
| 128 | + count: 2, | ||
| 129 | + date: '2025-10-03', | ||
| 130 | + total: 7998 | ||
| 131 | + }, | ||
| 132 | + { | ||
| 133 | + id: 3, | ||
| 134 | + title: '2024年4月22-25日浙江义乌【中华智慧商业应用论坛】', | ||
| 135 | + price: 3200.00, | ||
| 136 | + count: 1, | ||
| 137 | + date: '2024-04-03', | ||
| 138 | + total: 3200 | ||
| 139 | + }, | ||
| 140 | + { | ||
| 141 | + id: 4, | ||
| 142 | + title: '2023.7.6-7.11【自然的恩典】“爱我中华”优秀传统文化夏令营-天津场', | ||
| 143 | + price: 3990.00, | ||
| 144 | + count: 1, | ||
| 145 | + date: '2023-07-01', | ||
| 146 | + total: 3990 | ||
| 147 | + } | ||
| 148 | +]) | ||
| 149 | + | ||
| 150 | +// State | ||
| 151 | +const showMissingPopup = ref(false) | ||
| 152 | +const missingInfo = ref('') | ||
| 153 | + | ||
| 154 | +// Actions | ||
| 155 | +const handleGeneratePoster = (item) => { | ||
| 156 | + showToast('生成海报: ' + item.title) | ||
| 157 | +} | ||
| 158 | + | ||
| 159 | +const handleCollectCoins = () => { | ||
| 160 | + showToast('收集星球币成功') | ||
| 161 | + // Navigate to coins page or show animation | ||
| 162 | +} | ||
| 163 | + | ||
| 164 | +const handleSubmitMissing = () => { | ||
| 165 | + if (!missingInfo.value.trim()) { | ||
| 166 | + showToast('请输入活动信息') | ||
| 167 | + return | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + // TODO: Submit to API | ||
| 171 | + | ||
| 172 | + showToast({ | ||
| 173 | + message: '感谢您为我们找回偏轨的星球活动', | ||
| 174 | + icon: 'success' | ||
| 175 | + }) | ||
| 176 | + | ||
| 177 | + showMissingPopup.value = false | ||
| 178 | + missingInfo.value = '' | ||
| 179 | +} | ||
| 180 | + | ||
| 181 | +</script> | ||
| 182 | + | ||
| 183 | +<style lang="less" scoped> | ||
| 184 | +// Custom Scrollbar hide for cleaner look if needed | ||
| 185 | +::-webkit-scrollbar { | ||
| 186 | + width: 0px; | ||
| 187 | + background: transparent; | ||
| 188 | +} | ||
| 189 | +</style> |
-
Please register or login to post a comment