| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743 |
- <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) {
- 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>
|