# 家庭成员详情页维度专属内容区 — 实施计划 > **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:** 家庭成员详情页根据 `dimensionCode` 参数(body/mind/wisdom/action)展示维度专属内容 **Architecture:** 在现有 `member-detail.vue` 的 FamilyRelationGraph 下方插入动态组件区域,通过 `` 根据 dimensionCode 切换 4 个独立子组件。共用部分(导航、成员卡、能量条、关系图谱)不变。 **Tech Stack:** uni-app Vue 2 (Options API), 微信小程序 --- ### Task 1: 改造 member-detail.vue — 动态组件插槽 **Files:** - Modify: `cfc-frontend/pages/member-detail/member-detail.vue` - [ ] **Step 1: 在 template 中 FamilyRelationGraph 之后插入动态组件区** 在 `member-detail.vue` 的 template 中,FamilyRelationGraph 的 `` 闭合标签之后、`` 之前,添加: ```html ``` - [ ] **Step 2: 在 script 中添加 imports** 在现有 import 块末尾添加: ```javascript import BodySection from '../../components/member-detail-sections/body-section.vue' import MindSection from '../../components/member-detail-sections/mind-section.vue' import WisdomSection from '../../components/member-detail-sections/wisdom-section.vue' import ActionSection from '../../components/member-detail-sections/action-section.vue' ``` 在 `components: { ... }` 中添加这四个组件。 - [ ] **Step 3: 添加 computed 属性映射 dimensionCode → 组件** ```javascript dimensionSection: function() { var map = { body: BodySection, mind: MindSection, wisdom: WisdomSection, action: ActionSection } return map[this.dimensionCode] || null }, ``` - [ ] **Step 4: 添加样式** ```css .dimension-section { margin: 20rpx 30rpx; } ``` - [ ] **Step 5: 确认 member-detail.vue 的 props 传递正确** 在 `` 上添加 props 绑定: ```html ``` --- ### Task 2: 创建 body-section.vue **Files:** - Create: `cfc-frontend/components/member-detail-sections/body-section.vue` - Reference: `cfc-frontend/pages/body/index.vue` 的 `loadHealthReport`, `loadDimensionData`, `getCheckinList` - [ ] **Step 1: 创建 body-section.vue 基本结构(template + script + style)** ```html ``` - [ ] **Step 2: 添加 script 逻辑** ```html ``` - [ ] **Step 3: 添加样式** ```html ``` --- ### Task 3: 创建 mind-section.vue **Files:** - Create: `cfc-frontend/components/member-detail-sections/mind-section.vue` - Reference: `cfc-frontend/pages/mind/index.vue` 的 `loadContacts`, `loadHealthAlerts`, `loadMilestones` - [ ] **Step 1: 创建 mind-section.vue 模板** ```html ``` - [ ] **Step 2: 添加 mind-section.vue script** ```html ``` - [ ] **Step 3: 添加样式(与 body-section 风格一致)** ```html ``` --- ### Task 4: 创建 wisdom-section.vue **Files:** - Create: `cfc-frontend/components/member-detail-sections/wisdom-section.vue` - Reference: `cfc-frontend/pages/wisdom/index.vue` 的 `loadCognitiveReport`, `getAssessmentHistory` - [ ] **Step 1: 创建 wisdom-section.vue 模板** ```html ``` - [ ] **Step 2: 添加 wisdom-section.vue script** ```html ``` - [ ] **Step 3: 添加样式** ```html ``` --- ### Task 5: 创建 action-section.vue **Files:** - Create: `cfc-frontend/components/member-detail-sections/action-section.vue` - Reference: `cfc-frontend/pages/action/index.vue` - [ ] **Step 1: 创建 action-section.vue 模板** ```html ``` - [ ] **Step 2: 添加 action-section.vue script** ```html ``` - [ ] **Step 3: 添加样式** ```html ``` --- ### Task 6: 验证编译 **Files:** - Project root: `cfc-backend/` (not needed, frontend only) - [ ] **Step 1: 检查文件结构** ```bash ls -la cfc-frontend/components/member-detail-sections/ ls -la cfc-frontend/pages/member-detail/ ``` - [ ] **Step 2: 检查 member-detail.vue 无语法错误** 确认 imports、components、computed 等都已正确添加。 - [ ] **Step 3: 确认页面路由不冲突** ```bash grep -n 'member-detail' cfc-frontend/pages.json ``` --- ### 自检清单 1. **Spec 覆盖度**: - [ ] 4 个子组件都对应到 spec 中的各维度内容定义 - [ ] 动态组件机制已实现(Task 1) - [ ] 共用部分保持不变 - [ ] childId 可用性处理(非孩子成员显示空状态) 2. **占位符检查**: 无 "TBD", "TODO", "implement later" 3. **类型一致性**: - [ ] `memberId`, `childId`, `memberType` props 在 4 个子组件中命名一致 - [ ] `energyMap` prop 与 member-detail.vue 中的 `energyMapForGraph` 匹配 4. **Scope 检查**: 范围聚焦于 member-detail 页面的内容区改造,不涉及导航、路由、后端改动。