|
|
@@ -236,10 +236,14 @@
|
|
|
</view>
|
|
|
<view v-if="reports.length > 0">
|
|
|
<view class="report-card" v-for="(report, idx) in reports.slice(0, 3)" :key="idx" @click="goReportDetail(report)">
|
|
|
- <text class="report-icon">📄</text>
|
|
|
+ <view class="report-type-badge" :class="'badge-' + _reportTypeClass(report.reportType)">{{ _reportTypeLabel(report.reportType) }}</view>
|
|
|
<view class="report-info">
|
|
|
- <text class="report-name">{{ report.title || '健康报告' }}</text>
|
|
|
- <text class="report-status">{{ report.status === 'resolved' ? '已解析' : '待确认' }}</text>
|
|
|
+ <text class="report-name">{{ report.childName || report.personName || '健康报告' }}</text>
|
|
|
+ <text class="report-meta">{{ report.reportDate || '' }}{{ report.gutType ? ' · ' + report.gutType : '' }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="report-score-wrap">
|
|
|
+ <text v-if="report.overallScore != null" class="report-score">{{ report.overallScore }}</text>
|
|
|
+ <text class="report-status" :class="'status-' + _statusClass(report.status)">{{ report.status === 'resolved' ? '已解析' : '待确认' }}</text>
|
|
|
</view>
|
|
|
<text class="report-arrow">›</text>
|
|
|
</view>
|
|
|
@@ -373,7 +377,21 @@ export default {
|
|
|
uni.navigateTo({ url: url })
|
|
|
},
|
|
|
goReportDetail: function(report) {
|
|
|
- uni.navigateTo({ url: '/pages/health/report-list' + (report && report.id ? '?reportId=' + report.id : '') })
|
|
|
+ if (!report || !report.id) return
|
|
|
+ var type = report.reportType || 'gut_flora'
|
|
|
+ var url = '/pages/health/report-detail?reportType=' + type + '&reportId=' + report.id
|
|
|
+ uni.navigateTo({ url: url })
|
|
|
+ },
|
|
|
+ _reportTypeLabel: function(type) {
|
|
|
+ var map = { gut_flora: '肠道', physical_exam: '体检', tongue: '舌诊', blood: '血液' }
|
|
|
+ return map[type] || '健康报告'
|
|
|
+ },
|
|
|
+ _reportTypeClass: function(type) {
|
|
|
+ var map = { gut_flora: 'gut', physical_exam: 'exam', tongue: 'tongue', blood: 'blood' }
|
|
|
+ return map[type] || 'default'
|
|
|
+ },
|
|
|
+ _statusClass: function(status) {
|
|
|
+ return status === 'resolved' ? 'resolved' : 'pending'
|
|
|
},
|
|
|
goSelfTest: function() { uni.navigateTo({ url: '/pages/health/survey-questionnaire?dim=all' }) },
|
|
|
goAiQuestionnaire: function() { uni.navigateTo({ url: '/pages/health/ai-questionnaire' }) },
|
|
|
@@ -463,10 +481,20 @@ export default {
|
|
|
.section-title { font-size: 28rpx; font-weight: bold; color: #333; }
|
|
|
.section-more { font-size: 24rpx; color: #F97316; }
|
|
|
.report-card { display: flex; align-items: center; background: #fff; border-radius: 16rpx; padding: 16rpx 20rpx; margin-bottom: 10rpx; }
|
|
|
-.report-icon { font-size: 32rpx; margin-right: 16rpx; }
|
|
|
-.report-info { flex: 1; }
|
|
|
-.report-name { font-size: 24rpx; color: #333; display: block; margin-bottom: 4rpx; }
|
|
|
-.report-status { font-size: 20rpx; color: #999; }
|
|
|
+.report-type-badge { font-size: 20rpx; padding: 4rpx 12rpx; border-radius: 8rpx; margin-right: 12rpx; flex-shrink: 0; font-weight: 600; }
|
|
|
+.report-type-badge.badge-gut { background: rgba(249,115,22,0.12); color: #F97316; }
|
|
|
+.report-type-badge.badge-exam { background: rgba(99,102,241,0.12); color: #6366F1; }
|
|
|
+.report-type-badge.badge-tongue { background: rgba(16,185,129,0.12); color: #10B981; }
|
|
|
+.report-type-badge.badge-blood { background: rgba(239,68,68,0.12); color: #EF4444; }
|
|
|
+.report-type-badge.badge-default { background: rgba(107,114,128,0.12); color: #6B7280; }
|
|
|
+.report-info { flex: 1; min-width: 0; }
|
|
|
+.report-name { font-size: 26rpx; color: #333; font-weight: 600; display: block; margin-bottom: 4rpx; }
|
|
|
+.report-meta { font-size: 20rpx; color: #999; display: block; }
|
|
|
+.report-score-wrap { display: flex; flex-direction: column; align-items: flex-end; margin-right: 8rpx; flex-shrink: 0; }
|
|
|
+.report-score { font-size: 32rpx; font-weight: bold; color: #F97316; line-height: 1; }
|
|
|
+.report-status { font-size: 20rpx; margin-top: 4rpx; }
|
|
|
+.report-status.status-resolved { color: #10B981; }
|
|
|
+.report-status.status-pending { color: #F59E0B; }
|
|
|
.report-arrow { font-size: 28rpx; color: #ccc; }
|
|
|
.empty-hint { text-align: center; padding: 30rpx 0; background: #fff; border-radius: 16rpx; }
|
|
|
.empty-hint .empty-text { font-size: 26rpx; color: #999; display: block; }
|