|
|
@@ -23,37 +23,32 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 评分圆环 -->
|
|
|
- <scroll-view class="scores-scroll" scroll-x>
|
|
|
+ <!-- 评分圆环(折行显示,无横向滚动) -->
|
|
|
+ <view class="scores-wrap">
|
|
|
<view class="score-item" v-for="(score, idx) in scoreItems" :key="idx">
|
|
|
<view class="score-ring" :style="'border-color: ' + score.color + '; color: ' + score.color">
|
|
|
<text class="score-val">{{ score.value }}</text>
|
|
|
</view>
|
|
|
<text class="score-label">{{ score.label }}</text>
|
|
|
</view>
|
|
|
- </scroll-view>
|
|
|
+ </view>
|
|
|
|
|
|
<!-- 快速跳转 -->
|
|
|
<view class="quick-nav">
|
|
|
<view class="nav-card" @tap="goToSpecies">
|
|
|
<text class="nav-icon">🦠</text>
|
|
|
<text class="nav-label">菌群详情</text>
|
|
|
- <text class="nav-count">{{ floraCount }}种</text>
|
|
|
+ <text class="nav-count">{{ floraAbnormalCount }}/{{ floraCount }}种</text>
|
|
|
</view>
|
|
|
<view class="nav-card" @tap="goToPathogen">
|
|
|
<text class="nav-icon">🔬</text>
|
|
|
<text class="nav-label">病原菌</text>
|
|
|
<text class="nav-count">{{ pathogenCount }}项</text>
|
|
|
</view>
|
|
|
- <view class="nav-card" @tap="goToTaxonomy">
|
|
|
- <text class="nav-icon">📊</text>
|
|
|
- <text class="nav-label">菌群层级</text>
|
|
|
- <text class="nav-count">5级</text>
|
|
|
- </view>
|
|
|
<view class="nav-card" @tap="goToRisks">
|
|
|
<text class="nav-icon">⚠️</text>
|
|
|
<text class="nav-label">疾病风险</text>
|
|
|
- <text class="nav-count">{{ riskCount }}项</text>
|
|
|
+ <text class="nav-count">{{ riskAttentionCount }}/{{ riskCount }}项</text>
|
|
|
</view>
|
|
|
<view class="nav-card" @tap="goToFoods">
|
|
|
<text class="nav-icon">🍽️</text>
|
|
|
@@ -65,11 +60,6 @@
|
|
|
<text class="nav-label">食材戒备</text>
|
|
|
<text class="nav-count caution-count">{{ cautionCount }}项</text>
|
|
|
</view>
|
|
|
- <view class="nav-card" @tap="goToIndicators">
|
|
|
- <text class="nav-icon">📋</text>
|
|
|
- <text class="nav-label">全部指标</text>
|
|
|
- <text class="nav-count">{{ indicatorCount }}项</text>
|
|
|
- </view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 菌群功能分析 -->
|
|
|
@@ -238,7 +228,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getReportDetail, editHealthReport, queryKnowledgeBase, queryIndicatorKnowledge, getGutFloraAnalysis, confirmReportPreview, discardReportDraft, parseReportDraft } from '../../utils/api.js'
|
|
|
+import { getReportDetail, editHealthReport, queryKnowledgeBase, queryIndicatorKnowledge, getGutFloraAnalysis, confirmReportPreview, discardReportDraft, parseReportDraft, getHealthFoods, getFoodCautionList } from '../../utils/api.js'
|
|
|
import HealthKnowledgePopup from '../../components/health-knowledge-popup.vue'
|
|
|
import FeedbackPopup from '../../components/feedback-popup.vue'
|
|
|
|
|
|
@@ -267,7 +257,9 @@ export default {
|
|
|
gutIndicators: [],
|
|
|
nutritionGroups: [],
|
|
|
floraCount: 0,
|
|
|
+ floraAbnormalCount: 0,
|
|
|
riskCount: 0,
|
|
|
+ riskAttentionCount: 0,
|
|
|
foodCount: 0,
|
|
|
cautionCount: 0,
|
|
|
indicatorCount: 0,
|
|
|
@@ -316,8 +308,24 @@ export default {
|
|
|
self.buildScores(res.data)
|
|
|
self.buildIndicators(res.data)
|
|
|
self.floraCount = (res.data.gutFlora || []).length
|
|
|
+ // 菌群详情:统计异常/需关注的数量(状态非"正常"即视为需关注)
|
|
|
+ var flora = res.data.gutFlora || []
|
|
|
+ self.floraAbnormalCount = flora.filter(function(i) {
|
|
|
+ return i.status && i.status !== '正常'
|
|
|
+ }).length
|
|
|
self.riskCount = (res.data.diseaseRisks || []).length
|
|
|
- self.foodCount = (res.data.foods || []).length
|
|
|
+ // 疾病风险:统计需关注的数量(风险等级非"低风险"即视为需关注)
|
|
|
+ var risks = res.data.diseaseRisks || []
|
|
|
+ self.riskAttentionCount = risks.filter(function(r) {
|
|
|
+ return r.riskLevel && r.riskLevel !== '低风险'
|
|
|
+ }).length
|
|
|
+ // 饮食推荐:共用 /api/health/foods 接口获取数量
|
|
|
+ self.foodCount = 0
|
|
|
+ getHealthFoods(self.reportId).then(function(foodRes) {
|
|
|
+ if (foodRes && foodRes.code === 200 && foodRes.data) {
|
|
|
+ self.foodCount = (Array.isArray(foodRes.data) ? foodRes.data : []).length
|
|
|
+ }
|
|
|
+ }).catch(function() {})
|
|
|
// 异步加载戒备食材数量
|
|
|
var userId = uni.getStorageSync('userId')
|
|
|
if (userId) {
|
|
|
@@ -651,8 +659,8 @@ export default {
|
|
|
.badge-row { display: flex; gap: 16rpx; margin-top: 12rpx; }
|
|
|
.badge { padding: 6rpx 20rpx; background: rgba(255,255,255,0.2); border-radius: 20rpx; font-size: 22rpx; }
|
|
|
|
|
|
-.scores-scroll { padding: 20rpx 0; white-space: nowrap; background: #fff; }
|
|
|
-.score-item { display: inline-flex; flex-direction: column; align-items: center; margin: 0 20rpx; }
|
|
|
+.scores-wrap { display: flex; flex-wrap: wrap; padding: 20rpx 10rpx; background: #fff; }
|
|
|
+.score-item { display: flex; flex-direction: column; align-items: center; margin: 12rpx 10rpx; width: calc(25% - 20rpx); }
|
|
|
.score-ring { width: 100rpx; height: 100rpx; border-radius: 50%; border: 6rpx solid; display: flex; align-items: center; justify-content: center; font-size: 32rpx; font-weight: 700; margin-bottom: 8rpx; }
|
|
|
.score-label { font-size: 22rpx; color: #666; }
|
|
|
|