|
|
@@ -46,13 +46,34 @@
|
|
|
dimensionCode="wisdom"
|
|
|
:sandboxData="sandboxData"
|
|
|
:dualDimension="dualDimension" />
|
|
|
- <!-- 认知七维 -->
|
|
|
- <dimension-sub-dims
|
|
|
- v-if="isLoggedIn && wisdomSubDims.length > 0"
|
|
|
- title="⚡ 认知七维"
|
|
|
- subtitle="学习能力的七个核心方面"
|
|
|
- accent-color="#6366F1"
|
|
|
- :dims="wisdomSubDims" />
|
|
|
+ <!-- 认知指标卡片 -->
|
|
|
+ <view class="indicator-cards-section" v-if="isLoggedIn && wisdomIndicators.length > 0">
|
|
|
+ <view class="section-header">
|
|
|
+ <text class="section-title">⚡ 认知指标</text>
|
|
|
+ <text class="section-more" @click="goWisdomDetail">更多 ›</text>
|
|
|
+ </view>
|
|
|
+ <view class="indicator-cards">
|
|
|
+ <view
|
|
|
+ v-for="(ind, i) in wisdomIndicators"
|
|
|
+ :key="ind.code"
|
|
|
+ class="indicator-card"
|
|
|
+ :class="{ 'no-data': !ind.value }"
|
|
|
+ @click="goWisdomDetail()"
|
|
|
+ >
|
|
|
+ <view class="indicator-header">
|
|
|
+ <text class="indicator-name">{{ ind.name }}</text>
|
|
|
+ <text class="indicator-unit" v-if="ind.unit">{{ ind.unit }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="indicator-body">
|
|
|
+ <text class="indicator-value" v-if="ind.value || ind.numericValue !== null">{{ ind.value || formatNumeric(ind.numericValue) }}</text>
|
|
|
+ <text class="indicator-placeholder" v-else>暂无数据</text>
|
|
|
+ </view>
|
|
|
+ <view class="indicator-footer">
|
|
|
+ <text class="indicator-range" v-if="ind.refRange">参考: {{ ind.refRange }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
<!-- 学习解读 -->
|
|
|
<view class="section score-explain-card" v-if="isLoggedIn && currentView === 'self' && dualDimension">
|
|
|
@@ -187,16 +208,15 @@
|
|
|
import nav from '../../utils/nav'
|
|
|
import TabTransition from '../../components/tab-transition.vue'
|
|
|
import RadarChart from '../../components/RadarChart.vue'
|
|
|
-import DimensionSubDims from '../../components/DimensionSubDims.vue'
|
|
|
import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
|
|
|
import FloatingAvatar from '../../components/AIFloatingAvatar.vue'
|
|
|
import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
|
|
|
import DimensionIntroCard from '../../components/DimensionIntroCard.vue'
|
|
|
-import { getVisibleSections, getChildren, getFamilyEnergySandbox, getEnergySandbox, getAssessmentLatestResult, getDanReportByChild, getGutCognitionIndicators } from '../../utils/api.js'
|
|
|
+import { getVisibleSections, getChildren, getFamilyEnergySandbox, getEnergySandbox, getAssessmentLatestResult, getDanReportByChild, getGutCognitionIndicators, getLatestIndicators } from '../../utils/api.js'
|
|
|
import { parseDate } from '../../utils/format.js'
|
|
|
|
|
|
export default {
|
|
|
- components: { TabTransition, RadarChart, FamilyEnergyBar, DimensionSubDims, FloatingAvatar, FamilyMemberStrip, DimensionIntroCard },
|
|
|
+ components: { TabTransition, RadarChart, FamilyEnergyBar, FloatingAvatar, FamilyMemberStrip, DimensionIntroCard },
|
|
|
data() {
|
|
|
return {
|
|
|
isLoggedIn: false,
|
|
|
@@ -209,6 +229,7 @@ export default {
|
|
|
familyMembersVisible: [],
|
|
|
selectedMemberId: null,
|
|
|
wisdomSubDims: [],
|
|
|
+ wisdomIndicators: [],
|
|
|
sandboxData: null,
|
|
|
currentView: 'self', // 'self' | 'family'
|
|
|
dualDimension: null,
|
|
|
@@ -410,6 +431,23 @@ export default {
|
|
|
}
|
|
|
}).catch(function(e) {})
|
|
|
},
|
|
|
+ loadWisdomIndicators: function(memberId) {
|
|
|
+ var self = this
|
|
|
+ getLatestIndicators({ memberId: memberId, domain: 'wisdom' }).then(function(res) {
|
|
|
+ if (res.code === 200) self.wisdomIndicators = res.data || []
|
|
|
+ }).catch(function(e) { console.log('[wisdom] loadWisdomIndicators failed', e) })
|
|
|
+ },
|
|
|
+ goWisdomDetail: function() {
|
|
|
+ var id = this.activeChildId || uni.getStorageSync('currentChildId')
|
|
|
+ if (!id) return
|
|
|
+ uni.navigateTo({ url: '/pages/wisdom/member-wisdom-detail?memberId=' + id })
|
|
|
+ },
|
|
|
+ formatNumeric: function(v) {
|
|
|
+ if (v === null || v === undefined) return ''
|
|
|
+ var n = parseFloat(v)
|
|
|
+ if (isNaN(n)) return String(v)
|
|
|
+ return n % 1 === 0 ? String(n) : n.toFixed(1)
|
|
|
+ },
|
|
|
loadFamilyMembersVisible: function() {
|
|
|
var self = this
|
|
|
getFamilyEnergySandbox().then(function(res) {
|
|
|
@@ -430,6 +468,7 @@ export default {
|
|
|
if (res.code === 200 && res.data) {
|
|
|
self.cognitiveReport = res.data
|
|
|
self.wisdomSubDims = (function() { var r = self.cognitiveReport || {}; return [{label:'感知能力', score:r.perceptionScore||0, desc:'通过感官获取信息'}, {label:'专注力', score:r.focusScore||0, desc:'保持注意力集中'}, {label:'记忆力', score:r.memoryScore||0, desc:'记忆和回忆信息'}, {label:'逻辑思维', score:r.logicScore||0, desc:'分析和推理能力'}, {label:'空间思维', score:r.spatialScore||0, desc:'操作空间关系'}, {label:'加工速度', score:r.processingSpeedScore||0, desc:'快速处理信息'}, {label:'成长型思维', score:r.growthMindset||0, desc:'相信能力可提升'}]; })();
|
|
|
+ self.loadWisdomIndicators(memberId)
|
|
|
}
|
|
|
}).catch(function(e) {})
|
|
|
},
|
|
|
@@ -762,11 +801,20 @@ export default {
|
|
|
}
|
|
|
|
|
|
/* ===== 底部占位 ===== */
|
|
|
-.bottom-spacer {
|
|
|
- height: 120rpx;
|
|
|
-}
|
|
|
+.indicator-cards-section { margin: 20rpx 30rpx; }
|
|
|
+.indicator-cards { display: flex; flex-direction: row; flex-wrap: wrap; gap: 16rpx; }
|
|
|
+.indicator-card { width: calc(50% - 8rpx); background: #fff; border-radius: 20rpx; padding: 24rpx 20rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06); }
|
|
|
+.indicator-card.no-data { opacity: 0.5; }
|
|
|
+.indicator-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12rpx; }
|
|
|
+.indicator-name { font-size: 26rpx; color: #666; font-weight: 500; }
|
|
|
+.indicator-unit { font-size: 22rpx; color: #999; }
|
|
|
+.indicator-body { margin-bottom: 8rpx; }
|
|
|
+.indicator-value { font-size: 40rpx; font-weight: bold; color: #6366F1; }
|
|
|
+.indicator-placeholder { font-size: 26rpx; color: #ccc; }
|
|
|
+.indicator-range { font-size: 20rpx; color: #bbb; }
|
|
|
+.bottom-spacer { height: 120rpx; }
|
|
|
|
|
|
-/* DAN 报告卡片 */
|
|
|
+/* DAN 报告卡片
|
|
|
.dan-card {
|
|
|
background: #fff;
|
|
|
border-radius: 16rpx;
|