|
|
@@ -1,12 +1,6 @@
|
|
|
<template>
|
|
|
<view class="page">
|
|
|
- <view class="nav-bar">
|
|
|
- <view class="nav-back" @tap="goBack"><text class="back-text">‹ 返回</text></view>
|
|
|
- <text class="nav-title">{{ typeLabel }}</text>
|
|
|
- <view class="nav-edit" v-if="isGutFlora && hasRiskBlocks" @tap="toggleRiskEdit">
|
|
|
- <text>{{ isEditing ? '完成' : '编辑' }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <!-- native navigation bar used, no custom header -->
|
|
|
<scroll-view class="content" scroll-y>
|
|
|
<!-- 报告头 -->
|
|
|
<view class="report-head" v-if="headInfo">
|
|
|
@@ -16,153 +10,1709 @@
|
|
|
<text class="head-date">{{ headInfo.reportDateText || '' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- blocks 渲染 -->
|
|
|
- <report-blocks-renderer v-if="blocks && blocks.length > 0" :blocks="blocks" />
|
|
|
- <view class="empty-hint" v-else>暂无报告内容</view>
|
|
|
- <!-- 风险编辑面板 -->
|
|
|
- <view class="edit-panel" v-if="isEditing">
|
|
|
- <view class="edit-card" v-for="(risk, ei) in editRisks" :key="getEditRiskKey(ei)">
|
|
|
- <text class="edit-name">{{ risk.diseaseName }}</text>
|
|
|
- <view class="edit-row">
|
|
|
- <text class="edit-label">风险值:</text>
|
|
|
- <input class="edit-input" type="text" v-model="risk.riskValue" />
|
|
|
- <text class="edit-label">等级:</text>
|
|
|
- <picker :value="riskLevelIndex(risk.riskLevel)" :range="riskLevels" @change="onRiskLevelChange($event, risk)">
|
|
|
- <text class="edit-picker">{{ risk.riskLevel || '请选择' }}</text>
|
|
|
- </picker>
|
|
|
+
|
|
|
+ <!-- view mode -->
|
|
|
+ <view v-if="pageMode==='view'">
|
|
|
+ <report-blocks-renderer v-if="blocks && blocks.length > 0" :blocks="blocks" />
|
|
|
+ <view class="empty-hint" v-else>暂无报告内容</view>
|
|
|
+ <view class="edit-btn" v-if="isGutFlora && hasRiskBlocks && pageMode==='view'">
|
|
|
+ <view class="nav-edit" @tap="enterEditMode"><text>编辑</text></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- draft/edit mode (full form) -->
|
|
|
+ <view v-else>
|
|
|
+ <!-- 解析中状态(仅 draft 模式,从上传页跳转后自动解析) -->
|
|
|
+ <view class="parsing-banner" v-if="parsing">
|
|
|
+ <text class="parsing-icon">⏳</text>
|
|
|
+ <text class="parsing-text">正在解析报告,请稍候...</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="tip-banner">
|
|
|
+ <text class="tip-icon">✅</text>
|
|
|
+ <text class="tip-text">{{ pageMode === 'draft' ? '请核对以下解析内容,可修改后确认入库' : '请核对报告内容,可修改后保存' }}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 匹配可信度(仅 draft 模式) -->
|
|
|
+ <view class="confidence-card" v-if="confidenceLevelClass">
|
|
|
+ <view class="confidence-header">
|
|
|
+ <text class="confidence-label">匹配可信度</text>
|
|
|
+ <text class="confidence-badge" :class="'badge-' + confidenceLevelClass">{{ confidenceLevelText }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="confidence-bar-track">
|
|
|
+ <view class="confidence-bar-fill" :class="'fill-' + confidenceLevelClass" :style="'width:' + confidencePercent + '%'"></view>
|
|
|
+ </view>
|
|
|
+ <text class="confidence-desc">{{ confidenceDesc }}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="form-section">
|
|
|
+ <!-- 基本信息 -->
|
|
|
+ <view class="card">
|
|
|
+ <view class="card-title">基本信息</view>
|
|
|
+ <view class="field-row member-select-row" @click="toggleMemberPanel">
|
|
|
+ <text class="field-label">被检测人</text>
|
|
|
+ <text class="field-value" :class="{ 'binding-required': needBind && !selectedMemberObj }">{{ memberDisplayText }}</text>
|
|
|
+ <text class="member-select-arrow">{{ selectedMemberObj ? '修改 ›' : '选择 ›' }}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 被检测人选择面板(内联展开) -->
|
|
|
+ <view class="member-panel" v-if="showMemberPanel">
|
|
|
+ <!-- 候选匹配列表(按置信度排序) -->
|
|
|
+ <view class="candidate-section" v-if="candidates.length > 0">
|
|
|
+ <text class="candidate-section-hint">以下成员与报告信息匹配,请选择:</text>
|
|
|
+ <view
|
|
|
+ class="candidate-item"
|
|
|
+ v-for="(cand, idx) in candidates"
|
|
|
+ :key="idx"
|
|
|
+ :class="{ 'candidate-selected': selectedMemberId === (cand.id || cand.userId) }"
|
|
|
+ @click="selectAndClose(cand)"
|
|
|
+ >
|
|
|
+ <view class="candidate-left">
|
|
|
+ <text class="candidate-avatar">{{ (cand.nickname || cand.name || '?').substring(0, 1) }}</text>
|
|
|
+ <view class="candidate-info">
|
|
|
+ <text class="candidate-name">{{ cand.nickname || cand.name || '未知' }}</text>
|
|
|
+ <text class="candidate-detail" v-if="cand.gender || cand.age">{{ genderText(cand.gender) }}{{ cand.age ? ' · ' + cand.age + '岁' : '' }}</text>
|
|
|
+ <text class="candidate-fields" v-if="cand.matchFields">匹配: {{ cand.matchFields }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="candidate-right">
|
|
|
+ <view class="score-bar-track">
|
|
|
+ <view class="score-bar-fill" :style="'width:' + (cand.similarityScore * 100) + '%'"></view>
|
|
|
+ </view>
|
|
|
+ <text class="score-text">{{ Math.round(cand.similarityScore * 100) }}%</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 全量家庭成员列表(后备) -->
|
|
|
+ <view class="member-list" v-if="familyMembers.length > 0 && (candidates.length === 0 || !showCandidatesOnly)">
|
|
|
+ <view
|
|
|
+ class="member-item"
|
|
|
+ v-for="(member, mIdx) in familyMembers"
|
|
|
+ :key="mIdx"
|
|
|
+ :class="{ 'member-selected': selectedMemberId === (member.userId || member.id) }"
|
|
|
+ @click="selectAndClose(member)"
|
|
|
+ >
|
|
|
+ <text class="member-avatar">{{ (member.nickname || '?').substring(0, 1) }}</text>
|
|
|
+ <text class="member-name">{{ member.nickname || '未知' }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 新建成员入口 -->
|
|
|
+ <view class="create-member-entry" @click="toggleAutoCreate">
|
|
|
+ <text class="create-member-icon">+</text>
|
|
|
+ <text class="create-member-text">{{ showAutoCreateForm ? '收起新建表单' : '不在列表中?新建家庭成员' }}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 新建成员表单(面板内嵌) -->
|
|
|
+ <view class="auto-create-inline" v-if="showAutoCreateForm">
|
|
|
+ <view class="form-item">
|
|
|
+ <text class="form-item-label">姓名</text>
|
|
|
+ <input class="form-item-input" v-model="newMember.name" placeholder="请输入姓名" />
|
|
|
+ </view>
|
|
|
+ <view class="form-item">
|
|
|
+ <text class="form-item-label">性别</text>
|
|
|
+ <view class="gender-selector">
|
|
|
+ <text class="gender-option" :class="{ 'gender-selected': newMember.gender === 'male' }" @click="newMember.gender = 'male'">男</text>
|
|
|
+ <text class="gender-option" :class="{ 'gender-selected': newMember.gender === 'female' }" @click="newMember.gender = 'female'">女</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="form-item">
|
|
|
+ <text class="form-item-label">年龄</text>
|
|
|
+ <input class="form-item-input" type="number" v-model="newMember.age" placeholder="请输入年龄" />
|
|
|
+ </view>
|
|
|
+ <view class="btn-create-submit" :class="{ 'btn-disabled': creatingMember }" @click="doAutoCreate">
|
|
|
+ <text v-if="creatingMember">创建中...</text>
|
|
|
+ <text v-else>确认创建</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="field-row" v-if="extractedGender">
|
|
|
+ <text class="field-label">性别</text>
|
|
|
+ <text class="field-value">{{ extractedGender === 'male' ? '男' : extractedGender === 'female' ? '女' : extractedGender }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="field-row" v-if="extractedAge">
|
|
|
+ <text class="field-label">年龄</text>
|
|
|
+ <text class="field-value">{{ extractedAge }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="field-row" v-if="payload.summary && payload.type !== 'tongue'">
|
|
|
+ <text class="field-label">综合评分</text>
|
|
|
+ <input class="field-input" type="number" v-model="payload.summary.overallScore" />
|
|
|
+ </view>
|
|
|
+ <view class="field-row" v-if="payload.summary && payload.type !== 'tongue'">
|
|
|
+ <text class="field-label">报告日期</text>
|
|
|
+ <input class="field-input" type="text" v-model="payload.summary.reportDate" placeholder="如: 2025-06-15" />
|
|
|
+ </view>
|
|
|
+ <view class="field-row" v-if="payload.summary && payload.type !== 'tongue'">
|
|
|
+ <text class="field-label">报告摘要</text>
|
|
|
+ <textarea class="field-textarea" v-model="payload.summary.summary" maxlength="500" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 舌诊指标(只读展示) -->
|
|
|
+ <view class="card" v-if="payload.type === 'tongue' && payload.indicators && payload.indicators.length">
|
|
|
+ <view class="card-title">舌象指标</view>
|
|
|
+ <view class="tongue-indicator-grid">
|
|
|
+ <view class="tongue-ind-item" v-for="(ind, idx) in payload.indicators" :key="idx">
|
|
|
+ <text class="tongue-ind-label">{{ indicatorLabel(ind.code) }}</text>
|
|
|
+ <text class="tongue-ind-value">{{ ind.value }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="tongue-summary" v-if="payload.summary && payload.summary.overallAssessment">
|
|
|
+ <text class="tongue-summary-title">综合评估</text>
|
|
|
+ <text class="tongue-summary-text">{{ payload.summary.overallAssessment }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 健康指标(舌诊时隐藏,使用上方舌象指标卡片) -->
|
|
|
+ <view class="card" v-if="payload.type !== 'tongue' && payload.indicators && payload.indicators.length">
|
|
|
+ <view class="card-title">
|
|
|
+ <text>健康指标</text>
|
|
|
+ <text class="title-count">共 {{ payload.indicators.length }} 项</text>
|
|
|
+ <text class="title-abnormal" v-if="totalAbnormalCount > 0">,{{ totalAbnormalCount }} 项异常</text>
|
|
|
+ <view class="card-title-actions">
|
|
|
+ <text class="expand-all-btn" @click="toggleAllGroups(true)">全部展开</text>
|
|
|
+ <text class="expand-all-btn" @click="toggleAllGroups(false)">全部折叠</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 按指标类型分组折叠 -->
|
|
|
+ <view class="indicator-group" v-for="(group, gIdx) in indicatorGroups" :key="gIdx">
|
|
|
+ <view class="indicator-group-header" @click="toggleGroup(gIdx)">
|
|
|
+ <view class="indicator-group-header-left">
|
|
|
+ <text class="indicator-group-arrow" :class="{ 'arrow-open': groupExpandList[gIdx] }">›</text>
|
|
|
+ <text class="indicator-group-name">{{ group.category }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="indicator-group-header-right">
|
|
|
+ <text class="indicator-group-abnormal" v-if="group.abnormalCount > 0">{{ group.abnormalCount }} 项异常</text>
|
|
|
+ <text class="indicator-group-count">{{ group.items.length }} 项</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="indicator-group-body" v-if="groupExpandList[gIdx]">
|
|
|
+ <view class="indicator-item" v-for="(ind, idx) in group.items" :key="idx">
|
|
|
+ <view class="ind-header">
|
|
|
+ <text class="ind-help-btn" @click.stop="showHelp(ind)">?</text>
|
|
|
+ <input class="ind-name" :class="'ind-name-' + _cssClass(ind.status)" v-model="ind.indicatorName" />
|
|
|
+ <input class="ind-value" :class="'ind-value-' + _cssClass(ind.status)" v-model="ind.indicatorValue" />
|
|
|
+ </view>
|
|
|
+ <view class="ind-detail" v-if="ind.unit || ind.refRange">
|
|
|
+ <text class="ind-ref" v-if="ind.refRange">参考: {{ ind.refRange }}</text>
|
|
|
+ <text class="ind-unit" v-if="ind.unit">{{ ind.unit }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="ind-symptoms" v-if="ind.symptoms">
|
|
|
+ <text class="ind-symptom-label">症状:</text>
|
|
|
+ <input class="ind-symptom-input" v-model="ind.symptoms" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 肠道菌群 -->
|
|
|
+ <view class="card" v-if="payload.gutFlora && payload.gutFlora.length">
|
|
|
+ <view class="card-title">肠道菌群 ({{ payload.gutFlora.length }})</view>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.gutFlora" :key="idx">
|
|
|
+ <input class="flora-name" v-model="payload.gutFlora[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.gutFlora[idx].abundance" />
|
|
|
+ <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
|
|
|
+ {{ statusText(flora.status) }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 疾病风险 -->
|
|
|
+ <view class="card" v-if="payload.diseaseRisks && payload.diseaseRisks.length">
|
|
|
+ <view class="card-title">疾病风险 ({{ payload.diseaseRisks.length }})</view>
|
|
|
+ <view class="risk-item" v-for="(risk, idx) in payload.diseaseRisks" :key="idx">
|
|
|
+ <input class="risk-name" v-model="payload.diseaseRisks[idx].diseaseName" />
|
|
|
+ <view class="risk-level" :class="'risk-' + (risk.riskLevel || 'low')">
|
|
|
+ {{ riskLevelText(risk.riskLevel) }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 饮食推荐 -->
|
|
|
+ <view class="card" v-if="payload.foods && payload.foods.length">
|
|
|
+ <view class="card-title">饮食推荐 ({{ payload.foods.length }})</view>
|
|
|
+ <view class="food-item" v-for="(food, idx) in payload.foods" :key="idx">
|
|
|
+ <input class="food-name" v-model="payload.foods[idx].foodName" />
|
|
|
+ <input class="food-category" v-model="payload.foods[idx].category" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 益生菌种 -->
|
|
|
+ <view class="card" v-if="payload.probioticSpecies && payload.probioticSpecies.length">
|
|
|
+ <view class="card-title">益生菌种 ({{ payload.probioticSpecies.length }})</view>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.probioticSpecies" :key="idx">
|
|
|
+ <input class="flora-name" v-model="payload.probioticSpecies[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.probioticSpecies[idx].abundance" />
|
|
|
+ <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
|
|
|
+ {{ statusText(flora.status) }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- Taxonomy 分类(纲/目/科/属/种) -->
|
|
|
+ <view class="card" v-if="hasTaxonomyData()">
|
|
|
+ <view class="card-title">菌群分类组成 ({{ taxonomyTotalCount }})</view>
|
|
|
+ <view class="taxonomy-group" v-if="payload.taxonomyClass && payload.taxonomyClass.length">
|
|
|
+ <text class="taxonomy-group-label">菌纲 (Class)</text>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.taxonomyClass" :key="getTaxonomyKey('c', idx)">
|
|
|
+ <input class="flora-name" v-model="payload.taxonomyClass[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.taxonomyClass[idx].abundance" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="taxonomy-group" v-if="payload.taxonomyOrder && payload.taxonomyOrder.length">
|
|
|
+ <text class="taxonomy-group-label">菌目 (Order)</text>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.taxonomyOrder" :key="getTaxonomyKey('o', idx)">
|
|
|
+ <input class="flora-name" v-model="payload.taxonomyOrder[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.taxonomyOrder[idx].abundance" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="taxonomy-group" v-if="payload.taxonomyFamily && payload.taxonomyFamily.length">
|
|
|
+ <text class="taxonomy-group-label">菌科 (Family)</text>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.taxonomyFamily" :key="getTaxonomyKey('f', idx)">
|
|
|
+ <input class="flora-name" v-model="payload.taxonomyFamily[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.taxonomyFamily[idx].abundance" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="taxonomy-group" v-if="payload.taxonomyGenus && payload.taxonomyGenus.length">
|
|
|
+ <text class="taxonomy-group-label">菌属 (Genus)</text>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.taxonomyGenus" :key="getTaxonomyKey('g', idx)">
|
|
|
+ <input class="flora-name" v-model="payload.taxonomyGenus[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.taxonomyGenus[idx].abundance" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="taxonomy-group" v-if="payload.taxonomySpecies && payload.taxonomySpecies.length">
|
|
|
+ <text class="taxonomy-group-label">菌种 (Species)</text>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.taxonomySpecies" :key="getTaxonomyKey('s', idx)">
|
|
|
+ <input class="flora-name" v-model="payload.taxonomySpecies[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.taxonomySpecies[idx].abundance" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 病原菌 -->
|
|
|
+ <view class="card" v-if="hasPathogenData()">
|
|
|
+ <view class="card-title">病原菌 ({{ pathogenTotalCount }})</view>
|
|
|
+ <view class="pathogen-group" v-if="payload.pathogenGenus && payload.pathogenGenus.length">
|
|
|
+ <text class="pathogen-group-label">病原菌属</text>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.pathogenGenus" :key="getTaxonomyKey('pg', idx)">
|
|
|
+ <input class="flora-name" v-model="payload.pathogenGenus[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.pathogenGenus[idx].abundance" />
|
|
|
+ <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
|
|
|
+ {{ statusText(flora.status) }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="pathogen-group" v-if="payload.pathogenDetection && payload.pathogenDetection.length">
|
|
|
+ <text class="pathogen-group-label">病原菌检出</text>
|
|
|
+ <view class="flora-item" v-for="(flora, idx) in payload.pathogenDetection" :key="getTaxonomyKey('pd', idx)">
|
|
|
+ <input class="flora-name" v-model="payload.pathogenDetection[idx].name" />
|
|
|
+ <input class="flora-abundance" type="digit" v-model="payload.pathogenDetection[idx].abundance" />
|
|
|
+ <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
|
|
|
+ {{ statusText(flora.status) }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 操作按钮(draft: 放弃/确认入库; edit: 取消/保存) -->
|
|
|
+ <view class="action-row">
|
|
|
+ <view class="btn-discard" @click="handleLeftAction">
|
|
|
+ <text>{{ pageMode === 'draft' ? '放弃' : '取消' }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="btn-confirm" :class="{ 'btn-disabled': pageMode === 'draft' && !canConfirm }" @click="handleRightAction">
|
|
|
+ <text v-if="pageMode === 'draft' && confirming">确认中...</text>
|
|
|
+ <text v-else>{{ pageMode === 'draft' ? '确认入库' : '保存' }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="bottom-spacer"></view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
+
|
|
|
+ <!-- 指标帮助弹窗(置于 scroll-view 外,position:fixed 覆盖视口) -->
|
|
|
+ <view class="help-overlay" v-if="showHelpPopup" @click="closeHelp">
|
|
|
+ <view class="help-popup" @click.stop>
|
|
|
+ <view class="help-popup-header">
|
|
|
+ <text class="help-popup-title">{{ helpData.name }}</text>
|
|
|
+ <text class="help-popup-close" @click="closeHelp">✕</text>
|
|
|
+ </view>
|
|
|
+ <view class="help-popup-body">
|
|
|
+ <view class="help-row">
|
|
|
+ <text class="help-label">当前值</text>
|
|
|
+ <text class="help-value">{{ helpData.value }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="help-row" v-if="helpData.refRange">
|
|
|
+ <text class="help-label">参考范围</text>
|
|
|
+ <text class="help-value">{{ helpData.refRange }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="help-row">
|
|
|
+ <text class="help-label">状态</text>
|
|
|
+ <text class="help-value" :class="'help-status-' + _cssClass(helpData.status)">{{ statusText(helpData.status) }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="help-desc" v-if="helpData.description">
|
|
|
+ <text class="help-desc-label">说明</text>
|
|
|
+ <text class="help-desc-text">{{ helpData.description }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="help-desc" v-else>
|
|
|
+ <text class="help-desc-label">说明</text>
|
|
|
+ <text class="help-desc-text">{{ getDefaultDescription(helpData.name, helpData.status) }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import ReportBlocksRenderer from '../../components/report-blocks-renderer.vue'
|
|
|
-import { getReportDetail, getDanReportDetail, editHealthReport } from '../../utils/api.js'
|
|
|
+import { getReportDetail, getDanReportDetail, editHealthReport, parseReportDraft, confirmReportPreview, discardReportDraft, confirmTongue, discardTongue, getFamilyMembers, addFamilyMember } from '../../utils/api.js'
|
|
|
import { parseDate } from '../../utils/format.js'
|
|
|
|
|
|
export default {
|
|
|
- components: { ReportBlocksRenderer },
|
|
|
data() {
|
|
|
return {
|
|
|
- reportType: '',
|
|
|
+ reportType: 'gut_flora',
|
|
|
reportId: null,
|
|
|
+ draftId: null,
|
|
|
+ memberId: null,
|
|
|
+ familyId: null,
|
|
|
blocks: [],
|
|
|
headInfo: null,
|
|
|
- isEditing: false,
|
|
|
- editRisks: [],
|
|
|
- riskLevels: ['低风险', '需注意', '高风险', '异常']
|
|
|
+ pageMode: 'view', // view / draft / edit
|
|
|
+ parsing: false,
|
|
|
+ confirming: false,
|
|
|
+ payload: {
|
|
|
+ type: 'gut_flora',
|
|
|
+ summary: {},
|
|
|
+ indicators: [],
|
|
|
+ gutFlora: [],
|
|
|
+ diseaseRisks: [],
|
|
|
+ foods: [],
|
|
|
+ probioticSpecies: [],
|
|
|
+ taxonomyClass: [],
|
|
|
+ taxonomyOrder: [],
|
|
|
+ taxonomyFamily: [],
|
|
|
+ taxonomyGenus: [],
|
|
|
+ taxonomySpecies: [],
|
|
|
+ pathogenGenus: [],
|
|
|
+ pathogenDetection: []
|
|
|
+ },
|
|
|
+ extractedName: '',
|
|
|
+ extractedGender: '',
|
|
|
+ extractedAge: '',
|
|
|
+ matchedMemberId: null,
|
|
|
+ needBind: false,
|
|
|
+ selectedMemberId: null,
|
|
|
+ selectedMemberObj: null,
|
|
|
+ familyMembers: [],
|
|
|
+ matchConfidence: null,
|
|
|
+ matchLabel: '',
|
|
|
+ candidates: [],
|
|
|
+ showCandidatesOnly: false,
|
|
|
+ showMemberPanel: false,
|
|
|
+ showAutoCreateForm: false,
|
|
|
+ newMember: { name: '', gender: 'male', age: '' },
|
|
|
+ creatingMember: false,
|
|
|
+ createdMemberId: null,
|
|
|
+ groupExpandList: [],
|
|
|
+ showHelpPopup: false,
|
|
|
+ helpData: {}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- typeLabel: function() {
|
|
|
- var map = { 'gut_flora': '肠道菌群报告', 'dan': 'DAN测评报告', 'physical_exam': '体检报告', 'tongue': '舌诊报告' }
|
|
|
- return map[this.reportType] || '报告详情'
|
|
|
+ typeLabel() {
|
|
|
+ var map = { gut_flora: '肠道菌群报告', dan: 'DAN测评报告', physical_exam: '体检报告', tongue: '舌诊报告' }
|
|
|
+ return map[this.reportType] || '健康报告'
|
|
|
+ },
|
|
|
+ isGutFlora() {
|
|
|
+ return this.reportType === 'gut_flora'
|
|
|
+ },
|
|
|
+ hasRiskBlocks() {
|
|
|
+ var list = this.blocks || []
|
|
|
+ return list.some(function(b) { return b.riskLevel === 'high' || b.riskLevel === 'medium' || b.riskLevel === 'moderate' })
|
|
|
+ },
|
|
|
+ totalAbnormalCount() {
|
|
|
+ var list = this.payload.indicators || []
|
|
|
+ var count = 0
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ if (this.isAbnormalStatus(list[i].status)) count++
|
|
|
+ }
|
|
|
+ return count
|
|
|
+ },
|
|
|
+ indicatorGroups() {
|
|
|
+ var groups = []
|
|
|
+ var orderMap = {}
|
|
|
+ var list = this.payload.indicators || []
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ var ind = list[i]
|
|
|
+ var cat = ind.category || '其他指标'
|
|
|
+ var gIdx = orderMap[cat]
|
|
|
+ if (gIdx === undefined) {
|
|
|
+ gIdx = groups.length
|
|
|
+ orderMap[cat] = gIdx
|
|
|
+ groups.push({ category: cat, items: [], abnormalCount: 0 })
|
|
|
+ }
|
|
|
+ groups[gIdx].items.push(ind)
|
|
|
+ if (this.isAbnormalStatus(ind.status)) groups[gIdx].abnormalCount++
|
|
|
+ }
|
|
|
+ return groups
|
|
|
+ },
|
|
|
+ memberDisplayText() {
|
|
|
+ if (this.selectedMemberObj) return this.selectedMemberObj.nickname || this.selectedMemberObj.name || '已选择'
|
|
|
+ if (this.extractedName) return this.extractedName + (this.needBind ? '(待绑定)' : '')
|
|
|
+ return '未选择'
|
|
|
+ },
|
|
|
+ canConfirm() {
|
|
|
+ if (this.parsing) return false
|
|
|
+ if (this.needBind && !this.selectedMemberId && !this.createdMemberId) return false
|
|
|
+ return this.draftId && !this.confirming
|
|
|
+ },
|
|
|
+ confidenceLevelClass() {
|
|
|
+ var c = this.matchConfidence
|
|
|
+ if (c === null || c === undefined) return ''
|
|
|
+ if (c >= 0.8) return 'high'
|
|
|
+ if (c >= 0.6) return 'medium'
|
|
|
+ return 'low'
|
|
|
+ },
|
|
|
+ confidenceLevelText() {
|
|
|
+ var cls = this.confidenceLevelClass
|
|
|
+ if (cls === 'high') return '高'
|
|
|
+ if (cls === 'medium') return '中'
|
|
|
+ if (cls === 'low') return '低'
|
|
|
+ return ''
|
|
|
+ },
|
|
|
+ confidencePercent() {
|
|
|
+ var c = this.matchConfidence
|
|
|
+ if (c === null || c === undefined) return 0
|
|
|
+ return Math.round(c * 100)
|
|
|
+ },
|
|
|
+ confidenceDesc() {
|
|
|
+ var cls = this.confidenceLevelClass
|
|
|
+ if (cls === 'high') return '报告信息与档案高度匹配,可信度较高。'
|
|
|
+ if (cls === 'medium') return '报告信息与档案部分匹配,请仔细核对被检测人。'
|
|
|
+ if (cls === 'low') return '报告信息与档案匹配度较低,建议手动选择被检测人。'
|
|
|
+ return ''
|
|
|
+ },
|
|
|
+ taxonomyTotalCount() {
|
|
|
+ var lists = [this.payload.taxonomyClass, this.payload.taxonomyOrder, this.payload.taxonomyFamily, this.payload.taxonomyGenus, this.payload.taxonomySpecies]
|
|
|
+ var total = 0
|
|
|
+ for (var i = 0; i < lists.length; i++) {
|
|
|
+ if (lists[i] && lists[i].length) total += lists[i].length
|
|
|
+ }
|
|
|
+ return total
|
|
|
+ },
|
|
|
+ pathogenTotalCount() {
|
|
|
+ var lists = [this.payload.pathogenGenus, this.payload.pathogenDetection]
|
|
|
+ var total = 0
|
|
|
+ for (var i = 0; i < lists.length; i++) {
|
|
|
+ if (lists[i] && lists[i].length) total += lists[i].length
|
|
|
+ }
|
|
|
+ return total
|
|
|
}
|
|
|
},
|
|
|
- onLoad: function(options) {
|
|
|
+ onLoad(options) {
|
|
|
this.reportType = options.reportType || 'gut_flora'
|
|
|
this.reportId = options.reportId ? parseInt(options.reportId) : null
|
|
|
- if (this.reportId) this.loadData()
|
|
|
+ this.draftId = options.draftId ? parseInt(options.draftId) : null
|
|
|
+ this.memberId = options.memberId ? parseInt(options.memberId) : null
|
|
|
+ this.familyId = options.familyId ? parseInt(options.familyId) : null
|
|
|
+ if (this.draftId) {
|
|
|
+ this.pageMode = 'draft'
|
|
|
+ this.parseByDraftId()
|
|
|
+ } else if (this.reportId) {
|
|
|
+ this.loadData()
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- goBack: function() { uni.navigateBack() },
|
|
|
- loadData: function() {
|
|
|
+ loadData() {
|
|
|
var self = this
|
|
|
- var loadFn = self.reportType === 'dan' ? getDanReportDetail : getReportDetail
|
|
|
- loadFn(self.reportId).then(function(res) {
|
|
|
- if (res.code === 200 && res.data) {
|
|
|
- self.blocks = res.data.blocks || []
|
|
|
+ uni.showLoading({ title: '加载中...' })
|
|
|
+ var fn = self.reportType === 'dan' ? getDanReportDetail : getReportDetail
|
|
|
+ fn({ reportType: self.reportType, reportId: self.reportId }).then(function(res) {
|
|
|
+ uni.hideLoading()
|
|
|
+ if (res.code === 200) {
|
|
|
var report = res.data.report || res.data
|
|
|
var head = {}
|
|
|
- if (self.reportType === 'dan') {
|
|
|
- head.childName = report.childName
|
|
|
- head.reportDateText = report.assessmentDate || ''
|
|
|
- } else {
|
|
|
- head.personName = report.personName
|
|
|
- var d = parseDate(report.reportDate)
|
|
|
- head.reportDateText = d ? (d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate()) : ''
|
|
|
- }
|
|
|
+ head.personName = report.personName || report.childName || ''
|
|
|
+ head.childName = report.childName || ''
|
|
|
+ head.reportDateText = report.reportDate ? parseDate(report.reportDate) : ''
|
|
|
self.headInfo = head
|
|
|
+ self.blocks = report.blocks || []
|
|
|
+ if (res.data.payload) {
|
|
|
+ self.payload = Object.assign({}, self.defaultPayload(), res.data.payload)
|
|
|
+ }
|
|
|
+ self.needBind = !!report.needBind
|
|
|
+ self.selectedMemberId = report.subjectId || null
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: res.message || '加载失败', icon: 'none' })
|
|
|
}
|
|
|
}).catch(function() {
|
|
|
- uni.showToast({ title: '加载失败', icon: 'none' })
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({ title: '加载异常', icon: 'none' })
|
|
|
})
|
|
|
},
|
|
|
- isGutFlora: function() {
|
|
|
- return this.reportType === 'gut_flora'
|
|
|
+ defaultPayload() {
|
|
|
+ return {
|
|
|
+ type: 'gut_flora',
|
|
|
+ summary: {},
|
|
|
+ indicators: [],
|
|
|
+ gutFlora: [],
|
|
|
+ diseaseRisks: [],
|
|
|
+ foods: [],
|
|
|
+ probioticSpecies: [],
|
|
|
+ taxonomyClass: [],
|
|
|
+ taxonomyOrder: [],
|
|
|
+ taxonomyFamily: [],
|
|
|
+ taxonomyGenus: [],
|
|
|
+ taxonomySpecies: [],
|
|
|
+ pathogenGenus: [],
|
|
|
+ pathogenDetection: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enterEditMode() {
|
|
|
+ this.pageMode = 'edit'
|
|
|
+ this.showMemberPanel = false
|
|
|
},
|
|
|
- hasRiskBlocks: function() {
|
|
|
- var blocks = this.blocks || []
|
|
|
- for (var i = 0; i < blocks.length; i++) {
|
|
|
- if (blocks[i].type === 'risk_group' && blocks[i].items && blocks[i].items.length > 0) return true
|
|
|
+ cancelEdit() {
|
|
|
+ this.pageMode = 'view'
|
|
|
+ this.showMemberPanel = false
|
|
|
+ this.showAutoCreateForm = false
|
|
|
+ this.showHelpPopup = false
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
+ parseByDraftId() {
|
|
|
+ var self = this
|
|
|
+ self.parsing = true
|
|
|
+ parseReportDraft(self.draftId).then(function(res) {
|
|
|
+ self.parsing = false
|
|
|
+ if (res.code === 200) {
|
|
|
+ self.applyParseResult(res.data)
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: res.message || '解析失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ }).catch(function() {
|
|
|
+ self.parsing = false
|
|
|
+ uni.showToast({ title: '解析异常', icon: 'none' })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ applyParseResult(detail) {
|
|
|
+ var self = this
|
|
|
+ self.payload = detail.payload || self.defaultPayload()
|
|
|
+ self.extractedName = detail.extractedName || ''
|
|
|
+ self.extractedGender = detail.extractedGender || ''
|
|
|
+ self.extractedAge = detail.extractedAge || ''
|
|
|
+ self.matchConfidence = detail.matchConfidence !== undefined && detail.matchConfidence !== null ? detail.matchConfidence : null
|
|
|
+ self.matchLabel = detail.matchLabel || ''
|
|
|
+ self.matchedMemberId = detail.matchedMemberId || null
|
|
|
+ self.needBind = !!detail.needBind
|
|
|
+ self.candidates = detail.candidates || []
|
|
|
+ self.showCandidatesOnly = !!detail.showCandidatesOnly
|
|
|
+ self.loadFamilyMembers()
|
|
|
+ if (!self.needBind) {
|
|
|
+ self.selectedMemberId = self.matchedMemberId
|
|
|
+ }
|
|
|
+ var best = self.candidates[0]
|
|
|
+ if (best && (best.id || best.userId)) {
|
|
|
+ self.selectedMemberId = best.id || best.userId
|
|
|
+ self.selectedMemberObj = best
|
|
|
}
|
|
|
- return false
|
|
|
},
|
|
|
- toggleRiskEdit: function() {
|
|
|
+ loadFamilyMembers() {
|
|
|
var self = this
|
|
|
- if (this.isEditing) {
|
|
|
- editHealthReport(this.reportId, { diseaseRisks: this.editRisks }, 0).then(function(res) {
|
|
|
- if (res.code === 200) {
|
|
|
- uni.showToast({ title: '已保存', icon: 'success' })
|
|
|
- self.isEditing = false
|
|
|
- self.loadData()
|
|
|
- } else {
|
|
|
- uni.showToast({ title: res.message || '保存失败', icon: 'none' })
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- var risks = []
|
|
|
- var blocks = this.blocks || []
|
|
|
- for (var i = 0; i < blocks.length; i++) {
|
|
|
- if (blocks[i].type === 'risk_group' && blocks[i].items) {
|
|
|
- for (var j = 0; j < blocks[i].items.length; j++) {
|
|
|
- risks.push({
|
|
|
- diseaseName: blocks[i].items[j].name,
|
|
|
- riskValue: blocks[i].items[j].value,
|
|
|
- riskLevel: blocks[i].items[j].level
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ getFamilyMembers({ familyId: self.familyId || 0 }).then(function(res) {
|
|
|
+ if (res.code === 200) {
|
|
|
+ self.familyMembers = res.data || []
|
|
|
}
|
|
|
- this.editRisks = JSON.parse(JSON.stringify(risks))
|
|
|
- this.isEditing = true
|
|
|
+ }).catch(function() {})
|
|
|
+ },
|
|
|
+ toggleMemberPanel() {
|
|
|
+ this.showMemberPanel = !this.showMemberPanel
|
|
|
+ if (this.showMemberPanel && this.familyMembers.length === 0) {
|
|
|
+ this.loadFamilyMembers()
|
|
|
}
|
|
|
},
|
|
|
- getEditRiskKey: function(ei) { return 'e' + ei },
|
|
|
- riskLevelIndex: function(level) {
|
|
|
- var idx = this.riskLevels.indexOf(level)
|
|
|
- return idx >= 0 ? idx : 0
|
|
|
+ selectAndClose(member) {
|
|
|
+ this.selectedMemberId = member.id || member.userId
|
|
|
+ this.selectedMemberObj = member
|
|
|
+ this.createdMemberId = null
|
|
|
+ this.needBind = false
|
|
|
+ this.showMemberPanel = false
|
|
|
+ this.showAutoCreateForm = false
|
|
|
+ },
|
|
|
+ genderText(g) {
|
|
|
+ if (g === 'male') return '男'
|
|
|
+ if (g === 'female') return '女'
|
|
|
+ return g || ''
|
|
|
+ },
|
|
|
+ toggleAutoCreate() {
|
|
|
+ this.showAutoCreateForm = !this.showAutoCreateForm
|
|
|
},
|
|
|
- onRiskLevelChange: function(e, risk) {
|
|
|
- risk.riskLevel = this.riskLevels[e.detail.value]
|
|
|
+ doAutoCreate() {
|
|
|
+ var self = this
|
|
|
+ if (!self.newMember.name) {
|
|
|
+ uni.showToast({ title: '请填写姓名', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ self.creatingMember = true
|
|
|
+ addFamilyMember({
|
|
|
+ name: self.newMember.name,
|
|
|
+ gender: self.newMember.gender,
|
|
|
+ age: self.newMember.age ? parseInt(self.newMember.age) : null
|
|
|
+ }).then(function(res) {
|
|
|
+ self.creatingMember = false
|
|
|
+ if (res.code === 200) {
|
|
|
+ var member = res.data || {}
|
|
|
+ self.selectedMemberId = member.id || member.userId
|
|
|
+ self.selectedMemberObj = member
|
|
|
+ self.createdMemberId = self.selectedMemberId
|
|
|
+ self.needBind = false
|
|
|
+ self.showMemberPanel = false
|
|
|
+ self.showAutoCreateForm = false
|
|
|
+ self.loadFamilyMembers()
|
|
|
+ uni.showToast({ title: '创建成功', icon: 'success' })
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: res.message || '创建失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ }).catch(function() {
|
|
|
+ self.creatingMember = false
|
|
|
+ uni.showToast({ title: '创建异常', icon: 'none' })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toggleGroup(idx) {
|
|
|
+ this.groupExpandList[idx] = !this.groupExpandList[idx]
|
|
|
+ },
|
|
|
+ toggleAllGroups(open) {
|
|
|
+ var groups = this.indicatorGroups
|
|
|
+ var list = []
|
|
|
+ for (var i = 0; i < groups.length; i++) list.push(!!open)
|
|
|
+ this.groupExpandList = list
|
|
|
+ },
|
|
|
+ _cssClass(status) {
|
|
|
+ var s = (status || '').toString()
|
|
|
+ if (s === 'high' || s === '偏高') return 'high'
|
|
|
+ if (s === 'low' || s === '偏低') return 'low'
|
|
|
+ if (s === '缺乏' || s === '不足' || s === 'deficient' || s === 'insufficient') return 'deficient'
|
|
|
+ if (s === 'abnormal' || s === '异常') return 'abnormal'
|
|
|
+ if (s === 'warning' || s === '注意' || s === '需注意') return 'warning'
|
|
|
+ if (s === 'high-risk' || s === '高风险') return 'high-risk'
|
|
|
+ if (s === 'low-risk' || s === '低风险') return 'low-risk'
|
|
|
+ if (s === 'not-detected' || s === '未检出') return 'not-detected'
|
|
|
+ return 'normal'
|
|
|
+ },
|
|
|
+ statusText(status) {
|
|
|
+ var s = (status || '').toString()
|
|
|
+ if (s === 'high' || s === '偏高') return '偏高'
|
|
|
+ if (s === 'low' || s === '偏低') return '偏低'
|
|
|
+ if (s === '缺乏' || s === 'deficient') return '缺乏'
|
|
|
+ if (s === '不足' || s === 'insufficient') return '不足'
|
|
|
+ if (s === 'abnormal' || s === '异常') return '异常'
|
|
|
+ if (s === 'warning' || s === '注意' || s === '需注意') return '需注意'
|
|
|
+ if (s === 'high-risk' || s === '高风险') return '高风险'
|
|
|
+ if (s === 'low-risk' || s === '低风险') return '低风险'
|
|
|
+ if (s === 'not-detected' || s === '未检出') return '未检出'
|
|
|
+ if (s === 'normal') return '正常'
|
|
|
+ return '正常'
|
|
|
+ },
|
|
|
+ isAbnormalStatus(status) {
|
|
|
+ var s = (status || '').toString()
|
|
|
+ return !(s === '' || s === 'normal' || s === '正常' || s === 'low-risk' || s === '低风险' || s === 'not-detected' || s === '未检出')
|
|
|
+ },
|
|
|
+ showHelp(ind) {
|
|
|
+ this.helpData = {
|
|
|
+ name: ind.indicatorName || ind.name || '',
|
|
|
+ value: ind.indicatorValue || ind.value || '',
|
|
|
+ refRange: ind.refRange || '',
|
|
|
+ status: ind.status || 'normal',
|
|
|
+ description: ind.description || ''
|
|
|
+ }
|
|
|
+ this.showHelpPopup = true
|
|
|
+ },
|
|
|
+ closeHelp() {
|
|
|
+ this.showHelpPopup = false
|
|
|
+ },
|
|
|
+ getDefaultDescription(name, status) {
|
|
|
+ if (!status || status === 'normal') return '该指标处于正常范围内,无需特别关注。'
|
|
|
+ if (status === 'high' || status === '偏高') return '该指标偏高,建议咨询专业医生或营养师进行进一步评估。'
|
|
|
+ if (status === 'low' || status === '偏低') return '该指标偏低,建议咨询专业医生或营养师进行进一步评估。'
|
|
|
+ if (status === '缺乏' || status === '不足') return '该指标不足,建议通过饮食或补充剂适当补充。'
|
|
|
+ if (status === 'abnormal') return '该指标异常,建议咨询专业医生进行详细检查。'
|
|
|
+ if (status === '注意') return '该指标需要关注,建议定期监测并咨询专业人士。'
|
|
|
+ return '请参考专业医生的建议进行解读。'
|
|
|
+ },
|
|
|
+ riskLevelText(level) {
|
|
|
+ if (level === 'high') return '高风险'
|
|
|
+ if (level === 'medium' || level === 'moderate') return '中风险'
|
|
|
+ return '低风险'
|
|
|
+ },
|
|
|
+ indicatorLabel(code) {
|
|
|
+ var map = { tongueColor: '舌色', tongueShape: '舌形', tongueCoating: '舌苔', tongueMoisture: '润燥' }
|
|
|
+ return map[code] || code || ''
|
|
|
+ },
|
|
|
+ getTaxonomyKey(prefix, idx) {
|
|
|
+ return prefix + '_' + idx
|
|
|
+ },
|
|
|
+ hasTaxonomyData() {
|
|
|
+ return !!(this.payload.taxonomyClass && this.payload.taxonomyClass.length) ||
|
|
|
+ !!(this.payload.taxonomyOrder && this.payload.taxonomyOrder.length) ||
|
|
|
+ !!(this.payload.taxonomyFamily && this.payload.taxonomyFamily.length) ||
|
|
|
+ !!(this.payload.taxonomyGenus && this.payload.taxonomyGenus.length) ||
|
|
|
+ !!(this.payload.taxonomySpecies && this.payload.taxonomySpecies.length)
|
|
|
+ },
|
|
|
+ hasPathogenData() {
|
|
|
+ return !!(this.payload.pathogenGenus && this.payload.pathogenGenus.length) ||
|
|
|
+ !!(this.payload.pathogenDetection && this.payload.pathogenDetection.length)
|
|
|
+ },
|
|
|
+ handleLeftAction() {
|
|
|
+ if (this.pageMode === 'draft') this.doDiscard()
|
|
|
+ else this.cancelEdit()
|
|
|
+ },
|
|
|
+ handleRightAction() {
|
|
|
+ if (this.pageMode === 'draft') this.doConfirm()
|
|
|
+ else this.saveEdit()
|
|
|
+ },
|
|
|
+ doDiscard() {
|
|
|
+ var self = this
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定放弃该报告草稿吗?',
|
|
|
+ success: function(res) {
|
|
|
+ if (!res.confirm) return
|
|
|
+ var discardFn = self.payload.type === 'tongue' ? discardTongue : discardReportDraft
|
|
|
+ discardFn(self.draftId).then(function(res2) {
|
|
|
+ if (res2.code === 200) {
|
|
|
+ uni.showToast({ title: '已放弃', icon: 'success' })
|
|
|
+ setTimeout(function() { uni.navigateBack() }, 600)
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: res2.message || '操作失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ doConfirm() {
|
|
|
+ if (!this.canConfirm) return
|
|
|
+ var self = this
|
|
|
+ self.confirming = true
|
|
|
+ uni.showLoading({ title: '确认入库...' })
|
|
|
+ var postData = { draftId: self.draftId, payload: self.payload }
|
|
|
+ if (self.selectedMemberId) postData.subjectId = self.selectedMemberId
|
|
|
+ else if (self.createdMemberId) postData.subjectId = self.createdMemberId
|
|
|
+ else if (self.matchedMemberId) postData.subjectId = self.matchedMemberId
|
|
|
+ else if (self.memberId) postData.subjectId = self.memberId
|
|
|
+ var confirmFn = self.payload.type === 'tongue' ? confirmTongue : confirmReportPreview
|
|
|
+ confirmFn(postData).then(function(res) {
|
|
|
+ uni.hideLoading()
|
|
|
+ self.confirming = false
|
|
|
+ if (res.code === 200) {
|
|
|
+ var reportId = res.data && res.data.reportId
|
|
|
+ if (reportId && self.payload.type !== 'tongue') {
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.redirectTo({ url: '/pages/health/report-detail?reportType=' + (self.payload.type || 'gut_flora') + '&reportId=' + reportId })
|
|
|
+ uni.showToast({ title: '入库成功', icon: 'success' })
|
|
|
+ }, 600)
|
|
|
+ } else {
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.navigateBack()
|
|
|
+ uni.showToast({ title: '入库成功', icon: 'success' })
|
|
|
+ }, 600)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: res.message || '确认失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ }).catch(function() {
|
|
|
+ uni.hideLoading()
|
|
|
+ self.confirming = false
|
|
|
+ uni.showToast({ title: '确认异常', icon: 'none' })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saveEdit() {
|
|
|
+ var self = this
|
|
|
+ if (!self.reportId) return
|
|
|
+ uni.showLoading({ title: '保存中...' })
|
|
|
+ var subjectId = self.selectedMemberId || self.createdMemberId || 0
|
|
|
+ editHealthReport(self.reportId, self.payload, subjectId).then(function(res) {
|
|
|
+ uni.hideLoading()
|
|
|
+ if (res.code === 200) {
|
|
|
+ uni.showToast({ title: '已保存', icon: 'success' })
|
|
|
+ self.pageMode = 'view'
|
|
|
+ self.groupExpandList = []
|
|
|
+ self.loadData()
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: res.message || '保存失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ }).catch(function() {
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({ title: '保存异常', icon: 'none' })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.page { min-height: 100vh; background: #f8f8f8; }
|
|
|
-.nav-bar { display: flex; align-items: center; padding: 20rpx 30rpx; background: #fff; position: relative; }
|
|
|
-.nav-back { padding: 10rpx 0; }
|
|
|
-.back-text { font-size: 28rpx; color: #4A9BD7; }
|
|
|
-.nav-title { flex: 1; text-align: center; font-size: 32rpx; font-weight: 600; }
|
|
|
-.nav-edit { padding: 10rpx 0; }
|
|
|
-.nav-edit text { font-size: 28rpx; color: #4A9BD7; }
|
|
|
-.content { padding: 20rpx 30rpx; height: calc(100vh - 100rpx); }
|
|
|
-.report-head { background: #fff; border-radius: 16rpx; padding: 28rpx; margin-bottom: 20rpx; }
|
|
|
-.head-name { font-size: 34rpx; font-weight: 600; color: #333; }
|
|
|
-.head-meta { display: flex; align-items: center; margin-top: 12rpx; }
|
|
|
-.type-badge { font-size: 22rpx; color: #2E7D32; background: #E8F5E9; padding: 4rpx 16rpx; border-radius: 20rpx; margin-right: 16rpx; }
|
|
|
-.head-date { font-size: 24rpx; color: #999; }
|
|
|
-.empty-hint { text-align: center; color: #ccc; padding: 80rpx 0; font-size: 28rpx; }
|
|
|
-/* edit panel */
|
|
|
-.edit-panel { margin-top: 20rpx; }
|
|
|
-.edit-card { background: #fff; border-radius: 16rpx; padding: 24rpx; margin-bottom: 16rpx; }
|
|
|
-.edit-name { font-size: 28rpx; font-weight: 600; color: #333; display: block; margin-bottom: 12rpx; }
|
|
|
-.edit-row { display: flex; align-items: center; gap: 10rpx; }
|
|
|
-.edit-label { font-size: 26rpx; color: #666; }
|
|
|
-.edit-input { flex: 1; border: 1rpx solid #ddd; border-radius: 8rpx; padding: 8rpx 12rpx; font-size: 26rpx; }
|
|
|
-.edit-picker { font-size: 26rpx; color: #333; padding: 8rpx 16rpx; border: 1rpx solid #ddd; border-radius: 8rpx; }
|
|
|
-</style>
|
|
|
+.page {
|
|
|
+ min-height: 100vh;
|
|
|
+ background: #f8f8f8;
|
|
|
+}
|
|
|
+.content {
|
|
|
+ height: calc(100vh - 100rpx);
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.report-head {
|
|
|
+ margin: 20rpx 0;
|
|
|
+ padding: 24rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 16rpx;
|
|
|
+}
|
|
|
+.head-name {
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333;
|
|
|
+}
|
|
|
+.head-meta {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 12rpx;
|
|
|
+ margin-top: 10rpx;
|
|
|
+}
|
|
|
+.type-badge {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #4a90d9;
|
|
|
+ background: #eef4ff;
|
|
|
+ padding: 4rpx 14rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+}
|
|
|
+.head-date {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999;
|
|
|
+}
|
|
|
+.empty-hint {
|
|
|
+ text-align: center;
|
|
|
+ color: #999;
|
|
|
+ font-size: 26rpx;
|
|
|
+ padding: 60rpx 0;
|
|
|
+}
|
|
|
+.edit-btn {
|
|
|
+ margin: 30rpx 0;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+.nav-edit {
|
|
|
+ background: #4a90d9;
|
|
|
+ color: #fff;
|
|
|
+ padding: 16rpx 60rpx;
|
|
|
+ border-radius: 40rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+}
|
|
|
+.title-count {
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: normal;
|
|
|
+ color: #94A3B8;
|
|
|
+ margin-left: 8rpx;
|
|
|
+}
|
|
|
+.title-abnormal {
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: normal;
|
|
|
+ color: #C62828;
|
|
|
+}
|
|
|
+.card-title-actions {
|
|
|
+ margin-left: auto;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ gap: 16rpx;
|
|
|
+}
|
|
|
+.expand-all-btn {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #5B9BD5;
|
|
|
+ padding: 4rpx 12rpx;
|
|
|
+ border: 2rpx solid #5B9BD5;
|
|
|
+ border-radius: 20rpx;
|
|
|
+}
|
|
|
+.expand-all-btn:active { opacity: 0.7; }
|
|
|
+
|
|
|
+/* ===== 鎸囨爣鍒嗙粍鎶樺彔 ===== */
|
|
|
+.indicator-group {
|
|
|
+ border: 2rpx solid #E8EDF2;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ margin-bottom: 12rpx;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.indicator-group-header {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 20rpx 16rpx;
|
|
|
+ background: #F1F5F9;
|
|
|
+}
|
|
|
+.indicator-group-header:active { opacity: 0.8; }
|
|
|
+.indicator-group-header-left {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+}
|
|
|
+.indicator-group-arrow {
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #94A3B8;
|
|
|
+ margin-right: 12rpx;
|
|
|
+ transform: rotate(0deg);
|
|
|
+ transition: transform 0.2s ease;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+.indicator-group-arrow.arrow-open {
|
|
|
+ transform: rotate(90deg);
|
|
|
+}
|
|
|
+.indicator-group-name {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: 600;
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
+.indicator-group-header-right {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ gap: 12rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 12rpx;
|
|
|
+}
|
|
|
+.indicator-group-need {
|
|
|
+ font-size: 20rpx;
|
|
|
+ color: #E65100;
|
|
|
+ background: #FFF3E0;
|
|
|
+ padding: 4rpx 12rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+.indicator-group-count {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #94A3B8;
|
|
|
+}
|
|
|
+.indicator-group-abnormal {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #C62828;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-right: 8rpx;
|
|
|
+}
|
|
|
+.indicator-group-body {
|
|
|
+ padding: 16rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.field-row {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+}
|
|
|
+.field-label {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #666;
|
|
|
+ width: 160rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+.field-value {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: 500;
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.field-value.binding-required {
|
|
|
+ color: #E65100;
|
|
|
+}
|
|
|
+.member-select-row {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.member-select-row:active {
|
|
|
+ opacity: 0.7;
|
|
|
+}
|
|
|
+.member-select-arrow {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #5B9BD5;
|
|
|
+ margin-left: 12rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+.member-panel {
|
|
|
+ background: #F8FAFB;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ padding: 16rpx;
|
|
|
+ margin: 8rpx 0 16rpx;
|
|
|
+}
|
|
|
+.auto-create-inline {
|
|
|
+ margin-top: 16rpx;
|
|
|
+ padding-top: 16rpx;
|
|
|
+ border-top: 2rpx solid #E3F2FD;
|
|
|
+}
|
|
|
+.field-input {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ padding: 8rpx 16rpx;
|
|
|
+ background: #F5F7FA;
|
|
|
+ border-radius: 8rpx;
|
|
|
+}
|
|
|
+.field-textarea {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 120rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ padding: 16rpx;
|
|
|
+ background: #F5F7FA;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-top: 8rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.member-list {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 16rpx;
|
|
|
+}
|
|
|
+.member-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ padding: 20rpx 24rpx;
|
|
|
+ background: #F5F7FA;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ border: 2rpx solid transparent;
|
|
|
+ min-width: 120rpx;
|
|
|
+}
|
|
|
+.member-selected {
|
|
|
+ background: #E3F2FD;
|
|
|
+ border-color: #5B9BD5;
|
|
|
+}
|
|
|
+.member-avatar {
|
|
|
+ width: 64rpx;
|
|
|
+ height: 64rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #5B9BD5;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 64rpx;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.member-name { font-size: 24rpx; color: #333; }
|
|
|
+
|
|
|
+.indicator-item {
|
|
|
+ background: #F8FAFB;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ padding: 16rpx;
|
|
|
+ margin-bottom: 12rpx;
|
|
|
+}
|
|
|
+.ind-header {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ gap: 12rpx;
|
|
|
+}
|
|
|
+.ind-name {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: 500;
|
|
|
+ padding: 4rpx 8rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+}
|
|
|
+.ind-value {
|
|
|
+ width: 160rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #1565C0;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: right;
|
|
|
+ padding: 4rpx 8rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+}
|
|
|
+.ind-detail {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ margin-top: 8rpx;
|
|
|
+ gap: 16rpx;
|
|
|
+}
|
|
|
+.ind-ref { font-size: 22rpx; color: #94A3B8; }
|
|
|
+.ind-unit { font-size: 22rpx; color: #64748B; }
|
|
|
+.ind-symptoms {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 8rpx;
|
|
|
+ gap: 8rpx;
|
|
|
+}
|
|
|
+.ind-symptom-label { font-size: 22rpx; color: #94A3B8; flex-shrink: 0; }
|
|
|
+.ind-symptom-input {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #333;
|
|
|
+ padding: 4rpx 8rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+}
|
|
|
+.status-tag {
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 20rpx;
|
|
|
+ padding: 4rpx 12rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+.status-normal { background: #E8F5E9; color: #2E7D32; }
|
|
|
+.status-high { background: #FFF3E0; color: #E65100; }
|
|
|
+.status-low { background: #E3F2FD; color: #1565C0; }
|
|
|
+.status-abnormal { background: #FFEBEE; color: #C62828; }
|
|
|
+
|
|
|
+/* ===== 鎸囨爣甯姪鎸夐挳 ===== */
|
|
|
+.ind-help-btn {
|
|
|
+ width: 36rpx;
|
|
|
+ height: 36rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #E2E8F0;
|
|
|
+ color: #64748B;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 36rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+.ind-help-btn:active {
|
|
|
+ background: #CBD5E1;
|
|
|
+}
|
|
|
+
|
|
|
+/* ===== 鎸囨爣杈撳叆妗嗛鑹茬姸鎬?===== */
|
|
|
+.ind-name-normal, .ind-value-normal {
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+.ind-name-high, .ind-value-high,
|
|
|
+.ind-name-low, .ind-value-low,
|
|
|
+.ind-name-abnormal, .ind-value-abnormal,
|
|
|
+.ind-name-deficient, .ind-value-deficient,
|
|
|
+.ind-name-insufficient, .ind-value-insufficient,
|
|
|
+.ind-name-warning, .ind-value-warning,
|
|
|
+.ind-name-high-risk, .ind-value-high-risk,
|
|
|
+.ind-name-low-risk, .ind-value-low-risk,
|
|
|
+.ind-name-not-detected, .ind-value-not-detected {
|
|
|
+ background: #FFF0F0;
|
|
|
+ color: #C62828;
|
|
|
+}
|
|
|
+
|
|
|
+/* ===== 鎸囨爣甯姪寮圭獥 ===== */
|
|
|
+.help-overlay {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background: rgba(0,0,0,0.4);
|
|
|
+ z-index: 999;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+.help-popup {
|
|
|
+ width: 580rpx;
|
|
|
+ max-height: 70vh;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 24rpx;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.help-popup-header {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 28rpx 30rpx;
|
|
|
+ border-bottom: 2rpx solid #F0F0F0;
|
|
|
+}
|
|
|
+.help-popup-title {
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.help-popup-close {
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #999;
|
|
|
+ padding: 8rpx;
|
|
|
+}
|
|
|
+.help-popup-body {
|
|
|
+ padding: 24rpx 30rpx;
|
|
|
+}
|
|
|
+.help-row {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+}
|
|
|
+.help-label {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #94A3B8;
|
|
|
+ width: 140rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+.help-value {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: 500;
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.help-status-normal { color: #2E7D32; }
|
|
|
+.help-status-high { color: #C62828; }
|
|
|
+.help-status-low { color: #1565C0; }
|
|
|
+.help-status-abnormal { color: #C62828; }
|
|
|
+.help-desc {
|
|
|
+ margin-top: 8rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+ background: #F8FAFB;
|
|
|
+ border-radius: 12rpx;
|
|
|
+}
|
|
|
+.help-desc-label {
|
|
|
+ display: block;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #94A3B8;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.help-desc-text {
|
|
|
+ display: block;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ line-height: 1.6;
|
|
|
+}
|
|
|
+
|
|
|
+.flora-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ gap: 12rpx;
|
|
|
+ padding: 12rpx 16rpx;
|
|
|
+ background: #F8FAFB;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.flora-name {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ padding: 4rpx 8rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+}
|
|
|
+.flora-abundance {
|
|
|
+ width: 140rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #1565C0;
|
|
|
+ text-align: right;
|
|
|
+ padding: 4rpx 8rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.taxonomy-group {
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+}
|
|
|
+.taxonomy-group:last-child {
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+.taxonomy-group-label {
|
|
|
+ display: block;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #666;
|
|
|
+ padding: 8rpx 4rpx 6rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.pathogen-group {
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+}
|
|
|
+.pathogen-group:last-child {
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+.pathogen-group-label {
|
|
|
+ display: block;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #D32F2F;
|
|
|
+ padding: 8rpx 4rpx 6rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.risk-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ gap: 12rpx;
|
|
|
+ padding: 12rpx 16rpx;
|
|
|
+ background: #F8FAFB;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.risk-name {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ padding: 4rpx 8rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+}
|
|
|
+.risk-level {
|
|
|
+ font-size: 22rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ padding: 4rpx 12rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+}
|
|
|
+.risk-low { background: #E8F5E9; color: #2E7D32; }
|
|
|
+.risk-medium, .risk-moderate { background: #FFF3E0; color: #E65100; }
|
|
|
+.risk-high { background: #FFEBEE; color: #C62828; }
|
|
|
+
|
|
|
+.food-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ gap: 12rpx;
|
|
|
+ padding: 12rpx 16rpx;
|
|
|
+ background: #F8FAFB;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.food-name {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ padding: 4rpx 8rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+}
|
|
|
+.food-category {
|
|
|
+ width: 160rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #64748B;
|
|
|
+ text-align: right;
|
|
|
+ padding: 4rpx 8rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.action-row {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ gap: 20rpx;
|
|
|
+ margin-top: 10rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+}
|
|
|
+.btn-discard {
|
|
|
+ flex: 1;
|
|
|
+ background: #fff;
|
|
|
+ border: 2rpx solid #EF4444;
|
|
|
+ color: #EF4444;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ padding: 24rpx;
|
|
|
+ border-radius: 16rpx;
|
|
|
+}
|
|
|
+.btn-discard:active { opacity: 0.7; }
|
|
|
+.btn-confirm {
|
|
|
+ flex: 2;
|
|
|
+ background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
|
|
|
+ color: #fff;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ padding: 24rpx;
|
|
|
+ border-radius: 16rpx;
|
|
|
+}
|
|
|
+.btn-confirm:active { opacity: 0.85; }
|
|
|
+.btn-disabled { opacity: 0.5; }
|
|
|
+
|
|
|
+.bottom-spacer { height: 80rpx; }
|
|
|
+
|
|
|
+/* ===== Phase 2: 鍖归厤鍙俊搴?===== */
|
|
|
+.confidence-card {
|
|
|
+ margin: 0 30rpx 20rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ padding: 24rpx;
|
|
|
+ box-shadow: 0 2rpx 6rpx rgba(0,0,0,0.04);
|
|
|
+}
|
|
|
+.confidence-header {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+}
|
|
|
+.confidence-label {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+.confidence-badge {
|
|
|
+ font-size: 22rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ padding: 4rpx 16rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+}
|
|
|
+.badge-high { background: #E8F5E9; color: #2E7D32; }
|
|
|
+.badge-medium { background: #FFF8E1; color: #F57F17; }
|
|
|
+.badge-low { background: #FFF3E0; color: #E65100; }
|
|
|
+.badge-none { background: #FFEBEE; color: #C62828; }
|
|
|
+
|
|
|
+.confidence-bar-track {
|
|
|
+ height: 12rpx;
|
|
|
+ background: #E2E8F0;
|
|
|
+ border-radius: 6rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-bottom: 12rpx;
|
|
|
+}
|
|
|
+.confidence-bar-fill {
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 6rpx;
|
|
|
+ transition: width 0.3s ease;
|
|
|
+}
|
|
|
+.fill-high { background: linear-gradient(90deg, #66BB6A, #43A047); }
|
|
|
+.fill-medium { background: linear-gradient(90deg, #FFD54F, #FFC107); }
|
|
|
+.fill-low { background: linear-gradient(90deg, #FF8A65, #FF5722); }
|
|
|
+.fill-none { background: linear-gradient(90deg, #EF9A9A, #E53935); }
|
|
|
+
|
|
|
+.confidence-desc {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #94A3B8;
|
|
|
+ line-height: 1.4;
|
|
|
+}
|
|
|
+
|
|
|
+/* ===== Phase 2: 鍊欓€夋垚鍛樺垪琛?===== */
|
|
|
+.candidate-section {
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+}
|
|
|
+.candidate-section-hint {
|
|
|
+ display: block;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #64748B;
|
|
|
+ margin-bottom: 12rpx;
|
|
|
+}
|
|
|
+.candidate-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 16rpx;
|
|
|
+ background: #F8FAFB;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
+ border: 2rpx solid transparent;
|
|
|
+}
|
|
|
+.candidate-item:active { opacity: 0.8; }
|
|
|
+.candidate-selected {
|
|
|
+ background: #E3F2FD;
|
|
|
+ border-color: #5B9BD5;
|
|
|
+}
|
|
|
+.candidate-left {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+}
|
|
|
+.candidate-avatar {
|
|
|
+ width: 56rpx;
|
|
|
+ height: 56rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #5B9BD5;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 56rpx;
|
|
|
+ margin-right: 16rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+.candidate-info {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+}
|
|
|
+.candidate-name {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: 500;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.candidate-detail {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #94A3B8;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.candidate-fields {
|
|
|
+ font-size: 20rpx;
|
|
|
+ color: #5B9BD5;
|
|
|
+ display: block;
|
|
|
+ margin-top: 2rpx;
|
|
|
+}
|
|
|
+.candidate-right {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ gap: 12rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 16rpx;
|
|
|
+}
|
|
|
+.score-bar-track {
|
|
|
+ width: 80rpx;
|
|
|
+ height: 10rpx;
|
|
|
+ background: #E2E8F0;
|
|
|
+ border-radius: 5rpx;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.score-bar-fill {
|
|
|
+ height: 100%;
|
|
|
+ background: linear-gradient(90deg, #5B9BD5, #3A7CC4);
|
|
|
+ border-radius: 5rpx;
|
|
|
+}
|
|
|
+.score-text {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #1565C0;
|
|
|
+ font-weight: bold;
|
|
|
+ min-width: 48rpx;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+
|
|
|
+/* ===== Phase 2: 鏂板缓鎴愬憳鍏ュ彛 ===== */
|
|
|
+.create-member-entry {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding: 20rpx;
|
|
|
+ border: 2rpx dashed #CBD5E1;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ margin-top: 8rpx;
|
|
|
+}
|
|
|
+.create-member-entry:active { background: #F1F5F9; }
|
|
|
+.create-member-icon {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #5B9BD5;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 8rpx;
|
|
|
+}
|
|
|
+.create-member-text {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #5B9BD5;
|
|
|
+}
|
|
|
+
|
|
|
+/* ===== Phase 2: 鏂板缓鎴愬憳琛ㄥ崟锛堥潰鏉垮唴宓岋級 ===== */
|
|
|
+.form-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+}
|
|
|
+.form-item-label {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ width: 100rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+.form-item-input {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ padding: 12rpx 16rpx;
|
|
|
+ background: #F5F7FA;
|
|
|
+ border-radius: 10rpx;
|
|
|
+}
|
|
|
+.gender-selector {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ gap: 16rpx;
|
|
|
+}
|
|
|
+.gender-option {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ padding: 12rpx 32rpx;
|
|
|
+ background: #F5F7FA;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ border: 2rpx solid transparent;
|
|
|
+}
|
|
|
+.gender-option:active { opacity: 0.7; }
|
|
|
+.gender-selected {
|
|
|
+ background: #E3F2FD;
|
|
|
+ border-color: #5B9BD5;
|
|
|
+ color: #1565C0;
|
|
|
+}
|
|
|
+.btn-create-submit {
|
|
|
+ background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
|
|
|
+ color: #fff;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ padding: 22rpx;
|
|
|
+ border-radius: 14rpx;
|
|
|
+ margin-top: 10rpx;
|
|
|
+}
|
|
|
+.btn-create-submit:active { opacity: 0.85; }
|
|
|
+
|
|
|
+/* ===== 鑸岃瘖鎸囨爣 ===== */
|
|
|
+.tongue-indicator-grid {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 12rpx;
|
|
|
+}
|
|
|
+.tongue-ind-item {
|
|
|
+ width: calc(50% - 6rpx);
|
|
|
+ background: #F8FAFC;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ padding: 20rpx 24rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.tongue-ind-label {
|
|
|
+ display: block;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #94A3B8;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.tongue-ind-value {
|
|
|
+ display: block;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #1E293B;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+.tongue-summary {
|
|
|
+ margin-top: 20rpx;
|
|
|
+ padding: 20rpx 24rpx;
|
|
|
+ background: #FFF8E1;
|
|
|
+ border-radius: 16rpx;
|
|
|
+}
|
|
|
+.tongue-summary-title {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #F59E0B;
|
|
|
+ font-weight: 600;
|
|
|
+ display: block;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.tongue-summary-text {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+.tip-banner,
|
|
|
+.parsing-banner,
|
|
|
+.confidence-card {
|
|
|
+ margin-left: 0;
|
|
|
+ margin-right: 0;
|
|
|
+}
|
|
|
+.form-section {
|
|
|
+ margin-left: 0;
|
|
|
+ margin-right: 0;
|
|
|
+}
|
|
|
+</style>
|