| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747 |
- <template>
- <view class="confirm-container">
- <view class="nav-bar">
- <text class="nav-back" @click="goBack">‹ 返回</text>
- <text class="nav-title">确认健康报告</text>
- <view class="nav-placeholder"></view>
- </view>
- <view class="tip-banner">
- <text class="tip-icon">✅</text>
- <text class="tip-text">请核对以下解析内容,可修改后确认入库</text>
- </view>
- <!-- 解析中状态(仅 draftId 模式,从上传页跳转后自动解析) -->
- <view class="parsing-banner" v-if="parsing">
- <text class="parsing-icon">⏳</text>
- <text class="parsing-text">正在解析报告,请稍候...</text>
- </view>
- <!-- 匹配可信度 -->
- <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="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 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>
- <!-- 操作按钮 -->
- <view class="action-row">
- <view class="btn-discard" @click="doDiscard">
- <text>放弃</text>
- </view>
- <view class="btn-confirm" :class="{ 'btn-disabled': !canConfirm }" @click="doConfirm">
- <text v-if="confirming">确认中...</text>
- <text v-else>确认入库</text>
- </view>
- </view>
- </view>
- <view class="bottom-spacer"></view>
- </view>
- </template>
- <script>
- import { confirmReportPreview, discardReportDraft, confirmTongue, discardTongue, parseReportDraft } from '../../utils/api.js'
- import { addFamilyMember, getFamilyMembers } from '../../utils/api.js'
- export default {
- data() {
- return {
- draftId: null,
- memberId: null,
- familyId: null,
- payload: {
- summary: {},
- indicators: [],
- gutFlora: [],
- probioticSpecies: [],
- taxonomyClass: [],
- taxonomyOrder: [],
- taxonomyFamily: [],
- taxonomyGenus: [],
- taxonomySpecies: [],
- pathogenGenus: [],
- pathogenDetection: [],
- foods: [],
- diseaseRisks: []
- },
- extractedName: '',
- extractedGender: '',
- extractedAge: '',
- matchedMemberId: null,
- needBind: false,
- selectedMemberId: null,
- familyMembers: [],
- confirming: false,
- // 仅 draftId 模式(从上传页跳转)下正在解析
- parsing: false,
- // Phase 2: 匹配可信度与候选
- matchConfidence: null,
- matchLabel: '',
- candidates: [],
- showCandidatesOnly: false,
- // 被检测人选择面板
- showMemberPanel: false,
- selectedMemberObj: null,
- // 新建成员
- showAutoCreateForm: false,
- newMember: {
- name: '',
- gender: '',
- age: ''
- },
- creatingMember: false,
- createdMemberId: null,
- // 指标分组折叠状态(按分组下标,默认全部折叠)
- groupExpandList: [],
- // 指标帮助弹窗
- showHelpPopup: false,
- helpData: { name: '', value: '', refRange: '', status: '', description: '' }
- }
- },
- computed: {
- canConfirm() {
- if (this.parsing) return false
- if (this.needBind && !this.selectedMemberId && !this.createdMemberId) return false
- return this.draftId && !this.confirming
- },
- confidenceLevelClass() {
- if (!this.matchConfidence && this.matchConfidence !== 0) return ''
- var val = parseFloat(this.matchConfidence)
- if (this.matchLabel === 'exact' || val >= 0.8) return 'high'
- if (this.matchLabel === 'fuzzy' || val >= 0.5) return 'medium'
- if (this.matchLabel === 'profile_match' || val >= 0.2) return 'low'
- return 'none'
- },
- confidenceLevelText() {
- var map = { high: '高', medium: '中', low: '低', none: '未匹配' }
- return map[this.confidenceLevelClass] || ''
- },
- confidencePercent() {
- if (!this.matchConfidence && this.matchConfidence !== 0) return 0
- return Math.round(parseFloat(this.matchConfidence) * 100)
- },
- confidenceDesc() {
- if (this.matchLabel === 'exact') return '根据姓名、性别、年龄自动精确匹配到家庭成员'
- if (this.matchLabel === 'fuzzy') return '部分字段匹配,请确认是否为以下家庭成员'
- if (this.matchLabel === 'profile_match') return '根据档案信息推测匹配,请手动确认'
- if (this.matchLabel === 'no_match') return '无法匹配到现有家庭成员,可新建成员'
- return ''
- },
- memberDisplayText() {
- var m = this.selectedMemberObj
- if (m && (m.nickname || m.name)) return m.nickname || m.name
- if (this.needBind) return '需手动绑定'
- return this.extractedName || '未识别'
- },
- // 指标按类型(category)分组,保持解析顺序,统计需处理(非正常)数量
- indicatorGroups() {
- var groups = []
- var orderMap = {}
- var list = (this.payload && this.payload.indicators) || []
- for (var i = 0; i < list.length; i++) {
- var ind = list[i]
- var cat = ind.category || '其他指标'
- if (!orderMap[cat]) {
- orderMap[cat] = groups.length
- groups.push({ category: cat, items: [], needCount: 0, abnormalCount: 0 })
- }
- var group = groups[orderMap[cat]]
- group.items.push(ind)
- if (this.isAbnormalStatus(ind.status)) {
- group.needCount++
- group.abnormalCount++
- }
- }
- return groups
- },
- totalAbnormalCount() {
- var list = (this.payload && this.payload.indicators) || []
- var count = 0
- for (var i = 0; i < list.length; i++) {
- if (this.isAbnormalStatus(list[i].status)) count++
- }
- return count
- },
- taxonomyTotalCount() {
- var total = 0
- total += (this.payload.taxonomyClass || []).length
- total += (this.payload.taxonomyOrder || []).length
- total += (this.payload.taxonomyFamily || []).length
- total += (this.payload.taxonomyGenus || []).length
- total += (this.payload.taxonomySpecies || []).length
- return total
- },
- pathogenTotalCount() {
- return (this.payload.pathogenGenus || []).length +
- (this.payload.pathogenDetection || []).length
- }
- },
- onLoad: function(options) {
- this.draftId = options.draftId ? parseInt(options.draftId) : null
- this.memberId = options.memberId ? parseInt(options.memberId) : null
- this.familyId = options.familyId ? parseInt(options.familyId) : null
- // 仅 draftId 模式(从上传页自动跳转):无 payload 参数 → 调用后端按草稿解析并自动填充
- if (this.draftId && !options.payload) {
- this.parseByDraftId()
- return
- }
- var payloadStr = decodeURIComponent(options.payload || '{}')
- try {
- var parsed = typeof payloadStr === 'string' ? JSON.parse(payloadStr) : payloadStr
- this.payload = Object.assign({
- summary: {},
- indicators: [],
- gutFlora: [],
- probioticSpecies: [],
- taxonomyClass: [],
- taxonomyOrder: [],
- taxonomyFamily: [],
- taxonomyGenus: [],
- taxonomySpecies: [],
- pathogenGenus: [],
- pathogenDetection: [],
- foods: [],
- diseaseRisks: []
- }, parsed)
- } catch (e) {
- console.log('解析payload失败', e)
- }
- this.extractedName = options.extractedName || ''
- this.extractedGender = options.extractedGender || ''
- this.extractedAge = options.extractedAge || ''
- this.matchedMemberId = options.matchedMemberId ? parseInt(options.matchedMemberId) : null
- // 从解析结果填充报告日期
- var extractedReportDate = options.extractedReportDate || ''
- if (extractedReportDate && this.payload.summary) {
- this.payload.summary.reportDate = extractedReportDate
- }
- this.needBind = options.needBind === 'true' || options.needBind === '1'
- this.matchConfidence = options.matchConfidence ? parseFloat(options.matchConfidence) : null
- this.matchLabel = decodeURIComponent(options.matchLabel || '')
- // 解析候选成员列表
- var candidatesStr = decodeURIComponent(options.candidates || '')
- if (candidatesStr) {
- try {
- this.candidates = JSON.parse(candidatesStr)
- } catch (e) {
- this.candidates = []
- }
- }
- // 有候选时优先展示候选列表
- if (this.candidates.length > 0) {
- this.showCandidatesOnly = true
- }
- // 始终加载家庭成员(面板始终可点击,needBind=false 也允许改选)
- this.loadFamilyMembers()
- if (this.needBind) {
- // 高置信度且已匹配 → 直接选中
- if (this.matchedMemberId && this.matchConfidence >= 0.8) {
- this.selectedMemberId = this.matchedMemberId
- }
- }
- },
- methods: {
- // 仅 draftId 模式:调用后端按草稿解析,成功后自动填充页面
- parseByDraftId() {
- var self = this
- self.parsing = true
- parseReportDraft(self.draftId).then(function(res) {
- var detail = res && res.data
- if (!detail) {
- self.parsing = false
- uni.showToast({ title: (res && res.message) || '解析失败,请重试', icon: 'none' })
- return
- }
- self.applyParseResult(detail)
- }).catch(function(err) {
- self.parsing = false
- var msg = (err && err.message) || '解析失败,请重试'
- uni.showToast({ title: msg, icon: 'none' })
- })
- },
- // 将后端解析结果应用到页面
- applyParseResult(detail) {
- this.parsing = false
- if (detail.payload) {
- this.payload = Object.assign({
- summary: {},
- indicators: [],
- gutFlora: [],
- probioticSpecies: [],
- taxonomyClass: [],
- taxonomyOrder: [],
- taxonomyFamily: [],
- taxonomyGenus: [],
- taxonomySpecies: [],
- pathogenGenus: [],
- pathogenDetection: [],
- foods: [],
- diseaseRisks: []
- }, detail.payload)
- }
- this.extractedName = detail.extractedName || ''
- this.extractedGender = detail.extractedGender || ''
- this.extractedAge = detail.extractedAge || ''
- this.matchedMemberId = detail.matchedMemberId ? parseInt(detail.matchedMemberId) : null
- this.needBind = !!detail.needBind
- this.matchConfidence = detail.confidence !== undefined && detail.confidence !== null ? parseFloat(detail.confidence) : null
- this.matchLabel = detail.matchLabel || ''
- this.candidates = detail.candidates || []
- this.showCandidatesOnly = this.candidates.length > 0
- // 始终加载家庭成员
- this.loadFamilyMembers()
- // 高置信度且已匹配 → 直接选中
- if (this.needBind && this.matchedMemberId && this.matchConfidence >= 0.8) {
- this.selectedMemberId = this.matchedMemberId
- }
- },
- loadFamilyMembers() {
- var self = this
- // 从后端获取真实家庭成员(家长 + 孩子),storage 中并无该数据
- getFamilyMembers().then(function(res) {
- var data = (res && res.data) || {}
- var parents = (data.parents || []).map(function(p) {
- return { id: p.id, nickname: p.realName || p.nickname, gender: p.gender, role: 'parent' }
- })
- var children = (data.children || []).map(function(c) {
- return { id: c.id, nickname: c.nickname, gender: c.gender, age: c.age, role: 'child' }
- })
- self.familyMembers = parents.concat(children)
- self.syncSelectedMemberObj()
- }).catch(function(e) {
- console.log('加载家庭成员失败', e)
- self.familyMembers = []
- })
- },
- toggleMemberPanel() {
- this.showMemberPanel = !this.showMemberPanel
- if (!this.showMemberPanel) {
- this.showAutoCreateForm = false
- }
- },
- selectAndClose(member) {
- var memberId = member.id || member.userId
- this.selectedMemberId = memberId
- this.selectedMemberObj = member
- this.extractedName = member.nickname || member.name || this.extractedName
- this.extractedGender = member.gender || this.extractedGender
- this.extractedAge = member.age || this.extractedAge
- this.showAutoCreateForm = false
- this.showMemberPanel = false
- },
- syncSelectedMemberObj() {
- if (!this.selectedMemberId) {
- this.selectedMemberObj = null
- return
- }
- var all = this.familyMembers.concat(this.candidates)
- for (var i = 0; i < all.length; i++) {
- var m = all[i]
- if ((m.id || m.userId) === this.selectedMemberId) {
- this.selectedMemberObj = m
- return
- }
- }
- },
- // === Phase 2: 候选匹配与新建成员 ===
- genderText(gender) {
- if (gender === 'male') return '男'
- if (gender === 'female') return '女'
- return gender || ''
- },
- toggleAutoCreate() {
- this.showAutoCreateForm = !this.showAutoCreateForm
- if (this.showAutoCreateForm) {
- this.newMember.name = this.extractedName || ''
- this.newMember.gender = this.extractedGender || ''
- this.newMember.age = this.extractedAge || ''
- this.selectedMemberId = null
- }
- },
- doAutoCreate() {
- var self = this
- if (!this.newMember.name) {
- uni.showToast({ title: '请输入成员姓名', icon: 'none' })
- return
- }
- self.creatingMember = true
- uni.showLoading({ title: '创建成员...' })
- addFamilyMember({
- nickname: self.newMember.name,
- gender: self.newMember.gender || '',
- age: self.newMember.age ? parseInt(self.newMember.age) : null
- }).then(function(res) {
- uni.hideLoading()
- if (res.code === 200) {
- var memberId = res.data && (res.data.userId || res.data.id)
- if (memberId) {
- self.createdMemberId = memberId
- self.selectedMemberId = memberId
- self.selectedMemberObj = {
- id: memberId,
- nickname: self.newMember.name,
- gender: self.newMember.gender,
- age: self.newMember.age
- }
- self.extractedName = self.newMember.name
- self.extractedGender = self.newMember.gender
- self.extractedAge = self.newMember.age
- self.showAutoCreateForm = false
- self.showMemberPanel = false
- uni.showToast({ title: '创建成功', icon: 'success' })
- }
- } else {
- uni.showToast({ title: res.message || '创建失败', icon: 'none' })
- }
- }).catch(function(e) {
- uni.hideLoading()
- uni.showToast({ title: '创建失败', icon: 'none' })
- }).finally(function() {
- self.creatingMember = false
- })
- },
- toggleGroup(gIdx) {
- this.$set(this.groupExpandList, gIdx, !this.groupExpandList[gIdx])
- },
- toggleAllGroups(expand) {
- var arr = []
- for (var i = 0; i < this.indicatorGroups.length; i++) {
- arr.push(expand)
- }
- this.groupExpandList = arr
- },
- _cssClass(status) {
- var map = { 'high': 'high', 'low': 'low', 'abnormal': 'abnormal', 'normal': 'normal', '缺乏': 'deficient', '偏低': 'low', '不足': 'insufficient', '正常': 'normal', '注意': 'warning', '偏高': 'high', '异常': 'abnormal', '高风险': 'high-risk', '低风险': 'low-risk', '未检出': 'not-detected' }
- return map[status] || 'normal'
- },
- statusText(status) {
- if (status === 'high' || status === '偏高') return '偏高'
- if (status === 'low' || status === '偏低') return '偏低'
- if (status === 'abnormal' || status === '异常') return '异常'
- if (status === '缺乏') return '缺乏'
- if (status === '不足') return '不足'
- if (status === '正常') return '正常'
- if (status === '注意') return '注意'
- if (status === '高风险') return '高风险'
- if (status === '低风险') return '低风险'
- if (status === '未检出') return '未检出'
- return '正常'
- },
- // 与 _cssClass 保持同一白名单:仅明确异常/需关注的状态计入异常数,
- // 未知状态文本(解析器自由提取)一律视为正常,避免"样式正常却计入异常"的矛盾。
- isAbnormalStatus(status) {
- if (!status) return false
- var abnormalMap = { 'high': 1, 'low': 1, 'abnormal': 1, '偏高': 1, '偏低': 1, '异常': 1, '缺乏': 1, '不足': 1, '注意': 1, '高风险': 1 }
- return !!abnormalMap[String(status).trim()]
- },
- showHelp(ind) {
- this.helpData = {
- name: ind.indicatorName || ind.name || '',
- value: ind.indicatorValue || ind.value || '',
- refRange: ind.refRange || ind.normalRange || '',
- status: ind.status || 'normal',
- description: ind.description || ind.symptoms || ''
- }
- 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 '低风险'
- },
- doConfirm() {
- if (!this.canConfirm) return
- var self = this
- self.confirming = true
- uni.showLoading({ title: '确认入库...' })
- var postData = {
- draftId: self.draftId,
- payload: self.payload
- }
- // 优先级: 已选成员 > 新建成员 > 自动匹配(高置信度) > 子ID
- 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()
- if (res.code === 200) {
- uni.showToast({ title: '入库成功', icon: 'success' })
- var reportId = res.data && res.data.reportId
- var reportType = res.data && res.data.reportType || ''
- setTimeout(function() {
- if (reportId) {
- if (reportType === 'gut_flora') {
- uni.redirectTo({ url: '/pages/health/report-detail?reportType=gut_flora&reportId=' + reportId })
- } else {
- uni.redirectTo({ url: '/pages/health/health-plan-summary?initialReportIds=' + reportId + '&subjectId=' + (postData.subjectId || '') })
- }
- } else {
- uni.navigateBack()
- }
- }, 500)
- } else {
- uni.showToast({ title: res.message || '确认失败', icon: 'none' })
- }
- }).catch(function(e) {
- uni.hideLoading()
- uni.showToast({ title: '确认失败,请重试', icon: 'none' })
- console.log('确认入库失败', e)
- }).finally(function() {
- self.confirming = false
- })
- },
- doDiscard() {
- var self = this
- uni.showModal({
- title: '确认放弃',
- content: '放弃后解析数据将被删除,需要重新上传',
- success: function(res) {
- if (res.confirm) {
- var discardFn = self.payload.type === 'tongue' ? discardTongue : discardReportDraft
- discardFn(self.draftId).then(function() {
- uni.showToast({ title: '已放弃', icon: 'none' })
- setTimeout(function() { uni.navigateBack() }, 500)
- }).catch(function() {
- uni.showToast({ title: '操作失败', icon: 'none' })
- })
- }
- }
- })
- },
- goBack() {
- uni.navigateBack()
- },
- hasTaxonomyData() {
- return this.taxonomyTotalCount > 0
- },
- hasPathogenData() {
- return this.pathogenTotalCount > 0
- },
- // taxonomy/病原菌列表 key(微信小程序禁止 :key 表达式)
- getTaxonomyKey(prefix, idx) {
- return prefix + idx
- },
- // 舌诊指标标签映射
- indicatorLabel(code) {
- var map = {
- 'tongue_color': '舌色',
- 'coating_color': '苔色',
- 'coating_texture': '苔质',
- 'fissure': '裂纹',
- 'teeth_mark': '齿痕',
- 'sublingual_vein': '舌下静脉',
- 'constitution': '体质'
- }
- return map[code] || code
- }
- }
- }
- </script>
- <style scoped>
- .confirm-container {
- min-height: 100vh;
- background: #F5F7FA;
- }
- .nav-bar {
- position: sticky;
- top: 0;
- background: #fff;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx 30rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
- z-index: 100;
- }
- .nav-back { font-size: 32rpx; color: #5B9BD5; }
- .nav-title { font-size: 32rpx; font-weight: bold; color: #333; }
- .nav-placeholder { width: 80rpx; }
- .tip-banner {
- display: flex;
- flex-direction: row;
- align-items: center;
- background: #E8F5E9;
- margin: 20rpx 30rpx;
- padding: 20rpx 24rpx;
- border-radius: 16rpx;
- }
- .tip-icon { font-size: 32rpx; margin-right: 16rpx; flex-shrink: 0; }
- .tip-text { font-size: 24rpx; color: #2E7D32; line-height: 1.5; }
- .parsing-banner {
- display: flex;
- flex-direction: row;
- align-items: center;
- background: #FFF8E1;
- margin: 0 30rpx 20rpx;
- padding: 20rpx 24rpx;
- border-radius: 16rpx;
- }
- .parsing-icon { font-size: 32rpx; margin-right: 16rpx; flex-shrink: 0; }
- .parsing-text { font-size: 24rpx; color: #F57F17; line-height: 1.5; }
- .form-section { margin: 0 30rpx; }
- .card {
- background: #fff;
- border-radius: 16rpx;
- padding: 24rpx;
- margin-bottom: 20rpx;
- box-shadow: 0 2rpx 6rpx rgba(0,0,0,0.04);
- }
- .card-title {
- font-size: 28rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 20rpx;
- padding-bottom: 12rpx;
- border-bottom: 2rpx solid #F0F0F0;
- display: flex;
- flex-direction: row;
- align-items: center;
- flex-wrap: wrap;
- gap: 4rpx;
- }
- .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;
- line-height: 1.6;
- }
- </style>
|