diff --git a/docs/superpowers/plans/2026-06-24-homepage-redesign.md b/docs/superpowers/plans/2026-06-24-homepage-redesign.md new file mode 100644 index 0000000..4bc01c2 --- /dev/null +++ b/docs/superpowers/plans/2026-06-24-homepage-redesign.md @@ -0,0 +1,997 @@ +# 爱上萍乡小程序改版 Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Redesign the mini-program from "湖南12301文旅专区" to "爱上萍乡" — a tourism card sales platform with 3-tab navigation, visual-impact homepage, and QR code entry page. + +**Architecture:** The homepage (`pages/index/index.vue`) is a single-file Vue 3 SFC rebuilt with 4 sections: hero header, announcement swiper, card promotions, and scenic spots list. The QR code page (`pages/qrcode/index.vue`) is a new tab-level page with card swiper, expandable info panel, and feature buttons. Static scenic spot data lives in `src/data/scenic-spots.ts`. All existing API types, request utilities, and store patterns remain unchanged. + +**Tech Stack:** Vue 3 + TypeScript + uni-app (WeChat mini-program) + Pinia + SCSS + +## Global Constraints + +- App name in all navigation bars: "爱上萍乡" +- TabBar: exactly 3 items (首页, 入园码, 我的) +- Homepage card prices: 赣湘全域旅游年卡 ¥300, 超级玩家卡 ¥198 +- ~48 scenic spots (merged deduplicated from both cards), hardcoded in Phase 1 +- QR code page: framework/placeholder only, no real QR generation logic +- All images use gradient/placeholder until real assets are available +- Announcements use mock data with API interface reserved +- uni-app ` + + +``` + +- [ ] **Step 4: Update profile page text** + +In `src/pages/profile/index.vue`, change line 9 from: + +```html +欢迎使用湖南12301文旅专区 +``` + +to: + +```html +欢迎使用爱上萍乡 +``` + +- [ ] **Step 5: Verify build succeeds** + +Run: `cd /Users/jacobxu/Documents/Project/12301-dscp/zhy-mp-test && pnpm run build:mp-weixin` +Expected: BUILD SUCCESS with no errors. Verify `dist/build/mp-weixin/pages/qrcode/index` exists in output. + +- [ ] **Step 6: Commit** + +```bash +git add -A +git commit -m "feat: update tabBar to 3 items, add qrcode page skeleton, rename app" +``` + +--- + +### Task 2: Scenic Spots Data Module + +**Files:** +- Create: `src/data/scenic-spots.ts` + +**Interfaces:** +- Consumes: nothing +- Produces: `ScenicSpotItem` interface and `scenicSpots` array (48 items), imported by homepage as `import { scenicSpots } from '../../data/scenic-spots'` + +- [ ] **Step 1: Create scenic spots data file** + +Create `src/data/scenic-spots.ts`: + +```typescript +/** 景点数据类型 */ +export interface ScenicSpotItem { + id: number + name: string + region: '萍乡' | '长沙' | '株洲' | '湘潭' + price: number + image: string +} + +/** + * 合并去重后的景点列表(48个) + * 来源:赣湘全域旅游年卡(22家) + 超级玩家卡(40家),去重后 + * TODO: Phase 2 改为后端 API 获取 + */ +export const scenicSpots: ScenicSpotItem[] = [ + // === 萍乡 (21家) === + { id: 1, name: '武功山金顶景区', region: '萍乡', price: 70, image: '' }, + { id: 2, name: '杨岐山孽龙洞景区', region: '萍乡', price: 68, image: '' }, + { id: 3, name: '仙凤三宝景区', region: '萍乡', price: 50, image: '' }, + { id: 4, name: '武功山君澜温泉', region: '萍乡', price: 228, image: '' }, + { id: 5, name: '凯光新天地生态旅游区', region: '萍乡', price: 90, image: '' }, + { id: 6, name: '山猫王国', region: '萍乡', price: 68, image: '' }, + { id: 7, name: '和平农场·哎马乐园', region: '萍乡', price: 79, image: '' }, + { id: 8, name: '花涧里景区', region: '萍乡', price: 80, image: '' }, + { id: 9, name: '玉皇谷景区', region: '萍乡', price: 50, image: '' }, + { id: 10, name: '龙溪秘境', region: '萍乡', price: 30, image: '' }, + { id: 11, name: '南正街唐朝诡事录', region: '萍乡', price: 158, image: '' }, + { id: 12, name: '孽龙洞水上乐园', region: '萍乡', price: 180, image: '' }, + { id: 13, name: '桐花谷', region: '萍乡', price: 50, image: '' }, + { id: 14, name: '赣西野生动物王国', region: '萍乡', price: 160, image: '' }, + { id: 15, name: '武功山外骨骼登山', region: '萍乡', price: 200, image: '' }, + { id: 16, name: '发光登山杖', region: '萍乡', price: 88, image: '' }, + { id: 17, name: '三只猫青年旅社', region: '萍乡', price: 60, image: '' }, + { id: 18, name: '武功山奖牌', region: '萍乡', price: 19.9, image: '' }, + { id: 19, name: 'AI中医', region: '萍乡', price: 125, image: '' }, + // === 长沙 (16家) === + { id: 20, name: '长沙方特东方神画', region: '长沙', price: 280, image: '' }, + { id: 21, name: '麦咭乐园红星运动空间站', region: '长沙', price: 278, image: '' }, + { id: 22, name: '宁乡野趣亲子乐园', region: '长沙', price: 88, image: '' }, + { id: 23, name: '长沙乐田派绣乡亲子乐园', region: '长沙', price: 68, image: '' }, + { id: 24, name: '湘东漂流', region: '长沙', price: 168, image: '' }, + { id: 25, name: '长沙黑麋峰森林公园', region: '长沙', price: 27, image: '' }, + { id: 26, name: '湘江游轮', region: '长沙', price: 120, image: '' }, + { id: 27, name: '天心阁', region: '长沙', price: 58, image: '' }, + { id: 28, name: '皇龙峡生态旅游区', region: '长沙', price: 138, image: '' }, + { id: 29, name: '靖港古镇', region: '长沙', price: 80, image: '' }, + { id: 30, name: '西溪磐石大峡谷', region: '长沙', price: 48, image: '' }, + { id: 31, name: '湖南省木偶皮影剧场', region: '长沙', price: 68, image: '' }, + { id: 32, name: '金坑溯溪', region: '长沙', price: 99, image: '' }, + { id: 33, name: '关山古镇', region: '长沙', price: 50, image: '' }, + { id: 34, name: '浏河第一湾', region: '长沙', price: 88, image: '' }, + // === 株洲 (6家) === + { id: 35, name: '炎帝陵', region: '株洲', price: 62, image: '' }, + { id: 36, name: '酷洛潮漫(株洲馆)', region: '株洲', price: 118, image: '' }, + { id: 37, name: '神农谷风景旅游区', region: '株洲', price: 62, image: '' }, + { id: 38, name: '云上大院', region: '株洲', price: 50, image: '' }, + { id: 39, name: '云阳山', region: '株洲', price: 45, image: '' }, + { id: 40, name: '酒仙湖', region: '株洲', price: 65, image: '' }, + // === 湘潭 (7家) === + { id: 41, name: '盘龙大观园', region: '湘潭', price: 128, image: '' }, + { id: 42, name: '米莱知识宇宙(湘潭万达馆)', region: '湘潭', price: 326, image: '' }, + { id: 43, name: '滴水洞', region: '湘潭', price: 40, image: '' }, + { id: 44, name: '毛泽东纪念园', region: '湘潭', price: 60, image: '' }, + { id: 45, name: '韶峰景区(含缆车)', region: '湘潭', price: 60, image: '' }, + { id: 46, name: '彭德怀纪念馆', region: '湘潭', price: 98, image: '' }, + { id: 47, name: '《最忆韶山冲》演出', region: '湘潭', price: 298, image: '' }, +] +``` + +- [ ] **Step 2: Verify build succeeds** + +Run: `pnpm run build:mp-weixin` +Expected: BUILD SUCCESS (data file has no side effects, just confirms it compiles). + +- [ ] **Step 3: Commit** + +```bash +git add src/data/scenic-spots.ts +git commit -m "feat: add scenic spots data module (48 spots, hardcoded)" +``` + +--- + +### Task 3: Homepage Redesign + +**Files:** +- Modify: `src/pages/index/index.vue` (complete rewrite) + +**Interfaces:** +- Consumes: `ScenicSpotItem` and `scenicSpots` from `../../data/scenic-spots` +- Produces: nothing (page component, no exports) + +- [ ] **Step 1: Write the complete homepage** + +Replace the entire contents of `src/pages/index/index.vue` with: + +```vue + + + + + +``` + +- [ ] **Step 2: Verify build succeeds** + +Run: `pnpm run build:mp-weixin` +Expected: BUILD SUCCESS. + +- [ ] **Step 3: Run type check** + +Run: `pnpm run type-check` +Expected: No type errors. + +- [ ] **Step 4: Visual verification (WeChat devtools)** + +Run: `pnpm run dev:mp-weixin` + +Open WeChat developer tools and import `dist/dev/mp-weixin`. Verify: +1. Hero header shows gradient background, "爱上萍乡" title, subtitle, search bar +2. Announcement bar scrolls vertically through 3 mock items +3. Two promo cards display with correct gradients, prices (¥300, ¥198), and feature text +4. Scenic spots list shows all 48 spots with gradient images, region tags, prices, and "持卡免门票" tags +5. TabBar shows 3 items: 首页, 入园码, 我的 + +- [ ] **Step 5: Commit** + +```bash +git add src/pages/index/index.vue +git commit -m "feat: redesign homepage with hero, announcements, card promos, scenic spots" +``` + +--- + +### Task 4: QR Code Entry Page + +**Files:** +- Modify: `src/pages/qrcode/index.vue` (replace skeleton with full implementation) + +**Interfaces:** +- Consumes: `useUserStore` from `../../store/user` +- Produces: nothing (page component, no exports) + +- [ ] **Step 1: Write the complete QR code page** + +Replace the entire contents of `src/pages/qrcode/index.vue` with: + +```vue + + + + + +``` + +- [ ] **Step 2: Verify build succeeds** + +Run: `pnpm run build:mp-weixin` +Expected: BUILD SUCCESS. + +- [ ] **Step 3: Run type check** + +Run: `pnpm run type-check` +Expected: No type errors. + +- [ ] **Step 4: Visual verification (WeChat devtools)** + +Open WeChat developer tools, navigate to the "入园码" tab. Verify: +1. Card swiper shows 2 cards with correct gradients, names, user info +2. Left/right swipe switches between cards with dot indicator updating +3. "持卡信息" panel toggles expand/collapse on tap +4. Expanded panel shows: 身份证, 360\*\*\*1234, 138\*\*\*\*5678 +5. QR code placeholder area is centered with countdown text +6. Countdown decrements from 60 to 0, then resets +7. 3 feature buttons show with colored circle icons and labels +8. Tapping any feature button shows "功能开发中" toast + +- [ ] **Step 5: Commit** + +```bash +git add src/pages/qrcode/index.vue +git commit -m "feat: implement QR code entry page with card swiper, info panel, features" +``` + +--- + +### Task 5: Final Verification & Polish + +**Files:** +- No new files. Verify all modified files. + +- [ ] **Step 1: Full build** + +Run: `pnpm run build:mp-weixin` +Expected: BUILD SUCCESS with zero errors. + +- [ ] **Step 2: Type check** + +Run: `pnpm run type-check` +Expected: No type errors. + +- [ ] **Step 3: End-to-end visual verification** + +Open WeChat developer tools, import `dist/dev/mp-weixin`. Go through this checklist: + +1. **TabBar**: 3 tabs visible (首页, 入园码, 我的), all switchable +2. **首页**: + - Hero: gradient background, "爱上萍乡" title, "赣湘之间 · 发现旅途美好" subtitle, search bar + - Announcement: vertical scrolling, 3 items cycling + - Card 1 (赣湘年卡): blue-gold gradient, ¥300, 3 features, "立即抢购" button + - Card 2 (超级玩家卡): orange-purple gradient, ¥198, 3 features, "立即抢购" button + - Scenic spots: 48 spots listed vertically, each with gradient image, region tag, name, price, "持卡免门票" tag + - Scrolling through all spots is smooth +3. **入园码**: + - 2 cards in swiper, switchable + - Expandable info panel works + - QR placeholder with countdown timer + - 3 feature buttons display and show toast on tap +4. **我的**: + - "欢迎使用爱上萍乡" text displayed (not "湖南12301") + - All menu items still functional +5. **Login**: still accessible and functional + +- [ ] **Step 4: Final commit** + +```bash +git add -A +git commit -m "chore: final verification pass for homepage redesign" +```