|
|
@@ -117,11 +117,12 @@
|
|
|
<view class="gut-indicator-item" v-for="ind in gutIndicators" :key="ind.id">
|
|
|
<view class="gut-indicator-left">
|
|
|
<text class="gut-indicator-name">{{ ind.indicatorName || ind.name }}</text>
|
|
|
+ <text class="gut-indicator-impact" v-if="emotionImpactLabel(ind.indicatorName || ind.name)">影响{{ emotionImpactLabel(ind.indicatorName || ind.name) }}</text>
|
|
|
</view>
|
|
|
<view class="gut-indicator-bar-track">
|
|
|
- <view class="gut-indicator-bar-fill" :style="{ width: (ind.value || 0) + '%', background: indicatorColor(ind.status) }"></view>
|
|
|
+ <view class="gut-indicator-bar-fill" :style="{ width: indicatorBarWidth(ind), background: indicatorColor(ind.status) }"></view>
|
|
|
</view>
|
|
|
- <text class="gut-indicator-value">{{ ind.value }}{{ ind.unit || '%' }}</text>
|
|
|
+ <text class="gut-indicator-value">{{ formatIndicatorValue(ind) }}{{ ind.unit || '%' }}</text>
|
|
|
<text :class="['gut-indicator-status', 'status-' + (ind.status || 'normal')]">{{ statusLabel(ind.status) }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -726,6 +727,35 @@ var descList = descMap[this.dominantElement] || descMap.wood
|
|
|
if (status === 'warning') return '警讯'
|
|
|
return status || '正常'
|
|
|
},
|
|
|
+ // 情绪影响映射:指标名 → 影响的情绪功能
|
|
|
+ emotionImpactLabel: function(name) {
|
|
|
+ if (!name) return ''
|
|
|
+ if (name.indexOf('血清素') !== -1 || name.indexOf('5-HT') !== -1) return '情绪稳定'
|
|
|
+ if (name.indexOf('多巴胺') !== -1 || name.indexOf('Dopamine') !== -1) return '愉悦·动力'
|
|
|
+ if (name.indexOf('GABA') !== -1 || name.indexOf('氨基丁酸') !== -1) return '放松·减压'
|
|
|
+ if (name.indexOf('色氨酸') !== -1 || name.indexOf('Tryptophan') !== -1) return '睡眠·情绪'
|
|
|
+ if (name.indexOf('褪黑素') !== -1 || name.indexOf('Melatonin') !== -1) return '睡眠调节'
|
|
|
+ if (name.indexOf('皮质醇') !== -1 || name.indexOf('Cortisol') !== -1) return '压力水平'
|
|
|
+ return ''
|
|
|
+ },
|
|
|
+ // 指标值展示:后端字段为 indicatorValue,兼容数值型
|
|
|
+ formatIndicatorValue: function(ind) {
|
|
|
+ if (!ind) return ''
|
|
|
+ var v = ind.value !== undefined && ind.value !== null ? ind.value : ind.indicatorValue
|
|
|
+ if (v === undefined || v === null || v === '') return ''
|
|
|
+ return String(v)
|
|
|
+ },
|
|
|
+ // 指标条宽度:将指标值归一化为 0-100% 百分比
|
|
|
+ indicatorBarWidth: function(ind) {
|
|
|
+ var raw = ind.value !== undefined && ind.value !== null ? ind.value : ind.indicatorValue
|
|
|
+ var n = parseFloat(raw)
|
|
|
+ if (!isNaN(n) && n >= 0 && n <= 100) return n + '%'
|
|
|
+ if (!isNaN(n) && n > 100) return '100%'
|
|
|
+ var st = ind.status || ''
|
|
|
+ if (st === '偏低' || st === '缺乏' || st === 'abnormal') return '30%'
|
|
|
+ if (st === '偏高' || st === '过高') return '75%'
|
|
|
+ return '55%'
|
|
|
+ },
|
|
|
|
|
|
// ===== EMI 分数评级 =====
|
|
|
getScoreLevel: function(score) {
|
|
|
@@ -1926,12 +1956,20 @@ var descList = descMap[this.dominantElement] || descMap.wood
|
|
|
gap: 12rpx;
|
|
|
}
|
|
|
.gut-indicator-left {
|
|
|
- width: 80rpx;
|
|
|
+ width: 110rpx;
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
.gut-indicator-name {
|
|
|
font-size: 22rpx;
|
|
|
color: #666;
|
|
|
+ font-weight: 500;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.gut-indicator-impact {
|
|
|
+ font-size: 18rpx;
|
|
|
+ color: #FF6B9D;
|
|
|
+ display: block;
|
|
|
+ margin-top: 2rpx;
|
|
|
}
|
|
|
.gut-indicator-bar-track {
|
|
|
flex: 1;
|