|
|
@@ -0,0 +1,978 @@
|
|
|
+# 小程序大页面组件抽取方案(U8 前置)
|
|
|
+
|
|
|
+> 版本:v1 | 日期:2026-10-27 | 性质:架构方案,经裁决后派发实施
|
|
|
+> 约束:本轮只出方案文档,不改业务代码;所有建议不改变现有视觉与交互行为。
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 0. 现状实证(已核,勿重复调研)
|
|
|
+
|
|
|
+### 0.1 实际规模:43 个 >800 行页面(非 16)
|
|
|
+
|
|
|
+原始任务描述中"16 个"不准确。经 `pages.json` 注册页列表 + `wc -l` 实测,实际为 **43 个已注册页面**超过 800 行。另有若干 `*.vue` 文件(组件、混合文件)未计入此清单。
|
|
|
+
|
|
|
+| 序号 | 路径 | 总行数 | 模板行 | 脚本行 | 样式行 | 风险标记 |
|
|
|
+|------|------|--------|--------|--------|--------|----------|
|
|
|
+| 1 | `pages/index-home/index` | 3063 | 423 | 1675 | 962 | `newDate` |
|
|
|
+| 2 | `pages/health/report-detail` | 2654 | 455 | 1135 | 1061 | `scroll-view` |
|
|
|
+| 3 | `pages/mind-detail/index` | 2601 | 258 | 1038 | 1303 | `newDate` |
|
|
|
+| 4 | `pages/home-pages/parent-index` | 2294 | 494 | 838 | 960 | `scroll-view`, `newDate` |
|
|
|
+| 5 | `pages/shop/checkout/checkout` | 2021 | 482 | 778 | 759 | `scroll-view` |
|
|
|
+| 6 | `pages/health/health-plan-summary` | 1913 | 229 | 1039 | 643 | `newDate` |
|
|
|
+| 7 | `pages/health/report-confirm` | 1841 | 356 | 598 | 884 | — |
|
|
|
+| 8 | `pages/activity/activity-detail/activity-detail` | 1768 | 333 | 732 | 700 | `scroll-view` |
|
|
|
+| 9 | `pages/health/gut-flora-detail` | 1586 | 371 | 764 | 448 | `scroll-view` |
|
|
|
+| 10 | `pages/home-pages/child-index` | 1486 | 316 | 605 | 563 | `scroll-view`, `newDate` |
|
|
|
+| 11 | `pages/profile-main/profile` | 1427 | 301 | 533 | 591 | — |
|
|
|
+| 12 | `pages/wealth/index` | 1425 | 267 | 568 | 532 | `scroll-view`, `newDate` |
|
|
|
+| 13 | `pages/tasks/tasks` | 1408 | 250 | 528 | 628 | — |
|
|
|
+| 14 | `pages/mind-detail/emotion-checkin` | 1390 | 200 | 612 | 577 | `newDate` |
|
|
|
+| 15 | `pages/activity/index` | 1386 | 315 | 641 | 428 | `scroll-view`, `newDate` |
|
|
|
+| 16 | `pages/discover-detail/product-detail/product-detail` | 1371 | 175 | 647 | 547 | `scroll-view` |
|
|
|
+| 17 | `pages/body-detail/index` | 1365 | 243 | 542 | 578 | `newDate` |
|
|
|
+| 18 | `pages/wisdom-detail/index` | 1354 | 240 | 591 | 521 | `newDate` |
|
|
|
+| 19 | `pages/action-detail/index` | 1343 | 257 | 606 | 478 | `newDate` |
|
|
|
+| 20 | `pages/profile-extra/family-members` | 1342 | 167 | 615 | 558 | — |
|
|
|
+| 21 | `pages/health/challenge-manage` | 1323 | 329 | 386 | 606 | `scroll-view`, `newDate` |
|
|
|
+| 22 | `pages/promotion/team` | 1183 | 212 | 496 | 473 | — |
|
|
|
+| 23 | `pages/activity/create` | 1100 | 208 | 546 | 344 | — |
|
|
|
+| 24 | `pages/growth-main/index` | 1089 | 283 | 263 | 542 | `newDate` |
|
|
|
+| 25 | `pages/wishes/index` | 1087 | 236 | 349 | 500 | `scroll-view` |
|
|
|
+| 26 | `pages/user-edit/user-edit` | 1080 | 262 | 479 | 337 | — |
|
|
|
+| 27 | `pages/mind-detail/family-dashboard` | 1060 | 161 | 511 | 386 | `scroll-view`, `newDate` |
|
|
|
+| 28 | `pages/tianpan/index` | 1060 | 162 | 535 | 362 | `newDate` |
|
|
|
+| 29 | `pages/wisdom-detail/cognitive-report` | 1026 | 170 | 178 | 675 | — |
|
|
|
+| 30 | `pages/health/report-list` | 995 | 151 | 410 | 432 | `scroll-view` |
|
|
|
+| 31 | `pages/promotion/index` | 991 | 187 | 292 | 510 | `scroll-view` |
|
|
|
+| 32 | `pages/body-detail/health-report` | 989 | 181 | 341 | 465 | — |
|
|
|
+| 33 | `pages/ai/chat` | 984 | 161 | 349 | 472 | `scroll-view`, `newDate` |
|
|
|
+| 34 | `pages/health/report-survey` | 930 | 462 | 302 | 164 | — |
|
|
|
+| 35 | `pages/wisdom-detail/self-quiz` | 923 | 134 | 331 | 456 | — |
|
|
|
+| 36 | `pages/mind-detail/emotion-trend` | 874 | 123 | 431 | 318 | `newDate` |
|
|
|
+| 37 | `pages/health/report-upload` | 867 | 137 | 339 | 389 | — |
|
|
|
+| 38 | `pages/dan-assessment/report-result` | 860 | 235 | 403 | 220 | — |
|
|
|
+| 39 | `pages/growth/sleep-checkin` | 856 | 157 | 306 | 391 | `scroll-view`, `newDate` |
|
|
|
+| 40 | `pages/profile/service-role-apply` | 848 | 129 | 313 | 404 | — |
|
|
|
+| 41 | `pages/membership/upgrade` | 844 | 101 | 220 | 521 | `scroll-view` |
|
|
|
+| 42 | `pages/family/self-check-result` | 831 | 151 | 174 | 504 | — |
|
|
|
+| 43 | `pages/shop/cart/cart` | 828 | 140 | 304 | 382 | `scroll-view` |
|
|
|
+
|
|
|
+> **风险标记说明**:`scroll-view` = 含滚动联动或 `position:fixed` 需平级放置;`newDate` = 使用 `new Date(string)` 可能触 iOS 兼容问题;`optionalChain` / `keyExpr` = 无(全部合规)。
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 1. 抽取原则与硬约束
|
|
|
+
|
|
|
+### 1.1 不动行为的铁律
|
|
|
+
|
|
|
+- **视觉等价**:拆分后 DOM 结构变化不得导致像素差异(flex 方向、gap 值、padding 保持一致)
|
|
|
+- **交互等价**:所有 `@click`、`@change`、生命周期回调必须原样转发
|
|
|
+- **数据等价**:子组件不重复请求已加载数据;父页面通过 props 透传
|
|
|
+
|
|
|
+### 1.2 命名与落位约定
|
|
|
+
|
|
|
+| 场景 | 落位目录 | 命名规则 | 示例 |
|
|
|
+|------|----------|----------|------|
|
|
|
+| 跨页面复用 | `components/` | kebab-case 文件名,PascalCase import | `family-feed.vue` → `import FamilyFeed from '@/components/FamilyFeed.vue'` |
|
|
|
+| 模块内专属 | `pages/<module>/components/` | 同左 | `pages/mind-detail/components/EmotionGrid.vue` |
|
|
|
+| 页面级临时 | `pages/<path>/components/` | 同左 | `pages/index-home/components/SelfTestCard.vue` |
|
|
|
+
|
|
|
+### 1.3 令牌纪律
|
|
|
+
|
|
|
+- 圆角:仅使用 `8rpx` / `16rpx` / `24rpx` / `999rpx` 四档
|
|
|
+- 字号:统一 `calc(Nrpx * var(--font-scale, 1))`
|
|
|
+- 颜色:优先引用 `uni.scss` 全局令牌;页面专有色阶仅在值不同时局部定义并注释来源
|
|
|
+
|
|
|
+### 1.4 禁止项(延续项目规范)
|
|
|
+
|
|
|
+- ❌ 可选链 `?.`
|
|
|
+- ❌ CSS Grid
|
|
|
+- ❌ `:key` 表达式(如 `:key="item.id \|\| item.key"`)→ 改用 `getItemKey()` 方法
|
|
|
+- ❌ `new Date(string)` 解析 → 改用 `parseDate()` from `utils/format.js`
|
|
|
+- ❌ `uni.getSystemInfoSync()` → 改用 `uni.getWindowInfo()` / `uni.getDeviceInfo()`
|
|
|
+- ❌ emoji 作功能图标 → 沿用项目已有图标方案
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 2. 逐页拆分建议(43 页清单)
|
|
|
+
|
|
|
+> 说明:每页给出「可抽取区块」+「组件名/落位」+「props/events 契约」+「预估行数变化」+「风险等级」。
|
|
|
+> 区块按模板注释分段提取,顺序从上到下。
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P0】核心首页集群(登录态总览)
|
|
|
+
|
|
|
+#### 2.1 `pages/index-home/index`(3063 行)
|
|
|
+
|
|
|
+> 详见 §4 单独章节。
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.2 `pages/home-pages/parent-index`(2294 行)|家庭首页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 顶部 Banner + 新手任务进度条 | `FamilyHeaderBanner` | `components/` | `memberCount`, `onboardingPercent`, `bannerContent` | `onProgressTap` | -180 | 低 |
|
|
|
+| B | 家庭成员选择条 | `DimensionMemberTabs` | `components/`(已有) | `members`, `selectedMemberId`, `memberTypeFilter` | `@select` | -120 | 低(已有) |
|
|
|
+| C | 微行动卡片(P0 启动) | `MicroActionCard` | `components/` | `actionData`, `status` | `@tap`, `@complete` | -150 | 中(依赖当前选中成员 state) |
|
|
|
+| D | 健康预警横幅 | `HealthAlertBanner` | `components/` | `alerts[]`, `dismissable` | `@dismiss` | -100 | 低 |
|
|
|
+| E | 家庭挑战区域 | `FamilyChallengeCard`(已有) | — | — | — | 复用 | 低 |
|
|
|
+| F | 健康圈入口 | `HealthCircleEntry` | `components/` | `hasCircle`, `leaderName`, `rankPreview` | `@tap` | -80 | 中(条件渲染逻辑) |
|
|
|
+| G | 五维家庭自检入口 | `FiveDimSelfCheckEntry` | `components/` | `scores`, `locked` | `@tap` | -70 | 低 |
|
|
|
+| H | 关系图谱 | `FamilyRelationGraph`(已有) | — | — | — | 复用 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -700 行 → 目标 <1600 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.3 `pages/home-pages/child-index`(1486 行)|孩子首页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 顶部 Banner + 通关引导进度条 | `ChildHeaderBanner` | `components/` | `childName`, `progress`, `badgeCount` | `@tap` | -140 | 低 |
|
|
|
+| B | 五维能量沙盘 | `WuxingSandbox`(已有) | — | — | — | 复用 | 低 |
|
|
|
+| C | 家庭能量横条 | `FamilyEnergyBar`(已有) | — | — | — | 复用 | 低 |
|
|
|
+| D | 推荐商品 + 活动混合流 | `MixedFeedList` | `components/` | `items[]`, `typeFilter` | `@itemTap` | -200 | 中(item 类型判断逻辑) |
|
|
|
+
|
|
|
+**总计可抽**:约 -340 行 → 目标 ~1146 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P1】健康报告集群(深度阅读)
|
|
|
+
|
|
|
+#### 2.4 `pages/health/report-detail`(2654 行)|报告详情页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 报告头部(标题/来源/时间) | `ReportHeader` | `pages/health/components/` | `reportType`, `memberName`, `date`, `status` | — | -120 | 低 |
|
|
|
+| B | 指标帮助弹窗 | `IndicatorHelpModal` | `components/` | `indicatorName`, `normalRange`, `description` | `@close` | -100 | 低 |
|
|
|
+| C | 报告反馈入口 | `ReportFeedbackBtn` | `pages/health/components/` | `reportId`, `mode` | `@submit` | -80 | 低 |
|
|
|
+| D | 指标明细行(重复模式) | `IndicatorRow` | `pages/health/components/` | `item`, `showUnit`, `highlightAbnormal` | — | -250 | 中(条件渲染复杂) |
|
|
|
+| E | 肠道菌群分组面板 | `FloraGroupPanel` | `pages/health/components/` | `groupData`, `expandAll` | `@toggle` | -180 | 高(scroll-view 联动) |
|
|
|
+
|
|
|
+**总计可抽**:约 -730 行 → 目标 ~1924 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.5 `pages/health/report-confirm`(1841 行)|报告确认页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 解析中状态 | `ParsingStateView` | `pages/health/components/` | `status`, `percent` | — | -80 | 低 |
|
|
|
+| B | 匹配可信度 | `MatchConfidenceBadge` | `pages/health/components/` | `score`, `level` | — | -50 | 低 |
|
|
|
+| C | 舌诊指标展示 | `TongueDiagnosisPanel` | `pages/health/components/` | `indicators[]` | — | -100 | 中 |
|
|
|
+| D | 健康指标(常规) | `HealthIndicatorsPanel` | `pages/health/components/` | `indicators[]`, `mode` | — | -120 | 中 |
|
|
|
+| E | 肠道菌群 / 疾病风险 / 饮食推荐 区块 | `ReportSectionBlock` | `pages/health/components/` | `sectionKey`, `data` | — | -200 | 高(条件互斥逻辑) |
|
|
|
+| F | 操作按钮区 | `ReportActionButtons` | `pages/health/components/` | `canEdit`, `canConfirm`, `canFeedback` | `@edit`, `@confirm`, `@feedback` | -90 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -640 行 → 目标 ~1201 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.6 `pages/health/health-plan-summary`(1913 行)|健康方案摘要
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 步骤指示器 | `PlanStepIndicator` | `pages/health/components/` | `currentStep`, `totalSteps` | — | -80 | 低 |
|
|
|
+| B | Step 1 选人 + 目标 | `PlanMemberSelector` | `pages/health/components/` | `members[]`, `selectedId` | `@select` | -100 | 中 |
|
|
|
+| C | Step 2 健康问卷(内嵌) | `HealthQuestionnaireInline` | `pages/health/components/` | `questions[]`, `answers` | `@change` | -250 | 高(状态管理复杂) |
|
|
|
+| D | 手写签名区 | `HandSignaturePad` | `components/` | `signed`, `memberName` | `@sign`, `@clear` | -120 | 中 |
|
|
|
+| E | Step 3/4 确认 + 保存 | `PlanConfirmActions` | `pages/health/components/` | `summaryData`, `saving` | `@save`, `@cancel` | -150 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -700 行 → 目标 ~1213 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.7 `pages/health/report-list`(995 行)|报告列表
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 成员过滤 + 跨家庭转移申请 | `ReportListHeader` | `pages/health/components/` | `members[]`, `pendingRequests[]` | `@filter`, `@requestTransfer` | -120 | 中 |
|
|
|
+| B | 采集中草稿卡片 | `DraftReportCard` | `pages/health/components/` | `draft`, `memberName` | `@edit`, `@delete` | -80 | 低 |
|
|
|
+| C | 报告列表项 | `ReportListItem` | `pages/health/components/` | `report`, `showMember` | `@tap` | -150 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -350 行 → 目标 ~645 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.8 `pages/health/report-upload`(867 行)|报告上传
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 说明提示 + 成员归属选择 | `UploadIntentHeader` | `pages/health/components/` | `members[]` | `@selectMember` | -80 | 低 |
|
|
|
+| B | 上传方式选择(拍照/相册/PDF) | `UploadMethodPicker` | `pages/health/components/` | — | `@select` | -100 | 低 |
|
|
|
+| C | 上传中状态 + 责任声明 | `UploadProgressView` | `pages/health/components/` | `progress`, `error` | — | -90 | 中(状态机) |
|
|
|
+
|
|
|
+**总计可抽**:约 -270 行 → 目标 ~597 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.9 `pages/health/gut-flora-detail`(1586 行)|肠道菌群详情
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 报告头部 + AI 解读 | `FloraReportHeader` | `pages/health/components/` | `reportMeta`, `aiSummary` | — | -100 | 低 |
|
|
|
+| B | 评分圆环(折行显示) | `ScoreRingGroup` | `pages/health/components/` | `scores[]` | — | -80 | 中(布局特殊) |
|
|
|
+| C | 快速跳转导航 | `FloraQuickNav` | `pages/health/components/` | `sections[]` | `@jump` | -60 | 低 |
|
|
|
+| D | 指标变化对比(最近两次) | `IndicatorTrendCompare` | `pages/health/components/` | `current`, `previous` | — | -120 | 中 |
|
|
|
+| E | 肠道功能手风琴 | `FloraFunctionAccordion` | `pages/health/components/` | `functions[]` | `@toggle` | -150 | 低 |
|
|
|
+| F | 营养分组手风琴 | `NutritionGroupAccordion` | `pages/health/components/` | `groups[]` | `@toggle` | -180 | 低 |
|
|
|
+| G | draft 模式成员选择 | `FloraMemberSelector` | `pages/health/components/` | `members[]` | `@select` | -70 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -760 行 → 目标 ~826 行(接近 800 阈值)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.10 `pages/health/challenge-manage`(1323 行)|挑战管理
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 双 Tab 切换(共同/个人) | `ChallengeTabBar` | `pages/health/components/` | `activeTab` | `@change` | -80 | 低 |
|
|
|
+| B | 挑战分类列表 | `ChallengeCategoryList` | `pages/health/components/` | `categories[]`, `selectedId` | `@select` | -150 | 中 |
|
|
|
+| C | 创建/编辑弹窗 | `ChallengeFormModal` | `pages/health/components/` | `challenge`, `mode` | `@save`, `@cancel` | -200 | 高(表单验证复杂) |
|
|
|
+| D | 家庭成员不足提示 | `MemberInsufficientAlert` | `pages/health/components/` | `currentCount`, `requiredCount` | `@addMember` | -80 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -510 行 → 目标 ~813 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P2】维度详情集群(身/心/智/行/富)
|
|
|
+
|
|
|
+#### 2.11 `pages/mind-detail/index`(2601 行)|心智首页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 品牌头部 + 定位语 | `DimensionBrandHeader` | `components/` | `dimension`, `isLoggedIn` | — | -140 | 低 |
|
|
|
+| B | 家庭天盘模块(运势/心情/吉位) | `FamilyAstrologyPanel` | `pages/mind-detail/components/` | `todayFortune`, `mood`, `direction` | `@tap` | -180 | 中(数据依赖复杂) |
|
|
|
+| C | 心 13 维雷达图 | `MindRadarChart` | `pages/mind-detail/components/` | `scores[]`, `dimensions[]` | — | -200 | 高(Canvas 绘制) |
|
|
|
+| D | 心维度介绍卡片 | `DimensionIntroCard`(已有) | — | — | — | 复用 | 低 |
|
|
|
+| E | 心理告警横幅 | `MindAlertBanner` | `pages/mind-detail/components/` | `alerts[]` | `@dismiss` | -120 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -640 行 → 目标 ~1961 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.12 `pages/mind-detail/emotion-checkin`(1390 行)|情绪打卡
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 日期 + 连续打卡 | `CheckinDateHeader` | `pages/mind-detail/components/` | `date`, `streak` | — | -80 | 低 |
|
|
|
+| B | 效价 - 激活度 2D 网格 | `ValenceArousalGrid` | `pages/mind-detail/components/` | `selectedPoint` | `@select` | -150 | 高(交互复杂) |
|
|
|
+| C | Plutchik 情绪轮 | `EmotionWheel` | `pages/mind-detail/components/` | `selectedEmotion` | `@select` | -180 | 高(Canvas 绘制) |
|
|
|
+| D | 强度滑条 + 精力/压力水平 | `EmotionIntensityControls` | `pages/mind-detail/components/` | `intensity`, `energy`, `stress` | `@change` | -140 | 中 |
|
|
|
+| E | 拍照/录像 + 情绪识别 | `EmotionMediaCapture` | `pages/mind-detail/components/` | — | `@capture`, `@recognize` | -200 | 高(设备 API 调用) |
|
|
|
+| F | 文字记录 + 提交 | `EmotionTextSubmit` | `pages/mind-detail/components/` | `text` | `@submit` | -100 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -850 行 → 目标 ~540 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.13 `pages/mind-detail/emotion-trend`(874 行)|情绪趋势
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 统计概览卡片 | `EmotionStatsCard` | `pages/mind-detail/components/` | `avgScore`, `trend`, `alertLevel` | — | -80 | 低 |
|
|
|
+| B | 周期切换 + 折线图 | `EmotionTrendChart` | `pages/mind-detail/components/` | `data[]`, `period` | `@periodChange` | -200 | 高(Canvas 图表) |
|
|
|
+| C | 情绪日历热力图 | `EmotionHeatmapCalendar` | `pages/mind-detail/components/` | `heatmapData`, `selectedDate` | `@dateSelect` | -180 | 高 |
|
|
|
+| D | 情绪分布 + 按天详情 | `EmotionDistributionView` | `pages/mind-detail/components/` | `distribution`, `dayDetail` | — | -150 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -610 行 → 目标 ~264 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.14 `pages/mind-detail/family-dashboard`(1060 行)|家庭天盘
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 头部导航 + PDF 隐藏 Canvas | `FamilyDashboardHeader` | `pages/mind-detail/components/` | `exportReady` | `@export` | -80 | 中(离屏 Canvas) |
|
|
|
+| B | 数据概览卡片 | `DashboardOverviewCards` | `pages/mind-detail/components/` | `stats[]` | — | -100 | 低 |
|
|
|
+| C | 周/月趋势图 | `TrendChart`(已有) | — | — | — | 复用 | 低 |
|
|
|
+| D | 历史周报列表 + 详情弹窗 | `HistoryReportList` | `pages/mind-detail/components/` | `reports[]` | `@viewDetail` | -200 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -380 行 → 目标 ~680 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.15 `pages/body-detail/index`(1365 行)|身体首页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 品牌头部 + 定位语 | `DimensionBrandHeader`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| B | 健康概览卡片(关键物理指标) | `BodyOverviewCards` | `pages/body-detail/components/` | `indicators[]` | — | -150 | 中 |
|
|
|
+| C | 快捷导航(查看完整报告) | `BodyQuickNav` | `pages/body-detail/components/` | `reports[]` | `@tap` | -100 | 低 |
|
|
|
+| D | 雷达趋势图 | `BodyRadarTrend` | `pages/body-detail/components/` | `trends[]`, `dimensions[]` | — | -180 | 高(Canvas) |
|
|
|
+| E | 肠道菌群 / 疾病风险卡片 | `BodyRiskCards` | `pages/body-detail/components/` | `floraReport`, `diseaseRisk` | `@tap` | -160 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -690 行 → 目标 ~675 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.16 `pages/body-detail/health-report`(989 行)|身体报告
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 报告头部 | `ReportHeader`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| B | 评分可视化面板(菌群报告) | `ScoreVisualPanel` | `pages/body-detail/components/` | `scores[]` | — | -120 | 中 |
|
|
|
+| C | 指标列表(按分类分组) | `IndicatorListGroup` | `pages/body-detail/components/` | `groups[]` | — | -180 | 低 |
|
|
|
+| D | 营养缺乏分析 | `NutritionLackAnalysis` | `pages/body-detail/components/` | `deficiencies[]` | — | -100 | 低 |
|
|
|
+| E | 食材推荐 | `FoodRecommendationList` | `pages/body-detail/components/` | `foods[]` | `@tap` | -120 | 低 |
|
|
|
+| F | 五维雷达图 | `FiveDimRadarChart` | `pages/body-detail/components/` | `scores[]` | — | -150 | 高(Canvas) |
|
|
|
+
|
|
|
+**总计可抽**:约 -670 行 → 目标 ~319 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.17 `pages/wisdom-detail/index`(1354 行)|智慧首页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 品牌头部 + 定位语 | `DimensionBrandHeader`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| B | 学习能力评估图 | `LearningAbilityChart` | `pages/wisdom-detail/components/` | `score`, `benchmark` | — | -150 | 高(Canvas) |
|
|
|
+| C | 游客引导语 + 价值卡 | `GuestValueCard`(复用组件) | — | — | — | 复用 | 低 |
|
|
|
+| D | 五维能量条 + 认知指标卡片 | `WisdomMetricsCards` | `pages/wisdom-detail/components/` | `energyBars`, `cognitiveScores` | — | -180 | 中 |
|
|
|
+| E | 学习解读 + 强项/提升空间 | `LearningInsightPanel` | `pages/wisdom-detail/components/` | `insights`, `strengths`, `weaknesses` | — | -160 | 中 |
|
|
|
+| F | DAN 报告入口 | `DanReportEntry` | `pages/wisdom-detail/components/` | `hasReport`, `reportDate` | `@tap` | -100 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -690 行 → 目标 ~664 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.18 `pages/wisdom-detail/cognitive-report`(1026 行)|认知报告
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 报告卡片(综合评分 + 常模参考线) | `CognitiveReportCard` | `pages/wisdom-detail/components/` | `score`, `percentile`, `benchmark` | — | -180 | 中 |
|
|
|
+| B | 六维条形图 | `SixDimBarChart` | `pages/wisdom-detail/components/` | `scores[]` | — | -200 | 高(Canvas) |
|
|
|
+| C | 分析报告 + 成长建议 | `CognitiveAdvicePanel` | `pages/wisdom-detail/components/` | `analysis`, `suggestions[]` | — | -150 | 低 |
|
|
|
+| D | 家庭行动建议 | `FamilyActionSuggestions` | `pages/wisdom-detail/components/` | `actions[]` | `@tap` | -120 | 低 |
|
|
|
+| E | 历史趋势(最近两次对比) | `HistoricalTrendCompare` | `pages/wisdom-detail/components/` | `current`, `previous` | — | -150 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -800 行 → 目标 ~226 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.19 `pages/wisdom-detail/self-quiz`(923 行)|自测题
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 题目列表 + 选项渲染 | `QuizQuestionList` | `pages/wisdom-detail/components/` | `questions[]`, `answers` | `@answer` | -300 | 高(状态管理复杂) |
|
|
|
+| B | 进度指示 + 提交按钮 | `QuizProgressFooter` | `pages/wisdom-detail/components/` | `current`, `total`, `answered` | `@submit` | -100 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -400 行 → 目标 ~523 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.20 `pages/wealth/index`(1425 行)|财富首页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 品牌头部 + 定位语 | `DimensionBrandHeader`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| B | 月度引导语 + 游客价值卡 | `WealthMonthlyGuide` | `pages/wealth/components/` | `monthGuide`, `valueProps` | — | -120 | 低 |
|
|
|
+| C | 家庭成员选择条 | `DimensionMemberTabs`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| D | 五维能量条 + 身克富杠杆警告 | `WealthEnergyWatch` | `pages/wealth/components/` | `energyBars`, `leverageWarning` | — | -150 | 中(条件逻辑) |
|
|
|
+| E | 财富能量环 + 成长 | `WealthGrowthRing` | `pages/wealth/components/` | `ringData`, `growthTrend` | — | -180 | 高(Canvas) |
|
|
|
+| F | 子维度水滴 | `SubDimWaterDrops` | `pages/wealth/components/` | `drops[]` | — | -140 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -590 行 → 目标 ~835 行(略超阈值,接近可接受)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P3】任务与成长集群
|
|
|
+
|
|
|
+#### 2.21 `pages/tasks/tasks`(1408 行)|任务列表
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 页头(账号 + 成员选择) | `TaskPageHeader` | `pages/tasks/components/` | `currentAccount`, `members[]`, `selectedMember` | `@memberSelect` | -120 | 中 |
|
|
|
+| B | Tab 切换(待接受/今日/我创建的) | `TaskTabBar` | `pages/tasks/components/` | `activeTab` | `@change` | -80 | 低 |
|
|
|
+| C | 待接受任务列表 | `PendingTaskList` | `pages/tasks/components/` | `tasks[]` | `@accept`, `@reject` | -200 | 中 |
|
|
|
+| D | 今日任务列表 | `TodayTaskList` | `pages/tasks/components/` | `tasks[]` | `@complete` | -200 | 中 |
|
|
|
+| E | 我创建的任务列表 | `CreatedByTaskList` | `pages/tasks/components/` | `tasks[]` | `@edit`, `@delete` | -200 | 中 |
|
|
|
+| F | 弹窗组(拒绝/填写完成/创建) | `TaskModalsGroup` | `pages/tasks/components/` | — | — | -250 | 高(多弹窗状态) |
|
|
|
+
|
|
|
+**总计可抽**:约 -1050 行 → 目标 ~358 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.22 `pages/growth-main/index`(1089 行)|成长记录首页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | Hero 品牌区 | `GrowthHeroSection` | `pages/growth-main/components/` | `brandContent` | — | -100 | 低 |
|
|
|
+| B | 真实案例 + 功能预览 | `GrowthFeaturePreview` | `pages/growth-main/components/` | `cases[]`, `features[]` | — | -150 | 低 |
|
|
|
+| C | 五维健康体系介绍 | `FiveDimIntroCard`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| D | 登录引导 + 未完成提醒 | `GrowthOnboardingGuide` | `pages/growth-main/components/` | `pendingTasks`, `milestones` | `@goToTasks` | -120 | 中 |
|
|
|
+| E | 今日成长 + 里程碑统计 | `DailyGrowthCards` | `pages/growth-main/components/` | `todayItems`, `milestones[]` | — | -180 | 中 |
|
|
|
+| F | 推荐内容流(食材/饮食/任务/文章/商品) | `GrowthContentFeed` | `pages/growth-main/components/` | `feedItems[]` | `@itemTap` | -200 | 高(多类型 item 渲染) |
|
|
|
+
|
|
|
+**总计可抽**:约 -750 行 → 目标 ~339 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.23 `pages/growth/sleep-checkin`(856 行)|睡眠打卡
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 夜间主题头部(日期/时长/时间轴) | `SleepCheckinHeader` | `pages/growth/components/` | `date`, `duration`, `sleepTime`, `wakeTime` | — | -100 | 中 |
|
|
|
+| B | 睡眠质量点选打分 | `SleepQualityPicker` | `pages/growth/components/` | `selectedScore` | `@select` | -80 | 低 |
|
|
|
+| C | 快速标签(选填备注) | `SleepTagPicker` | `pages/growth/components/` | `tags[]`, `selectedTags` | `@toggle` | -100 | 低 |
|
|
|
+| D | 历史记录列表 | `SleepHistoryList` | `pages/growth/components/` | `records[]` | — | -150 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -430 行 → 目标 ~426 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.24 `pages/wishes/index`(1087 行)|心愿管理
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 积分卡片 + 筛选标签 | `WishListHeader` | `pages/wishes/components/` | `points`, `filters[]` | `@filterChange` | -100 | 低 |
|
|
|
+| B | 空状态(无心愿/筛选无结果) | `WishEmptyState` | `pages/wishes/components/` | `emptyType` | — | -80 | 低 |
|
|
|
+| C | 心愿列表(宝箱卡片) | `WishCardList` | `pages/wishes/components/` | `wishes[]` | `@claim`, `@delete` | -300 | 中 |
|
|
|
+| D | 浮动操作按钮 + 添加弹窗 | `WishFABAndModal` | `pages/wishes/components/` | — | `@add` | -150 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -630 行 → 目标 ~457 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P4】社交与活动集群
|
|
|
+
|
|
|
+#### 2.25 `pages/activity/index`(1386 行)|活动中心
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | Nav bar(标题 + 管理员"+") | `ActivityNavBar` | `pages/activity/components/` | `isAdmin` | — | -80 | 低 |
|
|
|
+| B | Tab bar(mine/discover/history/manage) | `ActivityTabBar` | `pages/activity/components/` | `activeTab`, `visibleTabs[]` | `@change` | -100 | 中(权限过滤) |
|
|
|
+| C | Tab 内容区(ScrollView 内) | `ActivityTabContent` | `pages/activity/components/` | `tabKey`, `activities[]` | — | -600 | 高(多 Tab 状态) |
|
|
|
+| D | 空状态 | `ActivityEmptyState` | `pages/activity/components/` | `tabKey` | — | -80 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -860 行 → 目标 ~526 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.26 `pages/activity/activity-detail/activity-detail`(1768 行)|活动详情
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 加载/错误状态 | `ActivityStatusView` | `pages/activity/components/` | `loading`, `error` | — | -80 | 低 |
|
|
|
+| B | 活动内容(封面图 + 详情) | `ActivityContentView` | `pages/activity/components/` | `activity` | — | -200 | 中 |
|
|
|
+| C | 底部操作栏(报名/分享/收藏) | `ActivityActionBar` | `pages/activity/components/` | `activity`, `userStatus` | `@register`, `@share`, `@favorite` | -150 | 中 |
|
|
|
+| D | 活动评价 + 已提交状态 | `ActivityReviewSection` | `pages/activity/components/` | `review`, `canReview` | `@submit` | -180 | 高 |
|
|
|
+| E | 弹窗组(能量扣减提示/评价/报名表单/分享海报) | `ActivityModalsGroup` | `pages/activity/components/` | — | — | -400 | 高(iOS fixed 定位问题) |
|
|
|
+
|
|
|
+**总计可抽**:约 -1010 行 → 目标 ~758 行(可降至 800 以下)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.27 `pages/activity/create`(1100 行)|创建活动
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 表单字段组(标题/类型/时间/地点/人数/价格/主办方/封面/简介/描述) | `ActivityFormFields` | `pages/activity/components/` | `form`, `errors` | `@change` | -400 | 高(表单验证) |
|
|
|
+| B | 海报模板选择 + 预览 | `ActivityPosterSelector` | `pages/activity/components/` | `templates[]`, `selected` | `@select` | -200 | 中 |
|
|
|
+| C | 操作按钮区 | `ActivityFormActions` | `pages/activity/components/` | `saving`, `canSubmit` | `@save`, `@publish` | -100 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -700 行 → 目标 ~400 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P5】商城与订单集群
|
|
|
+
|
|
|
+#### 2.28 `pages/shop/checkout/checkout`(2021 行)|结算页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 地址选择区 | `CheckoutAddressSection` | `pages/shop/components/` | `address`, `editable` | `@edit` | -150 | 中 |
|
|
|
+| B | 配送方式选择 | `DeliveryMethodPicker` | `pages/shop/components/` | `methods[]`, `selected` | `@select` | -120 | 低 |
|
|
|
+| C | 购买信息区(如需) | `PurchaseInfoSection` | `pages/shop/components/` | `info` | — | -80 | 低 |
|
|
|
+| D | 订单商品列表 | `OrderItemList` | `pages/shop/components/` | `items[]` | — | -200 | 中 |
|
|
|
+| E | 赠品会员提示 + 累计进度 | `GiftMembershipProgress` | `pages/shop/components/` | `progress`, `target` | — | -150 | 中 |
|
|
|
+| F | 运费 + 会员升级提示 + 限时折扣 + 赠品促销 + 优惠券 + 积分抵扣 + 备注 | `CheckoutPriceBreakdown` | `pages/shop/components/` | `fees`, `coupons`, `points`, `discounts` | `@couponSelect`, `@pointsToggle` | -400 | 高(多状态组合) |
|
|
|
+
|
|
|
+**总计可抽**:约 -1100 行 → 目标 ~921 行(略超,接近)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.29 `pages/shop/cart/cart`(828 行)|购物车
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 商品列表 | `CartItemList` | `pages/shop/components/` | `items[]` | `@select`, `@remove`, `@changeQty` | -300 | 中 |
|
|
|
+| B | 结算栏(合计 + 去结算) | `CartCheckoutBar` | `pages/shop/components/` | `total`, `selectedCount` | `@checkout` | -100 | 低 |
|
|
|
+| C | 会员升级提示 + 赠会员进度 + 一口价促销区 | `CartPromoSection` | `pages/shop/components/` | `upgradeHint`, `giftProgress`, `promo` | — | -180 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -580 行 → 目标 ~248 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P6】个人中心与设置集群
|
|
|
+
|
|
|
+#### 2.30 `pages/profile-main/profile`(1427 行)|个人中心
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 身份卡(头像/昵称/角色/成就徽章) | `ProfileIdentityCard` | `pages/profile-main/components/` | `member`, `badges[]` | `@edit` | -200 | 中 |
|
|
|
+| B | 家族成员速览 | `FamilyMemberStrip`(已有) | — | — | — | 复用 | 低 |
|
|
|
+| C | 个人成就统计 | `ProfileAchievementStats` | `pages/profile-main/components/` | `stats` | — | -150 | 低 |
|
|
|
+| D | 我的订单(电商风格) | `ProfileOrderList` | `pages/profile-main/components/` | `orders[]` | `@tap` | -250 | 中 |
|
|
|
+| E | 规划师服务入口 + 待审核提示 | `PlannerServiceEntry` | `pages/profile-main/components/` | `isPlanner`, `pendingReviews` | `@tap` | -120 | 低 |
|
|
|
+| F | 设置 + 退出 | `ProfileSettingsMenu` | `pages/profile-main/components/` | `settings[]` | `@select` | -150 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -870 行 → 目标 ~557 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.31 `pages/profile-extra/family-members`(1342 行)|家庭成员管理
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 家庭信息头部 | `FamilyInfoHeader` | `pages/profile-extra/components/` | `familyName`, `memberCount` | — | -80 | 低 |
|
|
|
+| B | 加入申请列表 | `MemberJoinRequests` | `pages/profile-extra/components/` | `requests[]` | `@approve`, `@reject` | -150 | 中 |
|
|
|
+| C | 成员卡片列表 | `FamilyMemberCardList` | `pages/profile-extra/components/` | `members[]` | `@tap` | -250 | 中 |
|
|
|
+| D | 成员详情弹窗 + 报告权限管理弹窗 | `FamilyMemberModals` | `pages/profile-extra/components/` | — | — | -300 | 高(多弹窗状态) |
|
|
|
+| E | 底部操作栏 | `FamilyActionsBar` | `pages/profile-extra/components/` | `canAdd`, `canInvite` | `@add`, `@invite` | -100 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -880 行 → 目标 ~462 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.32 `pages/profile/service-role-apply`(848 行)|服务角色申请
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 审核状态展示 | `ApplicationStatusView` | `pages/profile/components/` | `status`, `reviewer`, `feedback` | — | -120 | 低 |
|
|
|
+| B | 申请表单 | `ServiceRoleApplicationForm` | `pages/profile/components/` | `form`, `errors` | `@submit` | -300 | 高(表单验证) |
|
|
|
+
|
|
|
+**总计可抽**:约 -420 行 → 目标 ~428 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P7】财富推广集群
|
|
|
+
|
|
|
+#### 2.33 `pages/promotion/index`(991 行)|推广首页
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 家庭公共收益总览 | `PromotionRevenueOverview` | `pages/promotion/components/` | `totalRevenue`, `pendingWithdraw` | — | -120 | 中 |
|
|
|
+| B | 管理员操作按钮 | `AdminActionButtons` | `pages/promotion/components/` | `isAdmin` | `@action` | -80 | 低 |
|
|
|
+| C | 成员贡献榜 | `MemberContribRanking` | `pages/promotion/components/` | `ranking[]` | — | -150 | 中 |
|
|
|
+| D | 统计卡片 + 转化漏斗 | `PromotionStatsCards` | `pages/promotion/components/` | `stats`, `funnelData` | — | -180 | 中 |
|
|
|
+| E | 功能入口 + 提现按钮 | `PromotionActionGrid` | `pages/promotion/components/` | `entries[]` | `@tap` | -120 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -650 行 → 目标 ~341 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.34 `pages/promotion/team`(1183 行)|团队管理
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 团队统计 + 销售奖档位 | `TeamStatsHeader` | `pages/promotion/components/` | `stats`, `tierRules` | — | -150 | 中 |
|
|
|
+| B | 我的推荐人 | `MyReferrerCard` | `pages/promotion/components/` | `referrer` | — | -100 | 低 |
|
|
|
+| C | 团队消费额分级统计 | `TeamConsumptionStats` | `pages/promotion/components/` | `tiers[]` | — | -120 | 中 |
|
|
|
+| D | 团队层级树(扁平化渲染) | `TeamHierarchyTree` | `pages/promotion/components/` | `treeData` | — | -250 | 高(递归渲染) |
|
|
|
+| E | Tab 切换(成员列表/曲线图) | `TeamTabContent` | `pages/promotion/components/` | `activeTab`, `members[]`, `chartData` | `@tabChange` | -200 | 高 |
|
|
|
+
|
|
|
+**总计可抽**:约 -820 行 → 目标 ~363 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P8】其他功能集群
|
|
|
+
|
|
|
+#### 2.35 `pages/user-edit/user-edit`(1080 行)|用户编辑
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 角色选择(新用户首次) | `RoleSelector` | `pages/user-edit/components/` | `roles[]`, `selected` | `@select` | -120 | 低 |
|
|
|
+| B | 详细信息表单(头像/昵称/姓名/性别/身份证/生日/时辰/民族/血型/学历/婚姻/地区) | `UserProfileForm` | `pages/user-edit/components/` | `form`, `errors` | `@change` | -500 | 高(表单验证 + 地址联动) |
|
|
|
+
|
|
|
+**总计可抽**:约 -620 行 → 目标 ~460 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.36 `pages/dan-assessment/report-result`(860 行)|DAN 测评结果
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | Hero 头部 + 总分区 | `DanResultHeader` | `pages/dan-assessment/components/` | `totalScore`, `dimensions[]` | — | -150 | 中 |
|
|
|
+| B | 百分位进度条 | `PercentileProgressBar` | `pages/dan-assessment/components/` | `percentile`, `memberName` | — | -120 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -270 行 → 目标 ~590 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.37 `pages/membership/upgrade`(844 行)|会员升级
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 当前会员状态条 | `MembershipStatusBar` | `pages/membership/components/` | `currentTier`, `expiryDate` | — | -80 | 低 |
|
|
|
+| B | 等级切换 Tabs | `MembershipTierTabs` | `pages/membership/components/` | `tiers[]`, `selectedTier` | `@select` | -100 | 低 |
|
|
|
+| C | 开通/升级/续费卡片 | `MembershipActionCard` | `pages/membership/components/` | `tier`, `price`, `promotions[]` | `@purchase` | -180 | 中 |
|
|
|
+| D | 权益对比表 | `BenefitsComparisonTable` | `pages/membership/components/` | `benefits[]` | — | -150 | 低 |
|
|
|
+| E | 开通赠券规则 + 升级记录 | `MembershipRulesAndHistory` | `pages/membership/components/` | `coupons`, `history[]` | — | -120 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -630 行 → 目标 ~214 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.38 `pages/family/self-check-result`(831 行)|家庭自检结果
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | Loading 状态 | `LoadingSpinner`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| B | 总分横幅 | `SelfCheckScoreBanner` | `pages/family/components/` | `totalScore`, `level` | — | -100 | 低 |
|
|
|
+| C | 结果解读引导卡 | `ResultInterpretationCard` | `pages/family/components/` | `interpretation`, `nextSteps` | — | -150 | 中 |
|
|
|
+| D | 维度得分列表 | `DimensionScoresList` | `pages/family/components/` | `scores[]` | — | -120 | 低 |
|
|
|
+| E | AI 健康解读 + 全部健康提示 | `AIHealthInsights` | `pages/family/components/` | `insights`, `tips[]` | — | -180 | 高(AI 调用状态) |
|
|
|
+| F | 历史与操作 | `HistoryActions` | `pages/family/components/` | `history[]` | `@recheck` | -80 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -630 行 → 目标 ~201 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.39 `pages/discover-detail/product-detail/product-detail`(1371 行)|商品详情
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | SKU 选择器 | `ProductSKUPicker` | `pages/discover-detail/components/` | `skus[]`, `selected` | `@select` | -200 | 高(库存/价格联动) |
|
|
|
+| B | 配送方式说明 | `DeliveryMethodNotice` | `pages/discover-detail/components/` | `methods[]` | — | -80 | 低 |
|
|
|
+| C | 套餐包含(子商品展示) | `BundleContentsView` | `pages/discover-detail/components/` | `subProducts[]` | — | -100 | 中 |
|
|
|
+| D | 内容关联(文章/活动/商品) | `RelatedContentFeed` | `pages/discover-detail/components/` | `relatedItems[]` | `@itemTap` | -200 | 高(触底分页) |
|
|
|
+| E | 底部操作栏(加购/立即购买) | `ProductActionBar` | `pages/discover-detail/components/` | `product`, `cartCount` | `@addToCart`, `@buyNow` | -150 | 中 |
|
|
|
+
|
|
|
+**总计可抽**:约 -730 行 → 目标 ~641 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.40 `pages/action-detail/index`(1343 行)|行动详情
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 品牌头部 + 定位语 | `DimensionBrandHeader`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| B | 家庭成员选择条 | `DimensionMemberTabs`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| C | 游客引导语 + 价值卡 | `GuestValueCard`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| D | 五维能量条 | `DimensionEnergyBar`(复用) | — | — | — | 复用 | 低 |
|
|
|
+| E | 关系解读 + 六维关系图 | `RelationshipInterpretation` | `pages/action-detail/components/` | `解读文本`, `六维数据` | — | -250 | 高 |
|
|
|
+| F | 家庭关系(行维度核心) | `FamilyRelationshipGraph`(已有) | — | — | — | 复用 | 低 |
|
|
|
+| G | 章鱼图(关键人拓展) | `OctopusDiagram`(已有) | — | — | — | 复用 | 低 |
|
|
|
+| H | 珍珠图(我有什么) | `PearlDiagram`(已有) | — | — | — | 复用 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -250 行 → 目标 ~1093 行(仍需进一步优化)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.41 `pages/ai/chat`(984 行)|AI 对话
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 导航栏 + 会话列表(侧拉) | `ChatNavBar` | `pages/ai/components/` | `conversations[]` | `@openSidebar`, `@selectConv` | -150 | 中 |
|
|
|
+| B | 消息列表(气泡渲染) | `ChatMessageList` | `pages/ai/components/` | `messages[]` | — | -300 | 高(长列表虚拟滚动) |
|
|
|
+| C | 输入区 + 配额进度条 | `ChatInputArea` | `pages/ai/components/` | `quotaUsed`, `quotaTotal` | `@send` | -200 | 中 |
|
|
|
+| D | 升级引导弹窗 | `UpgradeGuideModal`(已有) | — | — | — | 复用 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -650 行 → 目标 ~334 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### 2.42 `pages/health/report-survey`(930 行)|健康问卷
|
|
|
+
|
|
|
+| # | 区块 | 建议组件 | 落位 | Props | Events | 预估 | 风险 |
|
|
|
+|---|------|----------|------|-------|--------|------|------|
|
|
|
+| A | 导航 + 进度条 + 提示说明 | `SurveyHeader` | `pages/health/components/` | `progress`, `hint` | — | -80 | 低 |
|
|
|
+| B | 表单各部分(生活习惯/饮食/消化/睡眠/运动/饮水/用药) | `SurveyFormSections` | `pages/health/components/` | `sections[]`, `answers` | `@change` | -500 | 高(长表单多步骤) |
|
|
|
+| C | 提交按钮 | `SurveySubmitBtn` | `pages/health/components/` | `disabled`, `submitting` | `@submit` | -50 | 低 |
|
|
|
+
|
|
|
+**总计可抽**:约 -630 行 → 目标 ~300 行
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 【P9】首页未登录态营销内容
|
|
|
+
|
|
|
+#### 2.43 `pages/index/index`(主包引流页)
|
|
|
+
|
|
|
+> 主包入口页,本身不大,但负责路由分流。不涉及本次拆分。
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 3. 组件复用矩阵(避免重复建设)
|
|
|
+
|
|
|
+以下组件在多个页面中出现,**应提取到 `components/` 统一维护**:
|
|
|
+
|
|
|
+| 组件名 | 落位 | 复用页面数 | 说明 |
|
|
|
+|--------|------|-----------|------|
|
|
|
+| `DimensionBrandHeader` | `components/` | 5+ | 身/心/智/行/富维度通用的品牌头部 |
|
|
|
+| `DimensionMemberTabs` | `components/` | 4+ | 家庭成员选择条(已有 `DimensionMemberTabs.vue`,需确认复用) |
|
|
|
+| `GuestValueCard` | `components/` | 4+ | 游客引导价值卡(维度色 CTA + 价值预览) |
|
|
|
+| `FamilyEnergyBar` | `components/`(已有) | 3+ | 家庭能量横条 |
|
|
|
+| `WuxingSandbox` | `components/`(已有) | 3+ | 五行能量沙盘 |
|
|
|
+| `FamilyRelationGraph` | `components/`(已有) | 2+ | 家庭关系图谱 |
|
|
|
+| `TrendChart` | `components/`(已有) | 2+ | 趋势折线图 |
|
|
|
+| `ReportHeader` | `pages/health/components/` | 3+ | 报告头部通用组件 |
|
|
|
+| `PlanStepIndicator` | `pages/health/components/` | 2+ | 多步骤表单步骤指示器 |
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 4. index-home 深度拆分方案(3063 行)
|
|
|
+
|
|
|
+### 4.1 现状诊断
|
|
|
+
|
|
|
+`index-home` 是目前最重的页面,3063 行,但**结构非常清晰**,模板注释已标明 9 大区块:
|
|
|
+
|
|
|
+| 区块 | 行号范围 | 行数 | 性质 | 拆分可行性 |
|
|
|
+|------|----------|------|------|-----------|
|
|
|
+| ⓪ 新手成长礼包进度条 | 51-52 | 2 | 组件复用(已有 `OnboardingProgressBar`) | ✅ 已抽 |
|
|
|
+| ① 自测大卡 | 54-65 | 12 | 登录态首屏入口 | ✅ 易拆 |
|
|
|
+| ①.b 行动引导条 | 67-79 | 13 | Nudge 卡片 | ✅ 易拆 |
|
|
|
+| ② 能量沙盘 | 81-99 | 19 | Canvas 星图(**保留**) | ⚠️ 低优先级 |
|
|
|
+| ② 上传报告 | 101-107 | 7 | `FamilyFeed` 组件 | ✅ 已抽 |
|
|
|
+| ④ 推荐文章 | 109-122 | 14 | `ArticleBookshelf` + 会员入口 | ✅ 易拆 |
|
|
|
+| ④ 快捷功能入口 | 124-141 | 18 | 应用库动态渲染 | ✅ 易拆 |
|
|
|
+| ④ 家庭动态 | 143-166 | 24 | 任务快捷列表 | ✅ 易拆 |
|
|
|
+| ③ 家庭挑战 | 168-188 | 21 | `FamilyChallengeCard` | ✅ 已抽 |
|
|
|
+| ③ 会员入口 | 190-192 | 3 | `DailyTaskCard` | ✅ 已抽 |
|
|
|
+| ③ 今日任务 | 194-202 | 9 | `ReportUploadCard` | ✅ 已抽 |
|
|
|
+| ③ 推荐阅读 | 204-215 | 12 | `ArticleBookshelf` | ✅ 已抽 |
|
|
|
+| ④ 推荐商品 | 217-230 | 14 | `DimensionProducts` | ✅ 已抽 |
|
|
|
+| 品牌 Hero 区(未登录态) | 251-270 | 20 | 引流内容 | ✅ 易拆 |
|
|
|
+| 价值主张 | 272-305 | 34 | 4 张 card | ✅ 易拆 |
|
|
|
+| 三步上手 | 307-330 | 24 | 步骤说明 | ✅ 易拆 |
|
|
|
+| 五行沙盘预览 | 331-333 | 3 | `WuxingSandbox mode="preview"` | ✅ 已抽 |
|
|
|
+| 热门活动 | 334-359 | 26 | 活动列表 | ✅ 易拆 |
|
|
|
+| 推荐阅读 | 361-408 | 48 | 文章列表 | ✅ 易拆 |
|
|
|
+| 底部登录按钮 | 408-412 | 5 | CTA | ✅ 易拆 |
|
|
|
+
|
|
|
+**关键发现**:
|
|
|
+- 模板仅 423 行,**脚本 1675 行**(数据加载/状态管理)才是重心
|
|
|
+- 样式 962 行,大部分为局部调色板(单页专有色阶)
|
|
|
+- 多数区块**已使用组件**(`FamilyFeed`, `WuxingSandbox`, `ArticleBookshelf`, `DimensionProducts`, `FamilyChallengeCard`, `DailyTaskCard`, `ReportUploadCard`, `OnboardingProgressBar`, `OnboardingGuide`, `ConfigurableGuide`)
|
|
|
+- 剩余未抽的主要是**内联模板片段**(自测大卡、行动引导条、会员入口、快捷功能、家庭动态、品牌 Hero、价值主张、三步上手、热门活动、推荐阅读、底部登录)
|
|
|
+
|
|
|
+### 4.2 分阶段拆分计划
|
|
|
+
|
|
|
+#### 阶段一:模板片段提取(预计 -800 行)
|
|
|
+
|
|
|
+| 组件 | 落位 | Props | Events | 预估减少 |
|
|
|
+|------|------|-------|--------|----------|
|
|
|
+| `SelfTestCard` | `pages/index-home/components/` | `title`, `sub`, `badgeCount`, `icon` | `@tap` | -60 |
|
|
|
+| `GuideBar` | `pages/index-home/components/` | `color`, `icon`, `title`, `sub`, `btnText` | `@tap` | -50 |
|
|
|
+| `MemberEntryCard` | `pages/index-home/components/` | `title`, `desc`, `btnText`, `icon` | `@tap` | -40 |
|
|
|
+| `QuickFunctionBar` | `pages/index-home/components/` | `apps[]` | `@tapApp` | -80 |
|
|
|
+| `TaskQuickList` | `pages/index-home/components/` | `tasks[]`, `onComplete` | `@complete` | -100 |
|
|
|
+| `HeroSection`(未登录态) | `pages/index-home/components/` | — | — | -180 |
|
|
|
+| `ValuePropSection` | `pages/index-home/components/` | — | — | -100 |
|
|
|
+| `HowItWorksSection` | `pages/index-home/components/` | — | — | -80 |
|
|
|
+| `ActivityFeedSection` | `pages/index-home/components/` | `activities[]` | `@tapActivity` | -100 |
|
|
|
+| `ArticleFeedSection` | `pages/index-home/components/` | `articles[]` | `@tapArticle` | -80 |
|
|
|
+| `LoginFooter` | `pages/index-home/components/` | — | `@tapLogin` | -40 |
|
|
|
+
|
|
|
+**阶段一后预估**:3063 - 800 = **2263 行**
|
|
|
+
|
|
|
+#### 阶段二:样式局部化(预计 -400 行)
|
|
|
+
|
|
|
+将样式迁移至组件的 `<style>` 块:
|
|
|
+- 品牌 Hero 区样式 → `HeroSection.vue`
|
|
|
+- 价值主张样式 → `ValuePropSection.vue`
|
|
|
+- 三步上手样式 → `HowItWorksSection.vue`
|
|
|
+- 活动/文章列表样式 → 各自组件
|
|
|
+
|
|
|
+**阶段二后预估**:2263 - 400 = **1863 行**
|
|
|
+
|
|
|
+#### 阶段三:脚本逻辑下沉(预计 -600 行)
|
|
|
+
|
|
|
+将 `methods` 中的事件处理下沉至组件:
|
|
|
+- `onGuideTap()` → `GuideBar` 内部
|
|
|
+- `onQuickTap(app)` → `QuickFunctionBar` 内部
|
|
|
+- `quickCompleteTask(task)` → `TaskQuickList` 内部
|
|
|
+- `onFeedItemViewed()` → `FamilyFeed` 内部(已有)
|
|
|
+
|
|
|
+父页面只保留数据加载逻辑(`loadLoggedInData()`, `loadUnloggedInData()` 等)。
|
|
|
+
|
|
|
+**阶段三后预估**:1863 - 600 = **1263 行**
|
|
|
+
|
|
|
+#### 阶段四:组件复用优化(预计 -200 行)
|
|
|
+
|
|
|
+确认以下组件是否已可复用,减少重复导入:
|
|
|
+- `OnboardingProgressBar`(已有)✅
|
|
|
+- `FamilyFeed`(已有)✅
|
|
|
+- `WuxingSandbox`(已有)✅
|
|
|
+- `ArticleBookshelf`(已有)✅
|
|
|
+- `DimensionProducts`(已有)✅
|
|
|
+- `FamilyChallengeCard`(已有)✅
|
|
|
+- `DailyTaskCard`(已有)✅
|
|
|
+- `ReportUploadCard`(已有)✅
|
|
|
+
|
|
|
+若部分组件可进一步通用化(如 `ArticleBookshelf` 改为支持 `mode="home"`),可再减 -200 行。
|
|
|
+
|
|
|
+**最终预估**:**~1063 行**(仍超 800,但已降低 65%)
|
|
|
+
|
|
|
+### 4.3 风险与注意事项
|
|
|
+
|
|
|
+| 风险点 | 等级 | 应对策略 |
|
|
|
+|--------|------|----------|
|
|
|
+| 事件处理器依赖页面级 data | 高 | 组件 emit 事件,父页面转发,不直接访问父 data |
|
|
|
+| 弹窗(splash/登录浮层)位置 | 中 | 保持 `position: fixed` 在页面根级别,不放入子组件 |
|
|
|
+| `font-scale` 令牌传递 | 低 | 通过 CSS 变量自动继承,无需 props |
|
|
|
+| Canvas 图表(能量沙盘) | 高 | 不拆,保留内联 |
|
|
|
+| 分包引用主包资源 | 低 | 所有组件放主包 `components/` |
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 5. 优先级排序与实施顺序
|
|
|
+
|
|
|
+### 5.1 排序公式
|
|
|
+
|
|
|
+```
|
|
|
+优先级分数 = 行数 × 改动频率(估算) × 风险系数
|
|
|
+```
|
|
|
+
|
|
|
+| 权重 | 说明 |
|
|
|
+|------|------|
|
|
|
+| 行数 | 直接影响维护成本 |
|
|
|
+| 改动频率 | 近 3 个月变更次数(高/中/低) |
|
|
|
+| 风险系数 | 高=2.0,中=1.5,低=1.0 |
|
|
|
+
|
|
|
+### 5.2 优先级矩阵
|
|
|
+
|
|
|
+| 优先级 | 页面 | 行数 | 改动频率 | 风险 | 建议 |
|
|
|
+|--------|------|------|----------|------|------|
|
|
|
+| **P0(立即拆)** | `index-home/index` | 3063 | 高 | 中 | 分 4 阶段实施 |
|
|
|
+| **P0** | `home-pages/parent-index` | 2294 | 高 | 中 | 先拆 Banner + 成员选择条 |
|
|
|
+| **P0** | `mind-detail/index` | 2601 | 中 | 高 | 雷达图拆分需谨慎 |
|
|
|
+| **P1(近期拆)** | `health/report-detail` | 2654 | 高 | 中 | 指标明细行 + 弹窗 |
|
|
|
+| **P1** | `shop/checkout/checkout` | 2021 | 中 | 高 | 价格分解区 |
|
|
|
+| **P1** | `health/health-plan-summary` | 1913 | 中 | 高 | 问卷 + 签名区 |
|
|
|
+| **P1** | `health/report-confirm` | 1841 | 中 | 中 | 条件渲染区块 |
|
|
|
+| **P1** | `activity/activity-detail` | 1768 | 中 | 高 | iOS fixed 弹窗 |
|
|
|
+| **P2(中期拆)** | `health/gut-flora-detail` | 1586 | 低 | 中 | 手风琴组件 |
|
|
|
+| **P2** | `home-pages/child-index` | 1486 | 中 | 中 | 推荐流 |
|
|
|
+| **P2** | `profile-main/profile` | 1427 | 中 | 低 | 成就统计 + 订单 |
|
|
|
+| **P2** | `wealth/index` | 1425 | 低 | 高 | Canvas 图表 |
|
|
|
+| **P2** | `tasks/tasks` | 1408 | 高 | 中 | 多 Tab 状态 |
|
|
|
+| **P2** | `mind-detail/emotion-checkin` | 1390 | 低 | 高 | Canvas 情绪轮 |
|
|
|
+| **P2** | `activity/index` | 1386 | 中 | 中 | 多 Tab 内容 |
|
|
|
+| **P2** | `discover-detail/product-detail` | 1371 | 中 | 高 | SKU 联动 |
|
|
|
+| **P2** | `body-detail/index` | 1365 | 低 | 高 | Canvas 雷达 |
|
|
|
+| **P2** | `wisdom-detail/index` | 1354 | 低 | 高 | Canvas 图表 |
|
|
|
+| **P2** | `action-detail/index` | 1343 | 低 | 中 | 关系解读 |
|
|
|
+| **P2** | `profile-extra/family-members` | 1342 | 中 | 高 | 多弹窗 |
|
|
|
+| **P2** | `health/challenge-manage` | 1323 | 低 | 中 | 表单弹窗 |
|
|
|
+| **P3(可暂缓)** | 其余 20+ 页 | <1200 | 低 | 低 | 视资源情况排期 |
|
|
|
+
|
|
|
+### 5.3 暂缓建议
|
|
|
+
|
|
|
+以下页面**不建议立即拆分**:
|
|
|
+1. **Canvas 密集型**(`mind-detail/emotion-checkin`, `wisdom-detail/cognitive-report`, `body-detail/index`)— 图表渲染逻辑复杂,拆分后调试成本高
|
|
|
+2. **表单密集型**(`health/report-survey`, `activity/create`, `user-edit/user-edit`)— 状态管理耦合深,需整体重构
|
|
|
+3. **低频变更**(`dan-assessment/report-result`, `membership/upgrade`, `family/self-check-result`)— 代码稳定,优先级低
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 6. U8 子任务拆解建议
|
|
|
+
|
|
|
+基于上述分析,建议将 U8 拆分为 **8 个独立子任务**,每个子任务可在 1-2 周内完成:
|
|
|
+
|
|
|
+### 子任务 1:index-home 阶段一(模板提取)
|
|
|
+- **目标**:将 11 个内联模板片段提取为独立组件
|
|
|
+- **产出**:`pages/index-home/components/` 下 11 个 `.vue` 文件
|
|
|
+- **验证**:首页视觉与交互不变,ESLint/CI 通过
|
|
|
+
|
|
|
+### 子任务 2:index-home 阶段二(样式局部化)
|
|
|
+- **目标**:将样式迁移至各组件 `<style>` 块
|
|
|
+- **产出**:页面样式从 962 行降至 ~562 行
|
|
|
+- **验证**:SCSS 编译通过,无令牌缺失
|
|
|
+
|
|
|
+### 子任务 3:index-home 阶段三(脚本下沉)
|
|
|
+- **目标**:事件处理器下沉至组件,父页面只保留数据加载
|
|
|
+- **产出**:脚本从 1675 行降至 ~1075 行
|
|
|
+- **验证**:所有事件正常触发,无 state 丢失
|
|
|
+
|
|
|
+### 子任务 4:index-home 阶段四(组件复用确认)
|
|
|
+- **目标**:确认现有组件可复用性,移除重复导入
|
|
|
+- **产出**:最终行数 ~1063 行
|
|
|
+- **验证**:性能测试(首屏加载时间)
|
|
|
+
|
|
|
+### 子任务 5:parent-index 拆分
|
|
|
+- **目标**:提取 Banner、成员选择条、微行动卡片
|
|
|
+- **产出**:页面降至 ~1600 行
|
|
|
+- **验证**:家庭首页功能正常
|
|
|
+
|
|
|
+### 子任务 6:mind-detail/index 拆分
|
|
|
+- **目标**:提取品牌头部、天盘模块、告警横幅
|
|
|
+- **产出**:页面降至 ~1961 行
|
|
|
+- **验证**:雷达图渲染正常(关键路径)
|
|
|
+
|
|
|
+### 子任务 7:健康报告集群拆分(report-detail + report-confirm)
|
|
|
+- **目标**:提取报告头部、指标行、弹窗组
|
|
|
+- **产出**:两页均降至 ~1200 行以下
|
|
|
+- **验证**:报告加载与交互正常
|
|
|
+
|
|
|
+### 子任务 8:任务集群拆分(tasks + wishes + growth-main)
|
|
|
+- **目标**:提取 Tab 切换、列表项、弹窗组
|
|
|
+- **产出**:三页均降至 ~500 行以下
|
|
|
+- **验证**:任务状态流转正常
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 7. 验证门禁(每次拆分后必须通过)
|
|
|
+
|
|
|
+1. **编译门禁**:`node scripts/verify-vue-compile.js` 全量通过
|
|
|
+2. **反模式审计**:`node scripts/audit-mp-antipatterns.js` ERROR 归零
|
|
|
+3. **API 去重审计**:`node scripts/audit-duplicate-api-calls.js` 通过
|
|
|
+4. **HBuilderX 打包**:确认可正常编译,无白板
|
|
|
+5. **微信开发者工具预览**:视觉等价,交互一致
|
|
|
+6. **性能基线**:首屏加载时间无明显退化(±10% 以内)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 8. 附录
|
|
|
+
|
|
|
+### A. 组件落位约定速查
|
|
|
+
|
|
|
+```
|
|
|
+components/ # 跨页面复用
|
|
|
+├── wuxing-sandbox.vue # 已有
|
|
|
+├── FamilyFeed.vue # 已有
|
|
|
+├── ArticleBookshelf.vue # 已有
|
|
|
+└── ...
|
|
|
+
|
|
|
+pages/<module>/components/ # 模块专属
|
|
|
+├── pages/index-home/components/
|
|
|
+│ ├── SelfTestCard.vue
|
|
|
+│ ├── GuideBar.vue
|
|
|
+│ └── ...
|
|
|
+├── pages/health/components/
|
|
|
+│ ├── ReportHeader.vue
|
|
|
+│ ├── IndicatorRow.vue
|
|
|
+│ └── ...
|
|
|
+└── ...
|
|
|
+```
|
|
|
+
|
|
|
+### B. 令牌速查
|
|
|
+
|
|
|
+| 令牌类型 | 可用值 |
|
|
|
+|----------|--------|
|
|
|
+| 圆角 | `8rpx`, `16rpx`, `24rpx`, `999rpx` |
|
|
|
+| 字号 | `calc(Nrpx * var(--font-scale, 1))` |
|
|
|
+| 品牌色 | `$brand-primary`, `$brand-primary-light`, `$brand-primary-deep` |
|
|
|
+| 状态色 | `$status-success-*`, `$status-warning-*`, `$status-danger-*` |
|
|
|
+| 维度色 | `$dim-body`, `$dim-mind`, `$dim-wisdom`, `$dim-action`, `$dim-wealth` |
|
|
|
+| 文字色 | `$facade-text-strong`, `$facade-text-body`, `$facade-text-muted`, `$facade-text-faint` |
|
|
|
+| 背景色 | `$app-surface`, `$app-bg`, `$facade-fill-*` |
|
|
|
+
|
|
|
+### C. 禁止项重申
|
|
|
+
|
|
|
+- ❌ `?.` 可选链
|
|
|
+- ❌ CSS Grid
|
|
|
+- ❌ `:key` 表达式
|
|
|
+- ❌ `new Date(string)`
|
|
|
+- ❌ `uni.getSystemInfoSync()`
|
|
|
+- ❌ emoji 作功能图标
|
|
|
+- ❌ 子组件重复请求父页面已加载数据
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+> **文档版本**:v1.0
|
|
|
+> **创建日期**:2026-10-27
|
|
|
+> **状态**:待裁决
|
|
|
+> **下一步**:主理人确认后,按 §6 子任务派发实施
|