Browse Source

feat: member-detail 维度专属内容动态组件插槽

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Sisyphus 2 months ago
parent
commit
58355077e9
1 changed files with 29 additions and 1 deletions
  1. 29 1
      cfc-frontend/pages/member-detail/member-detail.vue

+ 29 - 1
cfc-frontend/pages/member-detail/member-detail.vue

@@ -48,6 +48,17 @@
           @memberTap="onGraphMemberTap" />
       </view>
 
+      <!-- 维度专属内容 -->
+      <view class="dimension-section">
+        <component :is="dimensionSection"
+          :memberId="targetMemberId"
+          :childId="childId"
+          :memberType="memberType"
+          :memberInfo="memberInfo"
+          :sandboxData="sandboxData"
+          :energyMap="energyMapForGraph" />
+      </view>
+
       <!-- 今日任务(仅当有 childId 时显示) -->
       <DimensionTasks
         v-if="childId"
@@ -84,6 +95,10 @@ import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
 import DimensionTasks from '../../components/DimensionTasks.vue'
 import DimensionActivities from '../../components/DimensionActivities.vue'
 import DimensionProducts from '../../components/DimensionProducts.vue'
+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'
 import { getFamilyEnergySandbox, getTodayTasksByCategory, getActivityList, getProductsByDomain, getChildren } from '../../utils/api.js'
 
 // 维度配置
@@ -97,7 +112,7 @@ var dimensionConfig = {
 }
 
 export default {
-  components: { FamilyEnergyBar, FamilyRelationGraph, DimensionTasks, DimensionActivities, DimensionProducts },
+  components: { FamilyEnergyBar, FamilyRelationGraph, DimensionTasks, DimensionActivities, DimensionProducts, BodySection, MindSection, WisdomSection, ActionSection },
   data() {
     return {
       memberId: null,
@@ -215,6 +230,15 @@ export default {
     // 是否显示推荐内容(身卡片入口不显示)
     showRecommendations: function() {
       return this.entrySource !== 'body-card'
+    },
+    dimensionSection: function() {
+      var map = {
+        body: BodySection,
+        mind: MindSection,
+        wisdom: WisdomSection,
+        action: ActionSection
+      }
+      return map[this.dimensionCode] || null
     }
   },
   onLoad: function(options) {
@@ -477,4 +501,8 @@ export default {
 .bottom-spacer {
   height: 40rpx;
 }
+
+.dimension-section {
+  margin: 20rpx 30rpx;
+}
 </style>