# 登录前浏览体验 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:** 未登录用户打开小程序即可浏览发现页(五行沙盘+活动+商品)和商城,无需看到登录页
**Architecture:** 未登录时隐藏原生 TabBar,使用自定义底部导航(发现/商城);发现页为静态 HTML 内容(零后端依赖)。登录后恢复原生 4Tab。
**Tech Stack:** uni-app Vue 2 (微信小程序)
---
### Task 1: 品牌更名 溪艾福→浠艾福
**Files:**
- Modify: `cfc-frontend/pages/index/parent-index.vue` (4处)
- Modify: `cfc-frontend/pages/index/child-index.vue` (2处)
- Modify: `cfc-frontend/pages.json` (1处)
- Modify: `cfc-frontend/pages/profile/profile.vue` (1处)
- Modify: `cfc-frontend/utils/api.js` (1处)
- Modify: `cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java` (4处)
- [ ] **Step 1: 替换所有前端「溪艾福」→「浠艾福」**
Replace in parent-index.vue:
- Line 68: 五行能量沙盘(溪艾福)→ 五行能量沙盘(浠艾福)
- Line 125: 会员Banner(溪福俱乐部)→ 会员Banner(浠艾福俱乐部)
- Line 1213: 溪福俱乐部 → 浠艾福俱乐部
- Line 1249: 五行能量沙盘(溪艾福)→ 五行能量沙盘(浠艾福)
Replace in child-index.vue:
- Line 54: 五行能量沙盘(溪艾福)→ 五行能量沙盘(浠艾福)
- Line 881: 五行能量沙盘(溪艾福)→ 五行能量沙盘(浠艾福)
Replace in pages.json:
- Line 329: 溪福俱乐部 → 浠艾福俱乐部
Replace in profile.vue:
- Line 52: 溪福俱乐部 → 浠艾福俱乐部
Replace in api.js:
- Line 722: 溪福俱乐部 → 浠艾福俱乐部
Replace in DatabaseInitializer.java (comments only):
- "溪福俱乐部" → "浠艾福俱乐部" (4 occurrences)
- [ ] **Step 2: Commit**
```bash
git add $(rtk list -u --modified -- cfc-frontend/ cfc-backend/)
git commit -m "chore: 品牌名溪艾福/溪福俱乐部统一改为浠艾福/浠艾福俱乐部"
```
---
### Task 2: 提取五行沙盘为独立组件
**Files:**
- Create: `cfc-frontend/components/wuxing-sandbox.vue`
- Modify: `cfc-frontend/pages/index/parent-index.vue`
- Modify: `cfc-frontend/pages/index/child-index.vue`
- [ ] **Step 1: 创建 wuxing-sandbox.vue 组件**
```vue
五行能量沙盘
{{ badgeText }}
🔥
心·火
点此登录
🌿
行·木
点此登录
💧
富·水
点此登录
⚔️
智·金
点此登录
🌏
身·土
点此登录
五行平衡
共同成长
🌱 完成测评,点亮「身·土」
🌿行
→
🔥心
→
🌏身
→
⚔️智
→
💧富
```
- [ ] **Step 2: 替换 parent-index.vue 内联沙盘为组件**
Remove the inline wuxing-sandbox HTML+CSS block from parent-index.vue (the entire block from `` to its closing ``), replace with:
```vue
```
Add import:
```javascript
import WuxingSandbox from '../../components/wuxing-sandbox.vue'
```
Add to components:
```javascript
components: { WuxingSandbox }
```
- [ ] **Step 3: 替换 child-index.vue 内联沙盘为组件**
Same pattern as Step 2 — replace inline sandbox with ``
Add import + components registration.
Remove the entire inline `
```
- [ ] **Step 2: Commit**
```bash
git add cfc-frontend/components/bottom-nav.vue
git commit -m "feat: 创建自定义底部导航组件(bottom-nav)用于未登录态2Tab展示"
```
---
### Task 4: 重构 App.vue 登录态 + TabBar 切换逻辑
**Files:**
- Modify: `cfc-frontend/App.vue`
- [ ] **Step 1: 修改 App.vue onLaunch**
Add login state check: if no token → hide native TabBar, redirect to discover. If has token → show native TabBar, proceed normally.
```vue
```
- [ ] **Step 2: 确保 login.vue 登录成功后隐藏原生 TabBar + 跳转发现页**
The existing login success handler does `uni.reLaunch({ url: '/pages/index/index' })`. This should be changed to NOT re-show the native TabBar for unauthenticated users — but since login succeeded, they ARE authenticated, so showing the TabBar is correct.
Actually, the flow should be:
1. User logs in successfully
2. `uni.showTabBar()` → restore native TabBar
3. `uni.reLaunch({ url: '/pages/index/index' })` → go to home page (which now has TabBar)
This should already work with the App.vue changes. No need to modify login.vue TabBar logic — just ensure the navigateToHome function works.
- [ ] **Step 3: Commit**
```bash
git add cfc-frontend/App.vue
git commit -m "feat: App.vue 添加登录态TabBar切换逻辑(未登录隐藏原生TabBar)"
```
---
### Task 5: 重构发现页(核心页面)
**Files:**
- Modify: `cfc-frontend/pages/discover/index.vue`
- [ ] **Step 1: 完整重写 discover/index.vue**
```vue
🌟 浠艾福
Care Family Club
以五行五维为内核的家庭主动健康管理平台
🏆 任务积分
⭐ 五行沙盘
👨👩👧 家庭共育
{{ item.icon }}
{{ item.name }}
{{ item.desc }}
{{ item.price }}
查看详情 →
{{ item.icon }}
{{ item.name }}
{{ item.rating }}
{{ item.sold }}
{{ item.desc }}
{{ item.price }}
🔒 登录解锁完整功能
创建家庭 · 管理任务 · 查看五行能量沙盘
立即登录 →
```
- [ ] **Step 2: Commit**
```bash
git add cfc-frontend/pages/discover/index.vue
git commit -m "feat: 重构发现页为预登录首页(沙盘+活动+商品+登录引导)"
```
---
### Task 6: 商城页添加未登录态预览
**Files:**
- Modify: `cfc-frontend/pages/shop/index.vue`
- [ ] **Step 1: 重写 shop/index.vue**
Replace placeholder with a preview layout showing product categories + product cards, plus bottom nav and login gate.
```vue
全部
课程
活动
商品
{{ item.icon }}
{{ item.name }}
{{ item.price }}
🔒 登录查看全部商品和服务
```
- [ ] **Step 2: Commit**
```bash
git add cfc-frontend/pages/shop/index.vue
git commit -m "feat: 商城页添加未登录预览态(静态商品展示+登录引导)"
```
---
### Task 7: Login 页添加 redirect 参数支持
**Files:**
- Modify: `cfc-frontend/pages/login/login.vue`
- [ ] **Step 1: 修改 login.vue onLoad 接受 redirect 参数**
```vue
onLoad(options) {
// 处理邀请码
if (options.inviteCode) {
uni.setStorageSync('inviteCode', options.inviteCode)
uni.setStorageSync('inviteType', options.inviteType || 'family')
}
// 存储登录后跳转地址
if (options.redirect) {
this.redirectUrl = decodeURIComponent(options.redirect)
}
},
```
Add to data:
```javascript
data() {
return {
// ... existing data
redirectUrl: ''
}
},
```
- [ ] **Step 2: 修改 navigateToHome 使用 redirect 参数**
Replace the existing navigateToHome method:
```javascript
navigateToHome(role) {
if (this.redirectUrl) {
// 有 redirect 则跳回来源页
const redirect = this.redirectUrl
this.redirectUrl = ''
uni.reLaunch({ url: redirect })
} else {
// 默认通过 TabBar 首页跳转
uni.reLaunch({ url: '/pages/index/index' })
}
}
```
- [ ] **Step 3: Commit**
```bash
git add cfc-frontend/pages/login/login.vue
git commit -m "feat: 登录页支持redirect参数(登录后返回来源页)"
```
---
### Self-Review
**1. Spec coverage:**
- 品牌更名: ✅ Task 1 覆盖所有 9 处前端 + 4 处后端注释
- 发现页重构 (沙盘+活动+商品): ✅ Task 5
- 五行沙盘交互点(五角→登录): ✅ Task 2 (emits point-click), Task 5 (requireLogin handler)
- 活动区: ✅ Task 5 (3张活动卡片,点击→requireLogin)
- 商品区: ✅ Task 5 (2张商品卡片,点击→requireLogin)
- 商城页未登录预览: ✅ Task 6
- 预登录 TabBar 仅显示发现+商城: ✅ Task 3 (bottom-nav) + Task 4 (App.vue hideTabBar)
- 登录页不改造: ✅ Task 7 只加 redirect 参数,不改造 UI
- 登录后恢复原生 TabBar: ✅ Task 4
- 退出登录回到未登录态: ✅ implicit via App.vue onShow check
- 沙盘组件复用: ✅ Task 2 (preview/parent/child 三模式)
**2. Placeholder scan:** No TBD, TODO, or empty sections.
**3. Type consistency:**
- `@point-click` used in component emit and parent handler ✅
- `requireLogin()` used consistently across discover and shop pages ✅
- `redirect` parameter format consistent ✅