|
@@ -78,25 +78,33 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <!-- 肠脑轴情绪卡片 -->
|
|
|
|
|
- <view class="section" v-if="gutIndicators && gutIndicators.length > 0">
|
|
|
|
|
|
|
+ <!-- 肠脑轴情绪卡片(有菌群报告显示指标,无报告引导上传) -->
|
|
|
|
|
+ <view class="section gut-card" v-if="isLoggedIn">
|
|
|
<view class="section-header">
|
|
<view class="section-header">
|
|
|
<text class="section-title">🌱 情绪与肠胃</text>
|
|
<text class="section-title">🌱 情绪与肠胃</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="gut-insight-text" v-if="gutInsight">
|
|
|
|
|
- <text>{{ gutInsight }}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="gut-indicator-list">
|
|
|
|
|
- <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>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="gut-indicator-bar-track">
|
|
|
|
|
- <view class="gut-indicator-bar-fill" :style="{ width: (ind.value || 0) + '%', background: indicatorColor(ind.status) }"></view>
|
|
|
|
|
|
|
+ <text class="gut-card-subtitle">心生身 · 情绪状态,透过肠道菌群看见</text>
|
|
|
|
|
+ <template v-if="gutIndicators && gutIndicators.length > 0">
|
|
|
|
|
+ <view class="gut-insight-text" v-if="gutInsight">
|
|
|
|
|
+ <text>{{ gutInsight }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="gut-indicator-list">
|
|
|
|
|
+ <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>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="gut-indicator-bar-track">
|
|
|
|
|
+ <view class="gut-indicator-bar-fill" :style="{ width: (ind.value || 0) + '%', background: indicatorColor(ind.status) }"></view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="gut-indicator-value">{{ ind.value }}{{ ind.unit || '%' }}</text>
|
|
|
|
|
+ <text :class="['gut-indicator-status', 'status-' + (ind.status || 'normal')]">{{ statusLabel(ind.status) }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <text class="gut-indicator-value">{{ ind.value }}{{ ind.unit || '%' }}</text>
|
|
|
|
|
- <text :class="['gut-indicator-status', 'status-' + (ind.status || 'normal')]">{{ statusLabel(ind.status) }}</text>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <view class="gut-empty" v-else>
|
|
|
|
|
+ <text class="gut-empty-icon">📄</text>
|
|
|
|
|
+ <text class="gut-empty-text">上传菌群报告,查看情绪相关指标</text>
|
|
|
|
|
+ <button class="gut-upload-btn" @click="goReportUpload">去上传</button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -166,7 +174,7 @@ import PsychCrisisBanner from '../../components/PsychCrisisBanner.vue'
|
|
|
import FloatingAvatar from '../../components/AIFloatingAvatar.vue'
|
|
import FloatingAvatar from '../../components/AIFloatingAvatar.vue'
|
|
|
import FamilyTianpanCard from '../../components/FamilyTianpanCard.vue'
|
|
import FamilyTianpanCard from '../../components/FamilyTianpanCard.vue'
|
|
|
import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
|
|
import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
|
|
|
-import { getVisibleSections, getEmiReport, getFamilyEnergySandbox, getEnergySandbox, getChildren, getFamilyMemberList, getEnergyOverview, getContactList, getHealthAlerts, getMilestones, getDanReportByChild, getFamilyFortune } from '../../utils/api.js'
|
|
|
|
|
|
|
+import { getVisibleSections, getEmiReport, getFamilyEnergySandbox, getEnergySandbox, getChildren, getFamilyMemberList, getEnergyOverview, getContactList, getHealthAlerts, getMilestones, getDanReportByChild, getFamilyFortune, getEmotionIndicators } from '../../utils/api.js'
|
|
|
import nav from '../../utils/nav.js'
|
|
import nav from '../../utils/nav.js'
|
|
|
import config from '../../config.js'
|
|
import config from '../../config.js'
|
|
|
import { parseDate } from '../../utils/format.js'
|
|
import { parseDate } from '../../utils/format.js'
|
|
@@ -625,20 +633,17 @@ var descList = descMap[this.dominantElement] || descMap.wood
|
|
|
var memberId = self.currentChildId
|
|
var memberId = self.currentChildId
|
|
|
if (!memberId) return
|
|
if (!memberId) return
|
|
|
var token = uni.getStorageSync('token')
|
|
var token = uni.getStorageSync('token')
|
|
|
- // 获取神经递质指标
|
|
|
|
|
- uni.request({
|
|
|
|
|
- url: config.API_BASE_URL + '/api/mind/neurotransmitters',
|
|
|
|
|
- method: 'POST',
|
|
|
|
|
- header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
|
|
|
|
|
- data: { memberId: memberId },
|
|
|
|
|
- success: function(r) {
|
|
|
|
|
- if (r.statusCode === 200 && r.data && r.data.code === 200) {
|
|
|
|
|
- var list = r.data.data
|
|
|
|
|
- if (Array.isArray(list) && list.length > 0) {
|
|
|
|
|
- self.gutIndicators = list.slice(0, 4)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ getEmotionIndicators(memberId).then(function(res) {
|
|
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
|
|
+ var list = res.data
|
|
|
|
|
+ if (Array.isArray(list) && list.length > 0) {
|
|
|
|
|
+ self.gutIndicators = list.slice(0, 6)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.gutIndicators = []
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }).catch(function() {
|
|
|
|
|
+ self.gutIndicators = []
|
|
|
})
|
|
})
|
|
|
// 获取情绪洞察摘要
|
|
// 获取情绪洞察摘要
|
|
|
uni.request({
|
|
uni.request({
|
|
@@ -906,6 +911,9 @@ var descList = descMap[this.dominantElement] || descMap.wood
|
|
|
goDanUpload: function(dimension) {
|
|
goDanUpload: function(dimension) {
|
|
|
uni.navigateTo({ url: '/pages/dan-assessment/report-upload' })
|
|
uni.navigateTo({ url: '/pages/dan-assessment/report-upload' })
|
|
|
},
|
|
},
|
|
|
|
|
+ goReportUpload: function() {
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/health/report-upload' })
|
|
|
|
|
+ },
|
|
|
viewDanReport: function(report) {
|
|
viewDanReport: function(report) {
|
|
|
var reportId = report.sourceReportId || report.id
|
|
var reportId = report.sourceReportId || report.id
|
|
|
uni.navigateTo({ url: '/pages/health/report-detail?reportType=dan&reportId=' + reportId })
|
|
uni.navigateTo({ url: '/pages/health/report-detail?reportType=dan&reportId=' + reportId })
|
|
@@ -1955,6 +1963,40 @@ var descList = descMap[this.dominantElement] || descMap.wood
|
|
|
color: #D97706;
|
|
color: #D97706;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* ===== 肠脑轴卡片 - 新生身副标题/空态引导 ===== */
|
|
|
|
|
+.gut-card-subtitle {
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ color: #FF6B9D;
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+}
|
|
|
|
|
+.gut-empty {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 40rpx 0;
|
|
|
|
|
+}
|
|
|
|
|
+.gut-empty-icon {
|
|
|
|
|
+ font-size: 56rpx;
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.gut-empty-text {
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
|
+ color: #999;
|
|
|
|
|
+ margin-bottom: 24rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.gut-upload-btn {
|
|
|
|
|
+ background: linear-gradient(135deg, #FF6B9D, #FF9EC4);
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ border-radius: 40rpx;
|
|
|
|
|
+ padding: 16rpx 64rpx;
|
|
|
|
|
+ line-height: 1.6;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/* ===== 关键信息(家庭+个人) ===== */
|
|
/* ===== 关键信息(家庭+个人) ===== */
|
|
|
.key-info-card {
|
|
.key-info-card {
|
|
|
background: #fff;
|
|
background: #fff;
|