Przeglądaj źródła

feat(frontend): 智行富三页强项与提升卡片-认知/关系/财富强弱项标记

- wisdom-detail: 新增认知强项与提升卡片,7维得分>=75标强项、<60标提升空间,无测评引导去测评
- action-detail: 新增关系强项与提升卡片,基于关系六维分数标记,空态引导关系问卷
- wealth: 新增财富强项与提升卡片,基于财富四维分数标记

Ultraworked with [Sisyphus](https://github.com/OhMyOpenCode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
E2E Test Bot 1 miesiąc temu
rodzic
commit
8c8341a6d1

+ 137 - 0
cfc-frontend/pages/action-detail/index.vue

@@ -35,6 +35,40 @@
       </view>
       </view>
       <text class="explain-text">{{ actionScore >= 80 ? '家庭关系和谐,家人沟通顺畅。' : actionScore >= 60 ? '家庭关系一般,建议多花时间陪伴家人。' : '家庭关系需要改善,建议进行家庭沟通活动。' }}</text>
       <text class="explain-text">{{ actionScore >= 80 ? '家庭关系和谐,家人沟通顺畅。' : actionScore >= 60 ? '家庭关系一般,建议多花时间陪伴家人。' : '家庭关系需要改善,建议进行家庭沟通活动。' }}</text>
     </view>
     </view>
+    <!-- 关系强项与提升 -->
+    <view class="section rel-insight" v-if="isLoggedIn && relStrengths.length + relImproves.length > 0">
+      <view class="section-header">
+        <text class="section-title">📈 关系强项与提升</text>
+      </view>
+      <view class="insight-group" v-if="relStrengths.length > 0">
+        <text class="insight-group-title">💪 关系强项</text>
+        <view class="insight-item" v-for="(item, idx) in relStrengths" :key="'s' + idx">
+          <text class="insight-item-name">{{ item.label }}</text>
+          <text class="insight-item-score">{{ item.score }}分</text>
+          <text class="insight-item-tag tag-strong">强项</text>
+        </view>
+      </view>
+      <view class="insight-group" v-if="relImproves.length > 0">
+        <text class="insight-group-title">🌱 提升空间</text>
+        <view class="insight-item" v-for="(item, idx) in relImproves" :key="'i' + idx">
+          <text class="insight-item-name">{{ item.label }}</text>
+          <text class="insight-item-score">{{ item.score }}分</text>
+          <text class="insight-item-tag tag-improve">待提升</text>
+        </view>
+      </view>
+      <view class="insight-tip" v-if="relStrengths.length > 0 && relImproves.length > 0">
+        <text class="insight-tip-text">保持优势关系,薄弱关系建议通过互动记录与关系问卷改善</text>
+      </view>
+    </view>
+    <view class="section rel-insight" v-else-if="isLoggedIn && actionSubDims.length > 0">
+      <view class="section-header">
+        <text class="section-title">📈 关系强项与提升</text>
+      </view>
+      <view class="insight-empty">
+        <text class="insight-empty-text">暂无关系评估数据,先做一次关系问卷了解您的关系状态</text>
+        <button class="insight-btn" @click="goRelationshipQuestionnaire">去答题</button>
+      </view>
+    </view>
     <!-- 关系六维 -->
     <!-- 关系六维 -->
     <dimension-sub-dims
     <dimension-sub-dims
       v-if="isLoggedIn && actionSubDims.length > 0"
       v-if="isLoggedIn && actionSubDims.length > 0"
@@ -256,6 +290,26 @@ export default {
         scores.push(member[dims[i].key] || 0)
         scores.push(member[dims[i].key] || 0)
       }
       }
       return scores
       return scores
+    },
+    /** 关系强项:actionSubDims 中得分 ≥75 的维度 */
+    relStrengths: function() {
+      var result = []
+      for (var i = 0; i < this.actionSubDims.length; i++) {
+        var d = this.actionSubDims[i]
+        var s = Number(d.score)
+        if (s >= 75) result.push({ label: d.label, score: s })
+      }
+      return result
+    },
+    /** 关系提升空间:actionSubDims 中 0<得分<60 的维度 */
+    relImproves: function() {
+      var result = []
+      for (var i = 0; i < this.actionSubDims.length; i++) {
+        var d = this.actionSubDims[i]
+        var s = Number(d.score)
+        if (s > 0 && s < 60) result.push({ label: d.label, score: s })
+      }
+      return result
     }
     }
   },
   },
   onShow() {
   onShow() {
@@ -402,6 +456,9 @@ export default {
       }
       }
       if (item.page) uni.navigateTo({ url: item.page })
       if (item.page) uni.navigateTo({ url: item.page })
     },
     },
+    goRelationshipQuestionnaire: function() {
+      uni.navigateTo({ url: '/pages/action-detail/relationship-questionnaire' })
+    },
     onTaskClick: function(task) {
     onTaskClick: function(task) {
       uni.navigateTo({ url: '/pages/tasks/tasks' })
       uni.navigateTo({ url: '/pages/tasks/tasks' })
     },
     },
@@ -612,4 +669,84 @@ export default {
 .bottom-spacer {
 .bottom-spacer {
   height: 40rpx;
   height: 40rpx;
 }
 }
+
+/* ===== 关系强项与提升卡片 ===== */
+.rel-insight {
+  background: #fff;
+  border-radius: 20rpx;
+  padding: 24rpx;
+}
+.insight-group {
+  margin-bottom: 16rpx;
+}
+.insight-group-title {
+  font-size: 26rpx;
+  font-weight: 600;
+  color: #333;
+  margin-bottom: 10rpx;
+  display: block;
+}
+.insight-item {
+  display: flex;
+  align-items: center;
+  padding: 12rpx 16rpx;
+  background: #F6FEF9;
+  border-radius: 12rpx;
+  margin-bottom: 8rpx;
+}
+.insight-item-name {
+  flex: 1;
+  font-size: 26rpx;
+  color: #333;
+}
+.insight-item-score {
+  font-size: 24rpx;
+  color: #666;
+  margin-right: 12rpx;
+}
+.insight-item-tag {
+  font-size: 20rpx;
+  padding: 4rpx 16rpx;
+  border-radius: 8rpx;
+  font-weight: 500;
+}
+.insight-item-tag.tag-strong {
+  background: #D1FAE5;
+  color: #059669;
+}
+.insight-item-tag.tag-improve {
+  background: #FEF3C7;
+  color: #D97706;
+}
+.insight-tip {
+  padding: 12rpx 16rpx;
+  background: #ECFDF5;
+  border-radius: 12rpx;
+}
+.insight-tip-text {
+  font-size: 22rpx;
+  color: #10B981;
+}
+.insight-empty {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 30rpx 0;
+}
+.insight-empty-text {
+  font-size: 24rpx;
+  color: #999;
+  margin-bottom: 20rpx;
+}
+.insight-btn {
+  background: linear-gradient(135deg, #10B981, #34D399);
+  color: #fff;
+  font-size: 26rpx;
+  font-weight: 600;
+  border: none;
+  border-radius: 40rpx;
+  padding: 14rpx 60rpx;
+  line-height: 1.6;
+  margin: 0;
+}
 </style>
 </style>

+ 104 - 0
cfc-frontend/pages/wealth/index.vue

@@ -106,6 +106,32 @@
         accent-color="#F59E0B"
         accent-color="#F59E0B"
         :dims="wealthSubDims" />
         :dims="wealthSubDims" />
 
 
+      <!-- 财富强项与提升 -->
+      <view class="section wealth-insight" v-if="isLoggedIn && wealthSubDims.length > 0 && (wealthStrengths.length > 0 || wealthImproves.length > 0)">
+        <view class="section-header">
+          <text class="section-title">📈 财富强项与提升</text>
+        </view>
+        <view class="insight-group" v-if="wealthStrengths.length > 0">
+          <text class="insight-group-title">💪 财富强项</text>
+          <view class="insight-item" v-for="(item, idx) in wealthStrengths" :key="'s' + idx">
+            <text class="insight-item-name">{{ item.label }}</text>
+            <text class="insight-item-score">{{ item.score }}分</text>
+            <text class="insight-item-tag tag-strong">强项</text>
+          </view>
+        </view>
+        <view class="insight-group" v-if="wealthImproves.length > 0">
+          <text class="insight-group-title">🌱 提升空间</text>
+          <view class="insight-item" v-for="(item, idx) in wealthImproves" :key="'i' + idx">
+            <text class="insight-item-name">{{ item.label }}</text>
+            <text class="insight-item-score">{{ item.score }}分</text>
+            <text class="insight-item-tag tag-improve">待提升</text>
+          </view>
+        </view>
+        <view class="insight-tip" v-if="wealthStrengths.length > 0 && wealthImproves.length > 0">
+          <text class="insight-tip-text">保持优势项,薄弱项可通过参与活动与任务逐步积累</text>
+        </view>
+      </view>
+
       <!-- 财富数据卡(家长) -->
       <!-- 财富数据卡(家长) -->
       <view class="section" v-if="role === 'parent'">
       <view class="section" v-if="role === 'parent'">
         <view class="disc-card">
         <view class="disc-card">
@@ -296,6 +322,26 @@ export default {
       if (s >= 70) return '🎉 已是富足达人,继续引领全家成长!'
       if (s >= 70) return '🎉 已是富足达人,继续引领全家成长!'
       if (s >= 30) return '💡 坚持分享,下一阶段"奔涌"在望'
       if (s >= 30) return '💡 坚持分享,下一阶段"奔涌"在望'
       return '🌱 从今天开始,迈出创富第一步'
       return '🌱 从今天开始,迈出创富第一步'
+    },
+    /** 财富强项:wealthSubDims 中得分 ≥75 的维度 */
+    wealthStrengths() {
+      var result = []
+      for (var i = 0; i < this.wealthSubDims.length; i++) {
+        var d = this.wealthSubDims[i]
+        var s = Number(d.score)
+        if (s >= 75) result.push({ label: d.label, score: s })
+      }
+      return result
+    },
+    /** 财富提升空间:wealthSubDims 中 0<得分<60 的维度 */
+    wealthImproves() {
+      var result = []
+      for (var i = 0; i < this.wealthSubDims.length; i++) {
+        var d = this.wealthSubDims[i]
+        var s = Number(d.score)
+        if (s > 0 && s < 60) result.push({ label: d.label, score: s })
+      }
+      return result
     }
     }
   },
   },
   onShow() {
   onShow() {
@@ -1021,6 +1067,64 @@ export default {
 }
 }
 .insurance-item-label { font-size: 22rpx; color: #999; }
 .insurance-item-label { font-size: 22rpx; color: #999; }
 .insurance-item-value { font-size: 22rpx; color: #666; }
 .insurance-item-value { font-size: 22rpx; color: #666; }
+
+/* ===== 财富强项与提升卡片 ===== */
+.wealth-insight {
+  background: #fff;
+  border-radius: 20rpx;
+  padding: 24rpx;
+}
+.insight-group {
+  margin-bottom: 16rpx;
+}
+.insight-group-title {
+  font-size: 26rpx;
+  font-weight: 600;
+  color: #333;
+  margin-bottom: 10rpx;
+  display: block;
+}
+.insight-item {
+  display: flex;
+  align-items: center;
+  padding: 12rpx 16rpx;
+  background: #FFFBEB;
+  border-radius: 12rpx;
+  margin-bottom: 8rpx;
+}
+.insight-item-name {
+  flex: 1;
+  font-size: 26rpx;
+  color: #333;
+}
+.insight-item-score {
+  font-size: 24rpx;
+  color: #666;
+  margin-right: 12rpx;
+}
+.insight-item-tag {
+  font-size: 20rpx;
+  padding: 4rpx 16rpx;
+  border-radius: 8rpx;
+  font-weight: 500;
+}
+.insight-item-tag.tag-strong {
+  background: #D1FAE5;
+  color: #059669;
+}
+.insight-item-tag.tag-improve {
+  background: #FEF3C7;
+  color: #D97706;
+}
+.insight-tip {
+  padding: 12rpx 16rpx;
+  background: #FFFBEB;
+  border-radius: 12rpx;
+}
+.insight-tip-text {
+  font-size: 22rpx;
+  color: #F59E0B;
+}
 </style>
 </style>
 
 
 /* 月度引导语 */
 /* 月度引导语 */

+ 147 - 0
cfc-frontend/pages/wisdom-detail/index.vue

@@ -63,6 +63,38 @@
       <text class="explain-text">{{ (dualDimension.primary && dualDimension.primary.score || 0) >= 80 ? '学习能力良好,继续保持学习节奏。' : (dualDimension.primary && dualDimension.primary.score || 0) >= 60 ? '学习能力一般,建议多做认知训练。' : '学习能力需要提升,建议进行专业评估。' }}</text>
       <text class="explain-text">{{ (dualDimension.primary && dualDimension.primary.score || 0) >= 80 ? '学习能力良好,继续保持学习节奏。' : (dualDimension.primary && dualDimension.primary.score || 0) >= 60 ? '学习能力一般,建议多做认知训练。' : '学习能力需要提升,建议进行专业评估。' }}</text>
     </view>
     </view>
 
 
+    <!-- ===== 认知强项与提升空间 ===== -->
+    <view class="section cognitive-insight" v-if="isLoggedIn && cognitiveReport">
+      <view class="section-header">
+        <text class="section-title">📈 认知强项与提升</text>
+      </view>
+      <template v-if="cogStrengths.length > 0 || cogImproves.length > 0">
+        <view class="insight-group" v-if="cogStrengths.length > 0">
+          <text class="insight-group-title">💪 你的强项</text>
+          <view class="insight-item" v-for="(item, idx) in cogStrengths" :key="'s' + idx">
+            <text class="insight-item-name">{{ item.label }}</text>
+            <text class="insight-item-score">{{ item.score }}分</text>
+            <text class="insight-item-tag tag-strong">强项</text>
+          </view>
+        </view>
+        <view class="insight-group" v-if="cogImproves.length > 0">
+          <text class="insight-group-title">🌱 提升空间</text>
+          <view class="insight-item" v-for="(item, idx) in cogImproves" :key="'i' + idx">
+            <text class="insight-item-name">{{ item.label }}</text>
+            <text class="insight-item-score">{{ item.score }}分</text>
+            <text class="insight-item-tag tag-improve">待提升</text>
+          </view>
+        </view>
+        <view class="insight-tip" v-if="cogStrengths.length > 0 && cogImproves.length > 0">
+          <text class="insight-tip-text">强项保持,薄弱维建议通过训练中心针对性提升</text>
+        </view>
+      </template>
+      <view class="insight-empty" v-else-if="!cognitiveReport || !hasCognitiveScore">
+        <text class="insight-empty-text">完成认知测评,查看强项与提升建议</text>
+        <button class="insight-btn" @click="goCognitiveReport">去测评</button>
+      </view>
+    </view>
+
     <!-- ===== DAN 报告(登录后) ===== -->
     <!-- ===== DAN 报告(登录后) ===== -->
     <view class="section" v-if="isLoggedIn">
     <view class="section" v-if="isLoggedIn">
       <view class="section-header">
       <view class="section-header">
@@ -245,6 +277,46 @@ export default {
       }
       }
       return scores
       return scores
     },
     },
+    /** 认知测评是否已有有效得分(任一维度 > 0) */
+    hasCognitiveScore: function() {
+      if (!this.cognitiveReport) return false
+      var dims = this.cognitiveDimensions
+      for (var i = 0; i < dims.length; i++) {
+        var key = dims[i].key
+        var v = 0
+        if (key === 'wisdomGrowthMindset') {
+          v = this.cognitiveScores[this.cognitiveDimensions.length - 1] || 0
+        } else {
+          v = this.cognitiveReport[key] || 0
+        }
+        if (v > 0) return true
+      }
+      return false
+    },
+    /** 认知强项:得分 ≥75 的维度 */
+    cogStrengths: function() {
+      var dims = this.cognitiveDimensions
+      var result = []
+      for (var i = 0; i < dims.length; i++) {
+        var score = this.cognitiveScores[i] || 0
+        if (score >= 75) {
+          result.push({ label: dims[i].label, score: score })
+        }
+      }
+      return result
+    },
+    /** 认知提升空间:得分 <60 的维度 */
+    cogImproves: function() {
+      var dims = this.cognitiveDimensions
+      var result = []
+      for (var i = 0; i < dims.length; i++) {
+        var score = this.cognitiveScores[i] || 0
+        if (score > 0 && score < 60) {
+          result.push({ label: dims[i].label, score: score })
+        }
+      }
+      return result
+    },
     /** 每月引导语 */
     /** 每月引导语 */
     monthlyGuidance: function() {
     monthlyGuidance: function() {
       var month = new Date().getMonth()
       var month = new Date().getMonth()
@@ -874,4 +946,79 @@ export default {
   line-height: 1.6;
   line-height: 1.6;
   margin: 0;
   margin: 0;
 }
 }
+
+/* ===== 认知强项与提升卡片 ===== */
+.insight-group {
+  margin-bottom: 16rpx;
+}
+.insight-group-title {
+  font-size: 26rpx;
+  font-weight: 600;
+  color: #333;
+  margin-bottom: 10rpx;
+  display: block;
+}
+.insight-item {
+  display: flex;
+  align-items: center;
+  padding: 12rpx 16rpx;
+  background: #F8FAFF;
+  border-radius: 12rpx;
+  margin-bottom: 8rpx;
+}
+.insight-item-name {
+  flex: 1;
+  font-size: 26rpx;
+  color: #333;
+}
+.insight-item-score {
+  font-size: 24rpx;
+  color: #666;
+  margin-right: 12rpx;
+}
+.insight-item-tag {
+  font-size: 20rpx;
+  padding: 4rpx 16rpx;
+  border-radius: 8rpx;
+  font-weight: 500;
+}
+.insight-item-tag.tag-strong {
+  background: #D1FAE5;
+  color: #059669;
+}
+.insight-item-tag.tag-improve {
+  background: #FEF3C7;
+  color: #D97706;
+}
+.insight-tip {
+  padding: 12rpx 16rpx;
+  background: #EEF2FF;
+  border-radius: 12rpx;
+}
+.insight-tip-text {
+  font-size: 22rpx;
+  color: #6366F1;
+}
+.insight-empty {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 30rpx 0;
+}
+.insight-empty-text {
+  font-size: 24rpx;
+  color: #999;
+  margin-bottom: 20rpx;
+}
+.insight-btn {
+  background: linear-gradient(135deg, #6366F1, #818CF8);
+  color: #fff;
+  font-size: 26rpx;
+  font-weight: 600;
+  border: none;
+  border-radius: 40rpx;
+  padding: 14rpx 60rpx;
+  line-height: 1.6;
+  margin: 0;
+}
 </style>
 </style>