report-confirm.vue 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986
  1. <template>
  2. <view class="confirm-container">
  3. <view class="tip-banner">
  4. <text class="tip-icon">✅</text>
  5. <text class="tip-text">请核对以下解析内容,可修改后确认入库</text>
  6. </view>
  7. <!-- 解析中状态(仅 draftId 模式,从上传页跳转后自动解析) -->
  8. <view class="parsing-banner" v-if="parsing">
  9. <text class="parsing-icon">⏳</text>
  10. <text class="parsing-text">正在解析报告,请稍候...</text>
  11. </view>
  12. <!-- 匹配可信度 -->
  13. <view class="confidence-card" v-if="confidenceLevelClass">
  14. <view class="confidence-header">
  15. <text class="confidence-label">匹配可信度</text>
  16. <text class="confidence-badge" :class="'badge-' + confidenceLevelClass">{{ confidenceLevelText }}</text>
  17. </view>
  18. <view class="confidence-bar-track">
  19. <view class="confidence-bar-fill" :class="'fill-' + confidenceLevelClass" :style="'width:' + confidencePercent + '%'"></view>
  20. </view>
  21. <text class="confidence-desc">{{ confidenceDesc }}</text>
  22. </view>
  23. <view class="form-section">
  24. <!-- 基本信息 -->
  25. <view class="card">
  26. <view class="card-title">基本信息</view>
  27. <view class="field-row member-select-row" @click="toggleMemberPanel">
  28. <text class="field-label">被检测人</text>
  29. <text class="field-value" :class="{ 'binding-required': needBind && !selectedMemberObj }">{{ memberDisplayText }}</text>
  30. <text class="member-select-arrow">{{ selectedMemberObj ? '修改 ›' : '选择 ›' }}</text>
  31. </view>
  32. <!-- 被检测人选择面板(内联展开) -->
  33. <view class="member-panel" v-if="showMemberPanel">
  34. <!-- 候选匹配列表(按置信度排序) -->
  35. <view class="candidate-section" v-if="candidates.length > 0">
  36. <text class="candidate-section-hint">以下成员与报告信息匹配,请选择:</text>
  37. <view
  38. class="candidate-item"
  39. v-for="(cand, idx) in candidates"
  40. :key="idx"
  41. :class="{ 'candidate-selected': selectedMemberId === (cand.id || cand.userId) }"
  42. @click="selectAndClose(cand)"
  43. >
  44. <view class="candidate-left">
  45. <text class="candidate-avatar">{{ (cand.nickname || cand.name || '?').substring(0, 1) }}</text>
  46. <view class="candidate-info">
  47. <text class="candidate-name">{{ cand.nickname || cand.name || '未知' }}</text>
  48. <text class="candidate-detail" v-if="cand.gender || cand.age">{{ genderText(cand.gender) }}{{ cand.age ? ' · ' + cand.age + '岁' : '' }}</text>
  49. <text class="candidate-fields" v-if="cand.matchFields">匹配: {{ cand.matchFields }}</text>
  50. </view>
  51. </view>
  52. <view class="candidate-right">
  53. <view class="score-bar-track">
  54. <view class="score-bar-fill" :style="'width:' + (cand.similarityScore * 100) + '%'"></view>
  55. </view>
  56. <text class="score-text">{{ Math.round(cand.similarityScore * 100) }}%</text>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- 全量家庭成员列表(始终显示,候选区已展示的成员去重) -->
  61. <view class="member-list" v-if="familyMembers.length > 0">
  62. <text class="member-list-hint" v-if="candidates.length > 0">全部成员({{ otherMembers.length }} 人)</text>
  63. <view
  64. class="member-item"
  65. v-for="(member, mIdx) in otherMembers"
  66. :key="mIdx"
  67. :class="{ 'member-selected': selectedMemberId === (member.userId || member.id) }"
  68. @click="selectAndClose(member)"
  69. >
  70. <text class="member-avatar">{{ (member.nickname || '?').substring(0, 1) }}</text>
  71. <text class="member-name">{{ member.nickname || '未知' }}</text>
  72. </view>
  73. </view>
  74. <!-- 新建成员入口 -->
  75. <view class="create-member-entry" @click="toggleAutoCreate">
  76. <text class="create-member-icon">+</text>
  77. <text class="create-member-text">{{ showAutoCreateForm ? '收起新建表单' : '不在列表中?新建家庭成员' }}</text>
  78. </view>
  79. <!-- 新建成员表单(面板内嵌) -->
  80. <view class="auto-create-inline" v-if="showAutoCreateForm">
  81. <view class="form-item">
  82. <text class="form-item-label">姓名</text>
  83. <input class="form-item-input" v-model="newMember.name" placeholder="请输入姓名" />
  84. </view>
  85. <view class="form-item">
  86. <text class="form-item-label">性别</text>
  87. <view class="gender-selector">
  88. <text class="gender-option" :class="{ 'gender-selected': newMember.gender === 'male' }" @click="newMember.gender = 'male'">男</text>
  89. <text class="gender-option" :class="{ 'gender-selected': newMember.gender === 'female' }" @click="newMember.gender = 'female'">女</text>
  90. </view>
  91. </view>
  92. <view class="form-item">
  93. <text class="form-item-label">年龄</text>
  94. <input class="form-item-input" type="number" v-model="newMember.age" placeholder="请输入年龄" />
  95. </view>
  96. <view class="btn-create-submit" :class="{ 'btn-disabled': creatingMember }" @click="doAutoCreate">
  97. <text v-if="creatingMember">创建中...</text>
  98. <text v-else>确认创建</text>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="field-row" v-if="extractedGender">
  103. <text class="field-label">性别</text>
  104. <text class="field-value">{{ extractedGender === 'male' ? '男' : extractedGender === 'female' ? '女' : extractedGender }}</text>
  105. </view>
  106. <view class="field-row" v-if="extractedAge">
  107. <text class="field-label">年龄</text>
  108. <text class="field-value">{{ extractedAge }}</text>
  109. </view>
  110. <view class="field-row" v-if="payload.summary && payload.type !== 'tongue'">
  111. <text class="field-label">综合评分</text>
  112. <input class="field-input" type="number" v-model="payload.summary.overallScore" />
  113. </view>
  114. <view class="field-row" v-if="payload.summary && payload.type !== 'tongue'">
  115. <text class="field-label">报告日期</text>
  116. <input class="field-input" type="text" v-model="payload.summary.reportDate" placeholder="如: 2025-06-15" />
  117. </view>
  118. <view class="field-row" v-if="payload.summary && payload.type !== 'tongue'">
  119. <text class="field-label">报告摘要</text>
  120. <textarea class="field-textarea" v-model="payload.summary.summary" maxlength="500" />
  121. </view>
  122. </view>
  123. <!-- 舌诊指标(只读展示) -->
  124. <view class="card" v-if="payload.type === 'tongue' && payload.indicators && payload.indicators.length">
  125. <view class="card-title">舌象指标</view>
  126. <view class="tongue-indicator-grid">
  127. <view class="tongue-ind-item" v-for="(ind, idx) in payload.indicators" :key="idx">
  128. <text class="tongue-ind-label">{{ indicatorLabel(ind.code) }}</text>
  129. <text class="tongue-ind-value">{{ ind.value }}</text>
  130. </view>
  131. </view>
  132. <view class="tongue-summary" v-if="payload.summary && payload.summary.overallAssessment">
  133. <text class="tongue-summary-title">综合评估</text>
  134. <text class="tongue-summary-text">{{ payload.summary.overallAssessment }}</text>
  135. </view>
  136. </view>
  137. <!-- 健康指标(舌诊时隐藏,使用上方舌象指标卡片) -->
  138. <view class="card" v-if="payload.type !== 'tongue' && payload.indicators && payload.indicators.length">
  139. <view class="card-title">
  140. <text>健康指标</text>
  141. <text class="title-count">共 {{ payload.indicators.length }} 项</text>
  142. <text class="title-abnormal" v-if="totalAbnormalCount > 0">,{{ totalAbnormalCount }} 项异常</text>
  143. <view class="card-title-actions">
  144. <text class="expand-all-btn" @click="toggleAllGroups(true)">全部展开</text>
  145. <text class="expand-all-btn" @click="toggleAllGroups(false)">全部折叠</text>
  146. </view>
  147. </view>
  148. <!-- 按指标类型分组折叠 -->
  149. <view class="indicator-group" v-for="(group, gIdx) in indicatorGroups" :key="gIdx">
  150. <view class="indicator-group-header" @click="toggleGroup(gIdx)">
  151. <view class="indicator-group-header-left">
  152. <text class="indicator-group-arrow" :class="{ 'arrow-open': groupExpandList[gIdx] }">›</text>
  153. <text class="indicator-group-name">{{ group.category }}</text>
  154. </view>
  155. <view class="indicator-group-header-right">
  156. <text class="indicator-group-abnormal" v-if="group.abnormalCount > 0">{{ group.abnormalCount }} 项异常</text>
  157. <text class="indicator-group-count">{{ group.items.length }} 项</text>
  158. </view>
  159. </view>
  160. <view class="indicator-group-body" v-if="groupExpandList[gIdx]">
  161. <view class="indicator-item" v-for="(ind, idx) in group.items" :key="idx">
  162. <view class="ind-header">
  163. <text class="ind-help-btn" @click.stop="showHelp(ind)">?</text>
  164. <input class="ind-name" :class="'ind-name-' + _cssClass(ind.status)" v-model="ind.indicatorName" />
  165. <input class="ind-value" :class="'ind-value-' + _cssClass(ind.status)" v-model="ind.indicatorValue" />
  166. </view>
  167. <view class="ind-detail" v-if="ind.unit || ind.refRange">
  168. <text class="ind-ref" v-if="ind.refRange">参考: {{ ind.refRange }}</text>
  169. <text class="ind-unit" v-if="ind.unit">{{ ind.unit }}</text>
  170. </view>
  171. <view class="ind-symptoms" v-if="ind.symptoms">
  172. <text class="ind-symptom-label">症状:</text>
  173. <input class="ind-symptom-input" v-model="ind.symptoms" />
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. <!-- 指标帮助弹窗 -->
  180. <view class="help-overlay" v-if="showHelpPopup" @click="closeHelp">
  181. <view class="help-popup" @click.stop>
  182. <view class="help-popup-header">
  183. <text class="help-popup-title">{{ helpData.name }}</text>
  184. <text class="help-popup-close" @click="closeHelp">✕</text>
  185. </view>
  186. <view class="help-popup-body">
  187. <view class="help-row">
  188. <text class="help-label">当前值</text>
  189. <text class="help-value">{{ helpData.value }}</text>
  190. </view>
  191. <view class="help-row" v-if="helpData.refRange">
  192. <text class="help-label">参考范围</text>
  193. <text class="help-value">{{ helpData.refRange }}</text>
  194. </view>
  195. <view class="help-row">
  196. <text class="help-label">状态</text>
  197. <text class="help-value" :class="'help-status-' + _cssClass(helpData.status)">{{ statusText(helpData.status) }}</text>
  198. </view>
  199. <view class="help-desc" v-if="helpData.description">
  200. <text class="help-desc-label">说明</text>
  201. <text class="help-desc-text">{{ helpData.description }}</text>
  202. </view>
  203. <view class="help-desc" v-else>
  204. <text class="help-desc-label">说明</text>
  205. <text class="help-desc-text">{{ getDefaultDescription(helpData.name, helpData.status) }}</text>
  206. </view>
  207. </view>
  208. </view>
  209. </view>
  210. <!-- 肠道菌群 -->
  211. <view class="card" v-if="payload.gutFlora && payload.gutFlora.length">
  212. <view class="card-title">肠道菌群 ({{ payload.gutFlora.length }})</view>
  213. <view class="flora-item" v-for="(flora, idx) in payload.gutFlora" :key="idx">
  214. <input class="flora-name" v-model="payload.gutFlora[idx].name" />
  215. <input class="flora-abundance" type="digit" v-model="payload.gutFlora[idx].abundance" />
  216. <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
  217. {{ statusText(flora.status) }}
  218. </view>
  219. </view>
  220. </view>
  221. <!-- 疾病风险 -->
  222. <view class="card" v-if="payload.diseaseRisks && payload.diseaseRisks.length">
  223. <view class="card-title">疾病风险 ({{ payload.diseaseRisks.length }})</view>
  224. <view class="risk-item" v-for="(risk, idx) in payload.diseaseRisks" :key="idx">
  225. <input class="risk-name" v-model="payload.diseaseRisks[idx].diseaseName" />
  226. <view class="risk-level" :class="'risk-' + (risk.riskLevel || 'low')">
  227. {{ riskLevelText(risk.riskLevel) }}
  228. </view>
  229. </view>
  230. </view>
  231. <!-- 饮食推荐 -->
  232. <view class="card" v-if="payload.foods && payload.foods.length">
  233. <view class="card-title">饮食推荐 ({{ payload.foods.length }})</view>
  234. <view class="food-item" v-for="(food, idx) in payload.foods" :key="idx">
  235. <input class="food-name" v-model="payload.foods[idx].foodName" />
  236. <input class="food-category" v-model="payload.foods[idx].category" />
  237. </view>
  238. </view>
  239. <!-- 益生菌种 -->
  240. <view class="card" v-if="payload.probioticSpecies && payload.probioticSpecies.length">
  241. <view class="card-title">益生菌种 ({{ payload.probioticSpecies.length }})</view>
  242. <view class="flora-item" v-for="(flora, idx) in payload.probioticSpecies" :key="idx">
  243. <input class="flora-name" v-model="payload.probioticSpecies[idx].name" />
  244. <input class="flora-abundance" type="digit" v-model="payload.probioticSpecies[idx].abundance" />
  245. <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
  246. {{ statusText(flora.status) }}
  247. </view>
  248. </view>
  249. </view>
  250. <!-- Taxonomy 分类(纲/目/科/属/种) -->
  251. <view class="card" v-if="hasTaxonomyData()">
  252. <view class="card-title">菌群分类组成 ({{ taxonomyTotalCount }})</view>
  253. <view class="taxonomy-group" v-if="payload.taxonomyClass && payload.taxonomyClass.length">
  254. <text class="taxonomy-group-label">菌纲 (Class)</text>
  255. <view class="flora-item" v-for="(flora, idx) in payload.taxonomyClass" :key="getTaxonomyKey('c', idx)">
  256. <input class="flora-name" v-model="payload.taxonomyClass[idx].name" />
  257. <input class="flora-abundance" type="digit" v-model="payload.taxonomyClass[idx].abundance" />
  258. </view>
  259. </view>
  260. <view class="taxonomy-group" v-if="payload.taxonomyOrder && payload.taxonomyOrder.length">
  261. <text class="taxonomy-group-label">菌目 (Order)</text>
  262. <view class="flora-item" v-for="(flora, idx) in payload.taxonomyOrder" :key="getTaxonomyKey('o', idx)">
  263. <input class="flora-name" v-model="payload.taxonomyOrder[idx].name" />
  264. <input class="flora-abundance" type="digit" v-model="payload.taxonomyOrder[idx].abundance" />
  265. </view>
  266. </view>
  267. <view class="taxonomy-group" v-if="payload.taxonomyFamily && payload.taxonomyFamily.length">
  268. <text class="taxonomy-group-label">菌科 (Family)</text>
  269. <view class="flora-item" v-for="(flora, idx) in payload.taxonomyFamily" :key="getTaxonomyKey('f', idx)">
  270. <input class="flora-name" v-model="payload.taxonomyFamily[idx].name" />
  271. <input class="flora-abundance" type="digit" v-model="payload.taxonomyFamily[idx].abundance" />
  272. </view>
  273. </view>
  274. <view class="taxonomy-group" v-if="payload.taxonomyGenus && payload.taxonomyGenus.length">
  275. <text class="taxonomy-group-label">菌属 (Genus)</text>
  276. <view class="flora-item" v-for="(flora, idx) in payload.taxonomyGenus" :key="getTaxonomyKey('g', idx)">
  277. <input class="flora-name" v-model="payload.taxonomyGenus[idx].name" />
  278. <input class="flora-abundance" type="digit" v-model="payload.taxonomyGenus[idx].abundance" />
  279. </view>
  280. </view>
  281. <view class="taxonomy-group" v-if="payload.taxonomySpecies && payload.taxonomySpecies.length">
  282. <text class="taxonomy-group-label">菌种 (Species)</text>
  283. <view class="flora-item" v-for="(flora, idx) in payload.taxonomySpecies" :key="getTaxonomyKey('s', idx)">
  284. <input class="flora-name" v-model="payload.taxonomySpecies[idx].name" />
  285. <input class="flora-abundance" type="digit" v-model="payload.taxonomySpecies[idx].abundance" />
  286. </view>
  287. </view>
  288. </view>
  289. <!-- 病原菌 -->
  290. <view class="card" v-if="hasPathogenData()">
  291. <view class="card-title">病原菌 ({{ pathogenTotalCount }})</view>
  292. <view class="pathogen-group" v-if="payload.pathogenGenus && payload.pathogenGenus.length">
  293. <text class="pathogen-group-label">病原菌属</text>
  294. <view class="flora-item" v-for="(flora, idx) in payload.pathogenGenus" :key="getTaxonomyKey('pg', idx)">
  295. <input class="flora-name" v-model="payload.pathogenGenus[idx].name" />
  296. <input class="flora-abundance" type="digit" v-model="payload.pathogenGenus[idx].abundance" />
  297. <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
  298. {{ statusText(flora.status) }}
  299. </view>
  300. </view>
  301. </view>
  302. <view class="pathogen-group" v-if="payload.pathogenDetection && payload.pathogenDetection.length">
  303. <text class="pathogen-group-label">病原菌检出</text>
  304. <view class="flora-item" v-for="(flora, idx) in payload.pathogenDetection" :key="getTaxonomyKey('pd', idx)">
  305. <input class="flora-name" v-model="payload.pathogenDetection[idx].name" />
  306. <input class="flora-abundance" type="digit" v-model="payload.pathogenDetection[idx].abundance" />
  307. <view class="status-tag" :class="'status-' + _cssClass(flora.status)">
  308. {{ statusText(flora.status) }}
  309. </view>
  310. </view>
  311. </view>
  312. </view>
  313. <!-- 操作按钮 -->
  314. <view class="action-row">
  315. <view class="btn-discard" @click="doDiscard">
  316. <text>放弃</text>
  317. </view>
  318. <view class="btn-confirm" :class="{ 'btn-disabled': !canConfirm }" @click="doConfirm">
  319. <text v-if="confirming">确认中...</text>
  320. <text v-else>确认入库</text>
  321. </view>
  322. </view>
  323. </view>
  324. <!-- 报告快速分析入口(解析完成、非解析中) -->
  325. <view class="quick-analyze-fab" v-if="!parsing && draftId" @tap="openQuickAnalyze">
  326. <text class="quick-analyze-fab-icon">🎯</text>
  327. <text class="quick-analyze-fab-text">快速分析</text>
  328. </view>
  329. <!-- 快速分析浮层 -->
  330. <view class="quick-analyze-overlay" v-if="quickAnalyze.show" @tap="closeQuickAnalyze"></view>
  331. <view class="quick-analyze-panel" v-if="quickAnalyze.show">
  332. <view class="quick-analyze-header">
  333. <text class="quick-analyze-title">报告快速分析</text>
  334. <text class="quick-analyze-close" @tap="closeQuickAnalyze">✕</text>
  335. </view>
  336. <view class="quick-analyze-hint" v-if="quickAnalyze.usedToday">免费版今日次数已用完,升级会员解锁更多分析</view>
  337. <scroll-view class="quick-analyze-messages" scroll-y>
  338. <view class="quick-analyze-message" v-for="(msg, qidx) in quickAnalyze.messages" :key="qidx" :class="'msg-' + msg.role">
  339. <text class="quick-analyze-msg-text">{{ msg.content }}</text>
  340. </view>
  341. <view class="quick-analyze-loading" v-if="quickAnalyze.sending">
  342. <text class="quick-analyze-loading-text">AI 正在分析中...</text>
  343. </view>
  344. </scroll-view>
  345. <view class="quick-analyze-chips" v-if="quickAnalyze.messages.length === 0">
  346. <view class="quick-analyze-chip" v-for="(q, qi) in quickQuestions" :key="qi" @tap="sendQuickQuestion(q)">
  347. <text class="quick-analyze-chip-text">{{ q }}</text>
  348. </view>
  349. </view>
  350. <view class="quick-analyze-input-bar">
  351. <input class="quick-analyze-input" v-model="quickAnalyze.inputText" placeholder="输入你想问的问题..."
  352. :disabled="quickAnalyze.sending || quickAnalyze.usedToday" confirm-type="send" @confirm="sendQuickAnalyze" />
  353. <view class="quick-analyze-send" :class="{ 'send-disabled': quickAnalyze.sending || quickAnalyze.usedToday }" @tap="sendQuickAnalyze">
  354. <text class="quick-analyze-send-text">发送</text>
  355. </view>
  356. </view>
  357. </view>
  358. <view class="bottom-spacer"></view>
  359. </view>
  360. </template>
  361. <script>
  362. import { confirmReportPreview, discardReportDraft, confirmTongue, discardTongue, parseReportDraft, reportQuickAnalyze, getMyMembership } from '../../utils/api.js'
  363. import { addFamilyMember, getFamilyMemberList } from '../../utils/api.js'
  364. export default {
  365. data() {
  366. return {
  367. draftId: null,
  368. memberId: null,
  369. familyId: null,
  370. payload: {
  371. summary: {},
  372. indicators: [],
  373. gutFlora: [],
  374. probioticSpecies: [],
  375. taxonomyClass: [],
  376. taxonomyOrder: [],
  377. taxonomyFamily: [],
  378. taxonomyGenus: [],
  379. taxonomySpecies: [],
  380. pathogenGenus: [],
  381. pathogenDetection: [],
  382. foods: [],
  383. diseaseRisks: []
  384. },
  385. extractedName: '',
  386. extractedGender: '',
  387. extractedAge: '',
  388. // 报告快速分析浮层
  389. quickAnalyze: {
  390. show: false,
  391. sending: false,
  392. messages: [],
  393. inputText: '',
  394. conversationId: '',
  395. usedToday: false,
  396. checkingMembership: false
  397. },
  398. matchedMemberId: null,
  399. needBind: false,
  400. selectedMemberId: null,
  401. familyMembers: [],
  402. confirming: false,
  403. // 仅 draftId 模式(从上传页跳转)下正在解析
  404. parsing: false,
  405. // Phase 2: 匹配可信度与候选
  406. matchConfidence: null,
  407. matchLabel: '',
  408. candidates: [],
  409. // 被检测人选择面板
  410. showMemberPanel: false,
  411. selectedMemberObj: null,
  412. // 新建成员
  413. showAutoCreateForm: false,
  414. newMember: {
  415. name: '',
  416. gender: '',
  417. age: ''
  418. },
  419. creatingMember: false,
  420. createdMemberId: null,
  421. // 指标分组折叠状态(按分组下标,默认全部折叠)
  422. groupExpandList: [],
  423. // 指标帮助弹窗
  424. showHelpPopup: false,
  425. helpData: { name: '', value: '', refRange: '', status: '', description: '' }
  426. }
  427. },
  428. computed: {
  429. canConfirm() {
  430. if (this.parsing) return false
  431. if (this.needBind && !this.selectedMemberId && !this.createdMemberId) return false
  432. return this.draftId && !this.confirming
  433. },
  434. confidenceLevelClass() {
  435. if (!this.matchConfidence && this.matchConfidence !== 0) return ''
  436. var val = parseFloat(this.matchConfidence)
  437. if (this.matchLabel === 'exact' || val >= 0.8) return 'high'
  438. if (this.matchLabel === 'fuzzy' || val >= 0.5) return 'medium'
  439. if (this.matchLabel === 'profile_match' || val >= 0.2) return 'low'
  440. return 'none'
  441. },
  442. confidenceLevelText() {
  443. var map = { high: '高', medium: '中', low: '低', none: '未匹配' }
  444. return map[this.confidenceLevelClass] || ''
  445. },
  446. confidencePercent() {
  447. if (!this.matchConfidence && this.matchConfidence !== 0) return 0
  448. return Math.round(parseFloat(this.matchConfidence) * 100)
  449. },
  450. confidenceDesc() {
  451. if (this.matchLabel === 'exact') return '根据姓名、性别、年龄自动精确匹配到家庭成员'
  452. if (this.matchLabel === 'fuzzy') return '部分字段匹配,请确认是否为以下家庭成员'
  453. if (this.matchLabel === 'profile_match') return '根据档案信息推测匹配,请手动确认'
  454. if (this.matchLabel === 'no_match') return '无法匹配到现有家庭成员,可新建成员'
  455. return ''
  456. },
  457. memberDisplayText() {
  458. var m = this.selectedMemberObj
  459. if (m && (m.nickname || m.name)) return m.nickname || m.name
  460. if (this.needBind) return '需手动绑定'
  461. return this.extractedName || '未识别'
  462. },
  463. quickQuestions: function() {
  464. return [
  465. '这份报告最需要关注哪些异常指标?',
  466. '报告中提示了哪些健康风险?',
  467. '有哪些改善建议?'
  468. ]
  469. },
  470. /** 全量成员减去候选区已展示的成员,避免重复 */
  471. otherMembers() {
  472. var candIds = {}
  473. for (var i = 0; i < this.candidates.length; i++) {
  474. var c = this.candidates[i]
  475. var cid = c.id || c.userId
  476. if (cid !== null && cid !== undefined) candIds[cid] = true
  477. }
  478. var list = []
  479. for (var j = 0; j < this.familyMembers.length; j++) {
  480. var m = this.familyMembers[j]
  481. var mid = m.userId || m.id
  482. if (mid !== null && mid !== undefined && candIds[mid]) continue
  483. list.push(m)
  484. }
  485. return list
  486. },
  487. // 指标按类型(category)分组,保持解析顺序,统计需处理(非正常)数量
  488. indicatorGroups() {
  489. var groups = []
  490. var orderMap = {}
  491. var list = (this.payload && this.payload.indicators) || []
  492. for (var i = 0; i < list.length; i++) {
  493. var ind = list[i]
  494. var cat = ind.category || '其他指标'
  495. if (!orderMap[cat]) {
  496. orderMap[cat] = groups.length
  497. groups.push({ category: cat, items: [], needCount: 0, abnormalCount: 0 })
  498. }
  499. var group = groups[orderMap[cat]]
  500. group.items.push(ind)
  501. if (this.isAbnormalStatus(ind.status)) {
  502. group.needCount++
  503. group.abnormalCount++
  504. }
  505. }
  506. return groups
  507. },
  508. totalAbnormalCount() {
  509. var list = (this.payload && this.payload.indicators) || []
  510. var count = 0
  511. for (var i = 0; i < list.length; i++) {
  512. if (this.isAbnormalStatus(list[i].status)) count++
  513. }
  514. return count
  515. },
  516. taxonomyTotalCount() {
  517. var total = 0
  518. total += (this.payload.taxonomyClass || []).length
  519. total += (this.payload.taxonomyOrder || []).length
  520. total += (this.payload.taxonomyFamily || []).length
  521. total += (this.payload.taxonomyGenus || []).length
  522. total += (this.payload.taxonomySpecies || []).length
  523. return total
  524. },
  525. pathogenTotalCount() {
  526. return (this.payload.pathogenGenus || []).length +
  527. (this.payload.pathogenDetection || []).length
  528. }
  529. },
  530. onLoad: function(options) {
  531. this.draftId = options.draftId ? parseInt(options.draftId) : null
  532. if (this.draftId) {
  533. // gut_flora 走个性化详情页,其他类型走通用详情页
  534. var gotoUrl = '/pages/health/gut-flora-detail?draftId=' + this.draftId
  535. uni.redirectTo({ url: gotoUrl })
  536. return
  537. }
  538. this.memberId = options.memberId ? parseInt(options.memberId) : null
  539. this.familyId = options.familyId ? parseInt(options.familyId) : null
  540. // 仅 draftId 模式(从上传页自动跳转):无 payload 参数 → 调用后端按草稿解析并自动填充
  541. if (this.draftId && !options.payload) {
  542. this.parseByDraftId()
  543. return
  544. }
  545. var payloadStr = decodeURIComponent(options.payload || '{}')
  546. try {
  547. var parsed = typeof payloadStr === 'string' ? JSON.parse(payloadStr) : payloadStr
  548. this.payload = Object.assign({
  549. summary: {},
  550. indicators: [],
  551. gutFlora: [],
  552. probioticSpecies: [],
  553. taxonomyClass: [],
  554. taxonomyOrder: [],
  555. taxonomyFamily: [],
  556. taxonomyGenus: [],
  557. taxonomySpecies: [],
  558. pathogenGenus: [],
  559. pathogenDetection: [],
  560. foods: [],
  561. diseaseRisks: []
  562. }, parsed)
  563. } catch (e) {
  564. console.log('解析payload失败', e)
  565. }
  566. this.extractedName = options.extractedName || ''
  567. this.extractedGender = options.extractedGender || ''
  568. this.extractedAge = options.extractedAge || ''
  569. this.matchedMemberId = options.matchedMemberId ? parseInt(options.matchedMemberId) : null
  570. // 从解析结果填充报告日期
  571. var extractedReportDate = options.extractedReportDate || ''
  572. if (extractedReportDate && this.payload.summary) {
  573. this.payload.summary.reportDate = extractedReportDate
  574. }
  575. this.needBind = options.needBind === 'true' || options.needBind === '1'
  576. this.matchConfidence = options.matchConfidence ? parseFloat(options.matchConfidence) : null
  577. this.matchLabel = decodeURIComponent(options.matchLabel || '')
  578. // 解析候选成员列表
  579. var candidatesStr = decodeURIComponent(options.candidates || '')
  580. if (candidatesStr) {
  581. try {
  582. this.candidates = JSON.parse(candidatesStr)
  583. } catch (e) {
  584. this.candidates = []
  585. }
  586. }
  587. // 始终加载家庭成员(面板始终可点击,needBind=false 也允许改选)
  588. this.loadFamilyMembers()
  589. if (this.needBind) {
  590. // 高置信度且已匹配 → 直接选中
  591. if (this.matchedMemberId && this.matchConfidence >= 0.8) {
  592. this.selectedMemberId = this.matchedMemberId
  593. }
  594. }
  595. },
  596. methods: {
  597. // ===== 报告快速分析 =====
  598. openQuickAnalyze: function() {
  599. this.quickAnalyze.show = true
  600. var self = this
  601. if (self.quickAnalyze.checkingMembership) return
  602. self.quickAnalyze.checkingMembership = true
  603. getMyMembership().then(function(res) {
  604. var level = res.data && res.data.memberLevel
  605. if (level && level !== 'FREE') {
  606. self.quickAnalyze.usedToday = false
  607. }
  608. }).catch(function() {}).finally(function() {
  609. self.quickAnalyze.checkingMembership = false
  610. })
  611. },
  612. closeQuickAnalyze: function() {
  613. this.quickAnalyze.show = false
  614. },
  615. sendQuickQuestion: function(q) {
  616. if (q && q.trim()) {
  617. this.quickAnalyze.inputText = q
  618. this.sendQuickAnalyze()
  619. }
  620. },
  621. sendQuickAnalyze: function() {
  622. var self = this
  623. var text = (this.quickAnalyze.inputText || '').trim()
  624. if (!text || this.quickAnalyze.sending) return
  625. this.quickAnalyze.messages.push({ role: 'user', content: text })
  626. this.quickAnalyze.inputText = ''
  627. this.quickAnalyze.sending = true
  628. reportQuickAnalyze(text, null, this.quickAnalyze.conversationId, this.draftId).then(function(res) {
  629. if (res.code === 200 && res.data) {
  630. self.quickAnalyze.messages.push({ role: 'ai', content: res.data.answer || '(无回答)' })
  631. if (res.data.conversationId) {
  632. self.quickAnalyze.conversationId = res.data.conversationId
  633. }
  634. } else {
  635. var msg = res.message || '分析失败'
  636. if (msg.indexOf('每日仅限') !== -1) {
  637. self.quickAnalyze.usedToday = true
  638. }
  639. self.quickAnalyze.messages.push({ role: 'ai', content: msg })
  640. }
  641. }).catch(function() {
  642. self.quickAnalyze.messages.push({ role: 'ai', content: 'AI 服务暂不可用,请稍后重试' })
  643. }).finally(function() {
  644. self.quickAnalyze.sending = false
  645. })
  646. },
  647. // 仅 draftId 模式:调用后端按草稿解析,成功后自动填充页面
  648. parseByDraftId() {
  649. var self = this
  650. self.parsing = true
  651. parseReportDraft(self.draftId).then(function(res) {
  652. var detail = res && res.data
  653. if (!detail) {
  654. self.parsing = false
  655. uni.showToast({ title: (res && res.message) || '解析失败,请重试', icon: 'none' })
  656. return
  657. }
  658. self.applyParseResult(detail)
  659. }).catch(function(err) {
  660. self.parsing = false
  661. var msg = (err && err.message) || '解析失败,请重试'
  662. uni.showToast({ title: msg, icon: 'none' })
  663. })
  664. },
  665. // 将后端解析结果应用到页面
  666. applyParseResult(detail) {
  667. this.parsing = false
  668. if (detail.payload) {
  669. this.payload = Object.assign({
  670. summary: {},
  671. indicators: [],
  672. gutFlora: [],
  673. probioticSpecies: [],
  674. taxonomyClass: [],
  675. taxonomyOrder: [],
  676. taxonomyFamily: [],
  677. taxonomyGenus: [],
  678. taxonomySpecies: [],
  679. pathogenGenus: [],
  680. pathogenDetection: [],
  681. foods: [],
  682. diseaseRisks: []
  683. }, detail.payload)
  684. }
  685. this.extractedName = detail.extractedName || ''
  686. this.extractedGender = detail.extractedGender || ''
  687. this.extractedAge = detail.extractedAge || ''
  688. this.matchedMemberId = detail.matchedMemberId ? parseInt(detail.matchedMemberId) : null
  689. this.needBind = !!detail.needBind
  690. this.matchConfidence = detail.confidence !== undefined && detail.confidence !== null ? parseFloat(detail.confidence) : null
  691. this.matchLabel = detail.matchLabel || ''
  692. this.candidates = detail.candidates || []
  693. // 始终加载家庭成员
  694. this.loadFamilyMembers()
  695. // 高置信度且已匹配 → 直接选中
  696. if (this.needBind && this.matchedMemberId && this.matchConfidence >= 0.8) {
  697. this.selectedMemberId = this.matchedMemberId
  698. }
  699. },
  700. loadFamilyMembers() {
  701. var self = this
  702. // 从后端获取真实家庭成员(家长 + 孩子),storage 中并无该数据
  703. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  704. var list = (res && res.data) || []
  705. var parents = list.filter(function(m) { return m.source === 'parent' }).map(function(p) {
  706. return { id: p.id, nickname: p.nickname, gender: p.gender, role: 'parent' }
  707. })
  708. var children = list.filter(function(m) { return m.source !== 'parent' }).map(function(c) {
  709. return { id: c.id, nickname: c.nickname, gender: c.gender, age: c.age, role: 'child' }
  710. })
  711. self.familyMembers = parents.concat(children)
  712. self.syncSelectedMemberObj()
  713. }).catch(function(e) {
  714. console.log('加载家庭成员失败', e)
  715. self.familyMembers = []
  716. })
  717. },
  718. toggleMemberPanel() {
  719. this.showMemberPanel = !this.showMemberPanel
  720. if (!this.showMemberPanel) {
  721. this.showAutoCreateForm = false
  722. }
  723. },
  724. selectAndClose(member) {
  725. var memberId = member.id || member.userId
  726. this.selectedMemberId = memberId
  727. this.selectedMemberObj = member
  728. this.extractedName = member.nickname || member.name || this.extractedName
  729. this.extractedGender = member.gender || this.extractedGender
  730. this.extractedAge = member.age || this.extractedAge
  731. this.showAutoCreateForm = false
  732. this.showMemberPanel = false
  733. },
  734. syncSelectedMemberObj() {
  735. if (!this.selectedMemberId) {
  736. this.selectedMemberObj = null
  737. return
  738. }
  739. var all = this.familyMembers.concat(this.candidates)
  740. for (var i = 0; i < all.length; i++) {
  741. var m = all[i]
  742. if ((m.id || m.userId) === this.selectedMemberId) {
  743. this.selectedMemberObj = m
  744. return
  745. }
  746. }
  747. },
  748. // === Phase 2: 候选匹配与新建成员 ===
  749. genderText(gender) {
  750. if (gender === 'male') return '男'
  751. if (gender === 'female') return '女'
  752. return gender || ''
  753. },
  754. toggleAutoCreate() {
  755. this.showAutoCreateForm = !this.showAutoCreateForm
  756. if (this.showAutoCreateForm) {
  757. this.newMember.name = this.extractedName || ''
  758. this.newMember.gender = this.extractedGender || ''
  759. this.newMember.age = this.extractedAge || ''
  760. this.selectedMemberId = null
  761. }
  762. },
  763. doAutoCreate() {
  764. var self = this
  765. if (!this.newMember.name) {
  766. uni.showToast({ title: '请输入成员姓名', icon: 'none' })
  767. return
  768. }
  769. self.creatingMember = true
  770. uni.showLoading({ title: '创建成员...' })
  771. addFamilyMember({
  772. nickname: self.newMember.name,
  773. gender: self.newMember.gender || '',
  774. age: self.newMember.age ? parseInt(self.newMember.age) : null
  775. }).then(function(res) {
  776. uni.hideLoading()
  777. if (res.code === 200) {
  778. var memberId = res.data && (res.data.userId || res.data.id)
  779. if (memberId) {
  780. self.createdMemberId = memberId
  781. self.selectedMemberId = memberId
  782. self.selectedMemberObj = {
  783. id: memberId,
  784. nickname: self.newMember.name,
  785. gender: self.newMember.gender,
  786. age: self.newMember.age
  787. }
  788. self.extractedName = self.newMember.name
  789. self.extractedGender = self.newMember.gender
  790. self.extractedAge = self.newMember.age
  791. self.showAutoCreateForm = false
  792. self.showMemberPanel = false
  793. uni.showToast({ title: '创建成功', icon: 'success' })
  794. }
  795. } else {
  796. uni.showToast({ title: res.message || '创建失败', icon: 'none' })
  797. }
  798. }).catch(function(e) {
  799. uni.hideLoading()
  800. uni.showToast({ title: '创建失败', icon: 'none' })
  801. }).finally(function() {
  802. self.creatingMember = false
  803. })
  804. },
  805. toggleGroup(gIdx) {
  806. this.$set(this.groupExpandList, gIdx, !this.groupExpandList[gIdx])
  807. },
  808. toggleAllGroups(expand) {
  809. var arr = []
  810. for (var i = 0; i < this.indicatorGroups.length; i++) {
  811. arr.push(expand)
  812. }
  813. this.groupExpandList = arr
  814. },
  815. _cssClass(status) {
  816. var map = { 'high': 'high', 'low': 'low', 'abnormal': 'abnormal', 'normal': 'normal', '缺乏': 'deficient', '偏低': 'low', '不足': 'insufficient', '正常': 'normal', '注意': 'warning', '偏高': 'high', '异常': 'abnormal', '高风险': 'high-risk', '低风险': 'low-risk', '未检出': 'not-detected' }
  817. return map[status] || 'normal'
  818. },
  819. statusText(status) {
  820. if (status === 'high' || status === '偏高') return '偏高'
  821. if (status === 'low' || status === '偏低') return '偏低'
  822. if (status === 'abnormal' || status === '异常') return '异常'
  823. if (status === '缺乏') return '缺乏'
  824. if (status === '不足') return '不足'
  825. if (status === '正常') return '正常'
  826. if (status === '注意') return '注意'
  827. if (status === '高风险') return '高风险'
  828. if (status === '低风险') return '低风险'
  829. if (status === '未检出') return '未检出'
  830. return '正常'
  831. },
  832. // 与 _cssClass 保持同一白名单:仅明确异常/需关注的状态计入异常数,
  833. // 未知状态文本(解析器自由提取)一律视为正常,避免"样式正常却计入异常"的矛盾。
  834. isAbnormalStatus(status) {
  835. if (!status) return false
  836. var abnormalMap = { 'high': 1, 'low': 1, 'abnormal': 1, '偏高': 1, '偏低': 1, '异常': 1, '缺乏': 1, '不足': 1, '注意': 1, '高风险': 1 }
  837. return !!abnormalMap[String(status).trim()]
  838. },
  839. showHelp(ind) {
  840. this.helpData = {
  841. name: ind.indicatorName || ind.name || '',
  842. value: ind.indicatorValue || ind.value || '',
  843. refRange: ind.refRange || ind.normalRange || '',
  844. status: ind.status || 'normal',
  845. description: ind.description || ind.symptoms || ''
  846. }
  847. this.showHelpPopup = true
  848. },
  849. closeHelp() {
  850. this.showHelpPopup = false
  851. },
  852. getDefaultDescription(name, status) {
  853. if (!status || status === 'normal') return '该指标处于正常范围内,无需特别关注。'
  854. if (status === 'high' || status === '偏高') return '该指标偏高,建议咨询专业医生或营养师进行进一步评估。'
  855. if (status === 'low' || status === '偏低') return '该指标偏低,建议咨询专业医生或营养师进行进一步评估。'
  856. if (status === '缺乏' || status === '不足') return '该指标不足,建议通过饮食或补充剂适当补充。'
  857. if (status === 'abnormal') return '该指标异常,建议咨询专业医生进行详细检查。'
  858. if (status === '注意') return '该指标需要关注,建议定期监测并咨询专业人士。'
  859. return '请参考专业医生的建议进行解读。'
  860. },
  861. riskLevelText(level) {
  862. if (level === 'high') return '高风险'
  863. if (level === 'medium' || level === 'moderate') return '中风险'
  864. return '低风险'
  865. },
  866. doConfirm() {
  867. if (!this.canConfirm) return
  868. var self = this
  869. self.confirming = true
  870. uni.showLoading({ title: '确认入库并生成方案...' })
  871. var postData = {
  872. draftId: self.draftId,
  873. payload: self.payload
  874. }
  875. // 优先级: 已选成员 > 新建成员 > 自动匹配(高置信度) > 子ID
  876. if (self.selectedMemberId) {
  877. postData.subjectId = self.selectedMemberId
  878. } else if (self.createdMemberId) {
  879. postData.subjectId = self.createdMemberId
  880. } else if (self.matchedMemberId) {
  881. postData.subjectId = self.matchedMemberId
  882. } else if (self.memberId) {
  883. postData.subjectId = self.memberId
  884. }
  885. var confirmFn = self.payload.type === 'tongue' ? confirmTongue : confirmReportPreview
  886. confirmFn(postData).then(function(res) {
  887. uni.hideLoading()
  888. if (res.code === 200) {
  889. var data = res.data || {}
  890. var reportId = data.reportId || (data.report && data.report.id)
  891. var planId = data.planId
  892. var goReport = function() {
  893. if (!reportId) {
  894. uni.navigateBack()
  895. return
  896. }
  897. var reportType = data.reportType || ''
  898. var gotoUrl
  899. if (reportType === 'gut_flora') {
  900. gotoUrl = '/pages/health/gut-flora-detail?reportId=' + reportId
  901. } else if (reportType === 'dan') {
  902. gotoUrl = '/pages/dan-assessment/report-result?reportId=' + reportId
  903. } else {
  904. gotoUrl = '/pages/health/report-detail?reportType=' + reportType + '&reportId=' + reportId
  905. }
  906. uni.redirectTo({ url: gotoUrl })
  907. }
  908. if (reportId && planId) {
  909. uni.showModal({
  910. title: '报告已入库',
  911. content: '方案已自动生成,是否立即查看并确认任务?',
  912. confirmText: '查看方案',
  913. cancelText: '看报告',
  914. success: function(modalRes) {
  915. if (modalRes.confirm) {
  916. uni.redirectTo({ url: '/pages/health/health-plan-summary?planId=' + planId })
  917. } else {
  918. goReport()
  919. }
  920. }
  921. })
  922. } else if (reportId) {
  923. uni.showToast({ title: '入库成功', icon: 'success' })
  924. setTimeout(goReport, 500)
  925. } else {
  926. uni.navigateBack()
  927. }
  928. } else {
  929. uni.showToast({ title: res.message || '确认失败', icon: 'none' })
  930. }
  931. }).catch(function(e) {
  932. uni.hideLoading()
  933. uni.showToast({ title: '确认失败,请重试', icon: 'none' })
  934. console.log('确认入库失败', e)
  935. }).finally(function() {
  936. self.confirming = false
  937. })
  938. },
  939. doDiscard() {
  940. var self = this
  941. uni.showModal({
  942. title: '确认放弃',
  943. content: '放弃后解析数据将被删除,需要重新上传',
  944. success: function(res) {
  945. if (res.confirm) {
  946. var discardFn = self.payload.type === 'tongue' ? discardTongue : discardReportDraft
  947. discardFn(self.draftId).then(function() {
  948. uni.showToast({ title: '已放弃', icon: 'none' })
  949. setTimeout(function() { uni.navigateBack() }, 500)
  950. }).catch(function() {
  951. uni.showToast({ title: '操作失败', icon: 'none' })
  952. })
  953. }
  954. }
  955. })
  956. },
  957. goBack() {
  958. uni.navigateBack()
  959. },
  960. hasTaxonomyData() {
  961. return this.taxonomyTotalCount > 0
  962. },
  963. hasPathogenData() {
  964. return this.pathogenTotalCount > 0
  965. },
  966. // taxonomy/病原菌列表 key(微信小程序禁止 :key 表达式)
  967. getTaxonomyKey(prefix, idx) {
  968. return prefix + idx
  969. },
  970. // 舌诊指标标签映射
  971. indicatorLabel(code) {
  972. var map = {
  973. 'tongue_color': '舌色',
  974. 'coating_color': '苔色',
  975. 'coating_texture': '苔质',
  976. 'fissure': '裂纹',
  977. 'teeth_mark': '齿痕',
  978. 'sublingual_vein': '舌下静脉',
  979. 'constitution': '体质'
  980. }
  981. return map[code] || code
  982. }
  983. }
  984. }
  985. </script>
  986. <style scoped>
  987. .confirm-container {
  988. min-height: 100vh;
  989. background: #F5F7FA;
  990. }
  991. .nav-placeholder { width: 80rpx; }
  992. .tip-banner {
  993. display: flex;
  994. flex-direction: row;
  995. align-items: center;
  996. background: #E8F5E9;
  997. margin: 20rpx 30rpx;
  998. padding: 20rpx 24rpx;
  999. border-radius: 16rpx;
  1000. }
  1001. .tip-icon { font-size: 32rpx; margin-right: 16rpx; flex-shrink: 0; }
  1002. .tip-text { font-size: 24rpx; color: #2E7D32; line-height: 1.5; }
  1003. .parsing-banner {
  1004. display: flex;
  1005. flex-direction: row;
  1006. align-items: center;
  1007. background: #FFF8E1;
  1008. margin: 0 30rpx 20rpx;
  1009. padding: 20rpx 24rpx;
  1010. border-radius: 16rpx;
  1011. }
  1012. .parsing-icon { font-size: 32rpx; margin-right: 16rpx; flex-shrink: 0; }
  1013. .parsing-text { font-size: 24rpx; color: #F57F17; line-height: 1.5; }
  1014. .form-section { margin: 0 30rpx; }
  1015. .card {
  1016. background: #fff;
  1017. border-radius: 16rpx;
  1018. padding: 24rpx;
  1019. margin-bottom: 20rpx;
  1020. box-shadow: 0 2rpx 6rpx rgba(0,0,0,0.04);
  1021. }
  1022. .card-title {
  1023. font-size: 28rpx;
  1024. font-weight: bold;
  1025. color: #333;
  1026. margin-bottom: 20rpx;
  1027. padding-bottom: 12rpx;
  1028. border-bottom: 2rpx solid #F0F0F0;
  1029. display: flex;
  1030. flex-direction: row;
  1031. align-items: center;
  1032. flex-wrap: wrap;
  1033. gap: 4rpx;
  1034. }
  1035. .title-count {
  1036. font-size: 24rpx;
  1037. font-weight: normal;
  1038. color: #94A3B8;
  1039. margin-left: 8rpx;
  1040. }
  1041. .title-abnormal {
  1042. font-size: 24rpx;
  1043. font-weight: normal;
  1044. color: #C62828;
  1045. }
  1046. .card-title-actions {
  1047. margin-left: auto;
  1048. display: flex;
  1049. flex-direction: row;
  1050. gap: 16rpx;
  1051. }
  1052. .expand-all-btn {
  1053. font-size: 22rpx;
  1054. color: #5B9BD5;
  1055. padding: 4rpx 12rpx;
  1056. border: 2rpx solid #5B9BD5;
  1057. border-radius: 20rpx;
  1058. }
  1059. .expand-all-btn:active { opacity: 0.7; }
  1060. /* ===== 指标分组折叠 ===== */
  1061. .indicator-group {
  1062. border: 2rpx solid #E8EDF2;
  1063. border-radius: 12rpx;
  1064. margin-bottom: 12rpx;
  1065. overflow: hidden;
  1066. }
  1067. .indicator-group-header {
  1068. display: flex;
  1069. flex-direction: row;
  1070. align-items: center;
  1071. justify-content: space-between;
  1072. padding: 20rpx 16rpx;
  1073. background: #F1F5F9;
  1074. }
  1075. .indicator-group-header:active { opacity: 0.8; }
  1076. .indicator-group-header-left {
  1077. display: flex;
  1078. flex-direction: row;
  1079. align-items: center;
  1080. flex: 1;
  1081. min-width: 0;
  1082. }
  1083. .indicator-group-arrow {
  1084. font-size: 30rpx;
  1085. color: #94A3B8;
  1086. margin-right: 12rpx;
  1087. transform: rotate(0deg);
  1088. transition: transform 0.2s ease;
  1089. flex-shrink: 0;
  1090. }
  1091. .indicator-group-arrow.arrow-open {
  1092. transform: rotate(90deg);
  1093. }
  1094. .indicator-group-name {
  1095. font-size: 26rpx;
  1096. color: #333;
  1097. font-weight: 600;
  1098. flex: 1;
  1099. min-width: 0;
  1100. white-space: nowrap;
  1101. overflow: hidden;
  1102. text-overflow: ellipsis;
  1103. }
  1104. .indicator-group-header-right {
  1105. display: flex;
  1106. flex-direction: row;
  1107. align-items: center;
  1108. gap: 12rpx;
  1109. flex-shrink: 0;
  1110. margin-left: 12rpx;
  1111. }
  1112. .indicator-group-need {
  1113. font-size: 20rpx;
  1114. color: #E65100;
  1115. background: #FFF3E0;
  1116. padding: 4rpx 12rpx;
  1117. border-radius: 20rpx;
  1118. font-weight: 500;
  1119. }
  1120. .indicator-group-count {
  1121. font-size: 22rpx;
  1122. color: #94A3B8;
  1123. }
  1124. .indicator-group-abnormal {
  1125. font-size: 22rpx;
  1126. color: #C62828;
  1127. font-weight: 500;
  1128. margin-right: 8rpx;
  1129. }
  1130. .indicator-group-body {
  1131. padding: 16rpx;
  1132. }
  1133. .field-row {
  1134. display: flex;
  1135. flex-direction: row;
  1136. align-items: center;
  1137. margin-bottom: 16rpx;
  1138. }
  1139. .field-label {
  1140. font-size: 26rpx;
  1141. color: #666;
  1142. width: 160rpx;
  1143. flex-shrink: 0;
  1144. }
  1145. .field-value {
  1146. font-size: 26rpx;
  1147. color: #333;
  1148. font-weight: 500;
  1149. flex: 1;
  1150. }
  1151. .field-value.binding-required {
  1152. color: #E65100;
  1153. }
  1154. .member-select-row {
  1155. cursor: pointer;
  1156. }
  1157. .member-select-row:active {
  1158. opacity: 0.7;
  1159. }
  1160. .member-select-arrow {
  1161. font-size: 24rpx;
  1162. color: #5B9BD5;
  1163. margin-left: 12rpx;
  1164. flex-shrink: 0;
  1165. }
  1166. .member-panel {
  1167. background: #F8FAFB;
  1168. border-radius: 12rpx;
  1169. padding: 16rpx;
  1170. margin: 8rpx 0 16rpx;
  1171. }
  1172. .auto-create-inline {
  1173. margin-top: 16rpx;
  1174. padding-top: 16rpx;
  1175. border-top: 2rpx solid #E3F2FD;
  1176. }
  1177. .field-input {
  1178. flex: 1;
  1179. font-size: 26rpx;
  1180. color: #333;
  1181. padding: 8rpx 16rpx;
  1182. background: #F5F7FA;
  1183. border-radius: 8rpx;
  1184. }
  1185. .field-textarea {
  1186. width: 100%;
  1187. min-height: 120rpx;
  1188. font-size: 26rpx;
  1189. color: #333;
  1190. padding: 16rpx;
  1191. background: #F5F7FA;
  1192. border-radius: 12rpx;
  1193. box-sizing: border-box;
  1194. margin-top: 8rpx;
  1195. }
  1196. .member-list {
  1197. display: flex;
  1198. flex-direction: row;
  1199. flex-wrap: wrap;
  1200. gap: 16rpx;
  1201. }
  1202. .member-list-hint {
  1203. width: 100%;
  1204. font-size: 24rpx;
  1205. color: #999;
  1206. margin-bottom: 8rpx;
  1207. }
  1208. .member-item {
  1209. display: flex;
  1210. flex-direction: column;
  1211. align-items: center;
  1212. padding: 20rpx 24rpx;
  1213. background: #F5F7FA;
  1214. border-radius: 16rpx;
  1215. border: 2rpx solid transparent;
  1216. min-width: 120rpx;
  1217. }
  1218. .member-selected {
  1219. background: #E3F2FD;
  1220. border-color: #5B9BD5;
  1221. }
  1222. .member-avatar {
  1223. width: 64rpx;
  1224. height: 64rpx;
  1225. border-radius: 50%;
  1226. background: #5B9BD5;
  1227. color: #fff;
  1228. font-size: 28rpx;
  1229. font-weight: bold;
  1230. text-align: center;
  1231. line-height: 64rpx;
  1232. margin-bottom: 8rpx;
  1233. }
  1234. .member-name { font-size: 24rpx; color: #333; }
  1235. .indicator-item {
  1236. background: #F8FAFB;
  1237. border-radius: 12rpx;
  1238. padding: 16rpx;
  1239. margin-bottom: 12rpx;
  1240. }
  1241. .ind-header {
  1242. display: flex;
  1243. flex-direction: row;
  1244. align-items: center;
  1245. gap: 12rpx;
  1246. }
  1247. .ind-name {
  1248. flex: 1;
  1249. font-size: 26rpx;
  1250. color: #333;
  1251. font-weight: 500;
  1252. padding: 4rpx 8rpx;
  1253. background: #fff;
  1254. border-radius: 6rpx;
  1255. }
  1256. .ind-value {
  1257. width: 160rpx;
  1258. font-size: 26rpx;
  1259. color: #1565C0;
  1260. font-weight: bold;
  1261. text-align: right;
  1262. padding: 4rpx 8rpx;
  1263. background: #fff;
  1264. border-radius: 6rpx;
  1265. }
  1266. .ind-detail {
  1267. display: flex;
  1268. flex-direction: row;
  1269. margin-top: 8rpx;
  1270. gap: 16rpx;
  1271. }
  1272. .ind-ref { font-size: 22rpx; color: #94A3B8; }
  1273. .ind-unit { font-size: 22rpx; color: #64748B; }
  1274. .ind-symptoms {
  1275. display: flex;
  1276. flex-direction: row;
  1277. align-items: center;
  1278. margin-top: 8rpx;
  1279. gap: 8rpx;
  1280. }
  1281. .ind-symptom-label { font-size: 22rpx; color: #94A3B8; flex-shrink: 0; }
  1282. .ind-symptom-input {
  1283. flex: 1;
  1284. font-size: 22rpx;
  1285. color: #333;
  1286. padding: 4rpx 8rpx;
  1287. background: #fff;
  1288. border-radius: 6rpx;
  1289. }
  1290. .status-tag {
  1291. display: inline-block;
  1292. font-size: 20rpx;
  1293. padding: 4rpx 12rpx;
  1294. border-radius: 8rpx;
  1295. font-weight: 500;
  1296. }
  1297. .status-normal { background: #E8F5E9; color: #2E7D32; }
  1298. .status-high { background: #FFF3E0; color: #E65100; }
  1299. .status-low { background: #E3F2FD; color: #1565C0; }
  1300. .status-abnormal { background: #FFEBEE; color: #C62828; }
  1301. /* ===== 指标帮助按钮 ===== */
  1302. .ind-help-btn {
  1303. width: 36rpx;
  1304. height: 36rpx;
  1305. border-radius: 50%;
  1306. background: #E2E8F0;
  1307. color: #64748B;
  1308. font-size: 24rpx;
  1309. font-weight: bold;
  1310. text-align: center;
  1311. line-height: 36rpx;
  1312. flex-shrink: 0;
  1313. }
  1314. .ind-help-btn:active {
  1315. background: #CBD5E1;
  1316. }
  1317. /* ===== 指标输入框颜色状态 ===== */
  1318. .ind-name-normal, .ind-value-normal {
  1319. background: #fff;
  1320. }
  1321. .ind-name-high, .ind-value-high,
  1322. .ind-name-low, .ind-value-low,
  1323. .ind-name-abnormal, .ind-value-abnormal,
  1324. .ind-name-deficient, .ind-value-deficient,
  1325. .ind-name-insufficient, .ind-value-insufficient,
  1326. .ind-name-warning, .ind-value-warning,
  1327. .ind-name-high-risk, .ind-value-high-risk,
  1328. .ind-name-low-risk, .ind-value-low-risk,
  1329. .ind-name-not-detected, .ind-value-not-detected {
  1330. background: #FFF0F0;
  1331. color: #C62828;
  1332. }
  1333. /* ===== 指标帮助弹窗 ===== */
  1334. .help-overlay {
  1335. position: fixed;
  1336. top: 0;
  1337. left: 0;
  1338. right: 0;
  1339. bottom: 0;
  1340. background: rgba(0,0,0,0.4);
  1341. z-index: 999;
  1342. display: flex;
  1343. align-items: center;
  1344. justify-content: center;
  1345. }
  1346. .help-popup {
  1347. width: 580rpx;
  1348. max-height: 70vh;
  1349. background: #fff;
  1350. border-radius: 24rpx;
  1351. overflow: hidden;
  1352. }
  1353. .help-popup-header {
  1354. display: flex;
  1355. flex-direction: row;
  1356. align-items: center;
  1357. justify-content: space-between;
  1358. padding: 28rpx 30rpx;
  1359. border-bottom: 2rpx solid #F0F0F0;
  1360. }
  1361. .help-popup-title {
  1362. font-size: 30rpx;
  1363. font-weight: bold;
  1364. color: #333;
  1365. flex: 1;
  1366. }
  1367. .help-popup-close {
  1368. font-size: 32rpx;
  1369. color: #999;
  1370. padding: 8rpx;
  1371. }
  1372. .help-popup-body {
  1373. padding: 24rpx 30rpx;
  1374. }
  1375. .help-row {
  1376. display: flex;
  1377. flex-direction: row;
  1378. align-items: center;
  1379. margin-bottom: 16rpx;
  1380. }
  1381. .help-label {
  1382. font-size: 26rpx;
  1383. color: #94A3B8;
  1384. width: 140rpx;
  1385. flex-shrink: 0;
  1386. }
  1387. .help-value {
  1388. font-size: 28rpx;
  1389. color: #333;
  1390. font-weight: 500;
  1391. flex: 1;
  1392. }
  1393. .help-status-normal { color: #2E7D32; }
  1394. .help-status-high { color: #C62828; }
  1395. .help-status-low { color: #1565C0; }
  1396. .help-status-abnormal { color: #C62828; }
  1397. .help-desc {
  1398. margin-top: 8rpx;
  1399. padding: 20rpx;
  1400. background: #F8FAFB;
  1401. border-radius: 12rpx;
  1402. }
  1403. .help-desc-label {
  1404. display: block;
  1405. font-size: 24rpx;
  1406. color: #94A3B8;
  1407. margin-bottom: 8rpx;
  1408. }
  1409. .help-desc-text {
  1410. display: block;
  1411. font-size: 26rpx;
  1412. color: #333;
  1413. line-height: 1.6;
  1414. }
  1415. .flora-item {
  1416. display: flex;
  1417. flex-direction: row;
  1418. align-items: center;
  1419. gap: 12rpx;
  1420. padding: 12rpx 16rpx;
  1421. background: #F8FAFB;
  1422. border-radius: 10rpx;
  1423. margin-bottom: 8rpx;
  1424. }
  1425. .flora-name {
  1426. flex: 1;
  1427. font-size: 26rpx;
  1428. color: #333;
  1429. padding: 4rpx 8rpx;
  1430. background: #fff;
  1431. border-radius: 6rpx;
  1432. }
  1433. .flora-abundance {
  1434. width: 140rpx;
  1435. font-size: 26rpx;
  1436. color: #1565C0;
  1437. text-align: right;
  1438. padding: 4rpx 8rpx;
  1439. background: #fff;
  1440. border-radius: 6rpx;
  1441. }
  1442. .taxonomy-group {
  1443. margin-bottom: 16rpx;
  1444. }
  1445. .taxonomy-group:last-child {
  1446. margin-bottom: 0;
  1447. }
  1448. .taxonomy-group-label {
  1449. display: block;
  1450. font-size: 24rpx;
  1451. font-weight: 500;
  1452. color: #666;
  1453. padding: 8rpx 4rpx 6rpx;
  1454. }
  1455. .pathogen-group {
  1456. margin-bottom: 16rpx;
  1457. }
  1458. .pathogen-group:last-child {
  1459. margin-bottom: 0;
  1460. }
  1461. .pathogen-group-label {
  1462. display: block;
  1463. font-size: 24rpx;
  1464. font-weight: 500;
  1465. color: #D32F2F;
  1466. padding: 8rpx 4rpx 6rpx;
  1467. }
  1468. .risk-item {
  1469. display: flex;
  1470. flex-direction: row;
  1471. align-items: center;
  1472. gap: 12rpx;
  1473. padding: 12rpx 16rpx;
  1474. background: #F8FAFB;
  1475. border-radius: 10rpx;
  1476. margin-bottom: 8rpx;
  1477. }
  1478. .risk-name {
  1479. flex: 1;
  1480. font-size: 26rpx;
  1481. color: #333;
  1482. padding: 4rpx 8rpx;
  1483. background: #fff;
  1484. border-radius: 6rpx;
  1485. }
  1486. .risk-level {
  1487. font-size: 22rpx;
  1488. font-weight: 500;
  1489. padding: 4rpx 12rpx;
  1490. border-radius: 8rpx;
  1491. }
  1492. .risk-low { background: #E8F5E9; color: #2E7D32; }
  1493. .risk-medium, .risk-moderate { background: #FFF3E0; color: #E65100; }
  1494. .risk-high { background: #FFEBEE; color: #C62828; }
  1495. .food-item {
  1496. display: flex;
  1497. flex-direction: row;
  1498. align-items: center;
  1499. gap: 12rpx;
  1500. padding: 12rpx 16rpx;
  1501. background: #F8FAFB;
  1502. border-radius: 10rpx;
  1503. margin-bottom: 8rpx;
  1504. }
  1505. .food-name {
  1506. flex: 1;
  1507. font-size: 26rpx;
  1508. color: #333;
  1509. padding: 4rpx 8rpx;
  1510. background: #fff;
  1511. border-radius: 6rpx;
  1512. }
  1513. .food-category {
  1514. width: 160rpx;
  1515. font-size: 24rpx;
  1516. color: #64748B;
  1517. text-align: right;
  1518. padding: 4rpx 8rpx;
  1519. background: #fff;
  1520. border-radius: 6rpx;
  1521. }
  1522. .action-row {
  1523. display: flex;
  1524. flex-direction: row;
  1525. gap: 20rpx;
  1526. margin-top: 10rpx;
  1527. margin-bottom: 20rpx;
  1528. }
  1529. .btn-discard {
  1530. flex: 1;
  1531. background: #fff;
  1532. border: 2rpx solid #EF4444;
  1533. color: #EF4444;
  1534. font-size: 28rpx;
  1535. font-weight: bold;
  1536. text-align: center;
  1537. padding: 24rpx;
  1538. border-radius: 16rpx;
  1539. }
  1540. .btn-discard:active { opacity: 0.7; }
  1541. .btn-confirm {
  1542. flex: 2;
  1543. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  1544. color: #fff;
  1545. font-size: 28rpx;
  1546. font-weight: bold;
  1547. text-align: center;
  1548. padding: 24rpx;
  1549. border-radius: 16rpx;
  1550. }
  1551. .btn-confirm:active { opacity: 0.85; }
  1552. .btn-disabled { opacity: 0.5; }
  1553. .bottom-spacer { height: 80rpx; }
  1554. /* ===== Phase 2: 匹配可信度 ===== */
  1555. .confidence-card {
  1556. margin: 0 30rpx 20rpx;
  1557. background: #fff;
  1558. border-radius: 16rpx;
  1559. padding: 24rpx;
  1560. box-shadow: 0 2rpx 6rpx rgba(0,0,0,0.04);
  1561. }
  1562. .confidence-header {
  1563. display: flex;
  1564. flex-direction: row;
  1565. align-items: center;
  1566. justify-content: space-between;
  1567. margin-bottom: 16rpx;
  1568. }
  1569. .confidence-label {
  1570. font-size: 26rpx;
  1571. color: #333;
  1572. font-weight: 500;
  1573. }
  1574. .confidence-badge {
  1575. font-size: 22rpx;
  1576. font-weight: bold;
  1577. padding: 4rpx 16rpx;
  1578. border-radius: 20rpx;
  1579. }
  1580. .badge-high { background: #E8F5E9; color: #2E7D32; }
  1581. .badge-medium { background: #FFF8E1; color: #F57F17; }
  1582. .badge-low { background: #FFF3E0; color: #E65100; }
  1583. .badge-none { background: #FFEBEE; color: #C62828; }
  1584. .confidence-bar-track {
  1585. height: 12rpx;
  1586. background: #E2E8F0;
  1587. border-radius: 6rpx;
  1588. overflow: hidden;
  1589. margin-bottom: 12rpx;
  1590. }
  1591. .confidence-bar-fill {
  1592. height: 100%;
  1593. border-radius: 6rpx;
  1594. transition: width 0.3s ease;
  1595. }
  1596. .fill-high { background: linear-gradient(90deg, #66BB6A, #43A047); }
  1597. .fill-medium { background: linear-gradient(90deg, #FFD54F, #FFC107); }
  1598. .fill-low { background: linear-gradient(90deg, #FF8A65, #FF5722); }
  1599. .fill-none { background: linear-gradient(90deg, #EF9A9A, #E53935); }
  1600. .confidence-desc {
  1601. font-size: 22rpx;
  1602. color: #94A3B8;
  1603. line-height: 1.4;
  1604. }
  1605. /* ===== Phase 2: 候选成员列表 ===== */
  1606. .candidate-section {
  1607. margin-bottom: 16rpx;
  1608. }
  1609. .candidate-section-hint {
  1610. display: block;
  1611. font-size: 24rpx;
  1612. color: #64748B;
  1613. margin-bottom: 12rpx;
  1614. }
  1615. .candidate-item {
  1616. display: flex;
  1617. flex-direction: row;
  1618. align-items: center;
  1619. justify-content: space-between;
  1620. padding: 16rpx;
  1621. background: #F8FAFB;
  1622. border-radius: 12rpx;
  1623. margin-bottom: 10rpx;
  1624. border: 2rpx solid transparent;
  1625. }
  1626. .candidate-item:active { opacity: 0.8; }
  1627. .candidate-selected {
  1628. background: #E3F2FD;
  1629. border-color: #5B9BD5;
  1630. }
  1631. .candidate-left {
  1632. display: flex;
  1633. flex-direction: row;
  1634. align-items: center;
  1635. flex: 1;
  1636. min-width: 0;
  1637. }
  1638. .candidate-avatar {
  1639. width: 56rpx;
  1640. height: 56rpx;
  1641. border-radius: 50%;
  1642. background: #5B9BD5;
  1643. color: #fff;
  1644. font-size: 24rpx;
  1645. font-weight: bold;
  1646. text-align: center;
  1647. line-height: 56rpx;
  1648. margin-right: 16rpx;
  1649. flex-shrink: 0;
  1650. }
  1651. .candidate-info {
  1652. flex: 1;
  1653. min-width: 0;
  1654. }
  1655. .candidate-name {
  1656. font-size: 26rpx;
  1657. color: #333;
  1658. font-weight: 500;
  1659. display: block;
  1660. }
  1661. .candidate-detail {
  1662. font-size: 22rpx;
  1663. color: #94A3B8;
  1664. display: block;
  1665. }
  1666. .candidate-fields {
  1667. font-size: 20rpx;
  1668. color: #5B9BD5;
  1669. display: block;
  1670. margin-top: 2rpx;
  1671. }
  1672. .candidate-right {
  1673. display: flex;
  1674. flex-direction: row;
  1675. align-items: center;
  1676. gap: 12rpx;
  1677. flex-shrink: 0;
  1678. margin-left: 16rpx;
  1679. }
  1680. .score-bar-track {
  1681. width: 80rpx;
  1682. height: 10rpx;
  1683. background: #E2E8F0;
  1684. border-radius: 5rpx;
  1685. overflow: hidden;
  1686. }
  1687. .score-bar-fill {
  1688. height: 100%;
  1689. background: linear-gradient(90deg, #5B9BD5, #3A7CC4);
  1690. border-radius: 5rpx;
  1691. }
  1692. .score-text {
  1693. font-size: 24rpx;
  1694. color: #1565C0;
  1695. font-weight: bold;
  1696. min-width: 48rpx;
  1697. text-align: right;
  1698. }
  1699. /* ===== Phase 2: 新建成员入口 ===== */
  1700. .create-member-entry {
  1701. display: flex;
  1702. flex-direction: row;
  1703. align-items: center;
  1704. justify-content: center;
  1705. padding: 20rpx;
  1706. border: 2rpx dashed #CBD5E1;
  1707. border-radius: 12rpx;
  1708. margin-top: 8rpx;
  1709. }
  1710. .create-member-entry:active { background: #F1F5F9; }
  1711. .create-member-icon {
  1712. font-size: 28rpx;
  1713. color: #5B9BD5;
  1714. font-weight: bold;
  1715. margin-right: 8rpx;
  1716. }
  1717. .create-member-text {
  1718. font-size: 24rpx;
  1719. color: #5B9BD5;
  1720. }
  1721. /* ===== Phase 2: 新建成员表单(面板内嵌) ===== */
  1722. .form-item {
  1723. display: flex;
  1724. flex-direction: row;
  1725. align-items: center;
  1726. margin-bottom: 20rpx;
  1727. }
  1728. .form-item-label {
  1729. font-size: 26rpx;
  1730. color: #333;
  1731. width: 100rpx;
  1732. flex-shrink: 0;
  1733. }
  1734. .form-item-input {
  1735. flex: 1;
  1736. font-size: 26rpx;
  1737. color: #333;
  1738. padding: 12rpx 16rpx;
  1739. background: #F5F7FA;
  1740. border-radius: 10rpx;
  1741. }
  1742. .gender-selector {
  1743. display: flex;
  1744. flex-direction: row;
  1745. gap: 16rpx;
  1746. }
  1747. .gender-option {
  1748. font-size: 26rpx;
  1749. color: #333;
  1750. padding: 12rpx 32rpx;
  1751. background: #F5F7FA;
  1752. border-radius: 10rpx;
  1753. border: 2rpx solid transparent;
  1754. }
  1755. .gender-option:active { opacity: 0.7; }
  1756. .gender-selected {
  1757. background: #E3F2FD;
  1758. border-color: #5B9BD5;
  1759. color: #1565C0;
  1760. }
  1761. .btn-create-submit {
  1762. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  1763. color: #fff;
  1764. font-size: 28rpx;
  1765. font-weight: bold;
  1766. text-align: center;
  1767. padding: 22rpx;
  1768. border-radius: 14rpx;
  1769. margin-top: 10rpx;
  1770. }
  1771. .btn-create-submit:active { opacity: 0.85; }
  1772. /* ===== 舌诊指标 ===== */
  1773. .tongue-indicator-grid {
  1774. display: flex;
  1775. flex-direction: row;
  1776. flex-wrap: wrap;
  1777. gap: 12rpx;
  1778. }
  1779. .tongue-ind-item {
  1780. width: calc(50% - 6rpx);
  1781. background: #F8FAFC;
  1782. border-radius: 16rpx;
  1783. padding: 20rpx 24rpx;
  1784. box-sizing: border-box;
  1785. }
  1786. .tongue-ind-label {
  1787. display: block;
  1788. font-size: 24rpx;
  1789. color: #94A3B8;
  1790. margin-bottom: 8rpx;
  1791. }
  1792. .tongue-ind-value {
  1793. display: block;
  1794. font-size: 28rpx;
  1795. color: #1E293B;
  1796. font-weight: 500;
  1797. }
  1798. .tongue-summary {
  1799. margin-top: 20rpx;
  1800. padding: 20rpx 24rpx;
  1801. background: #FFF8E1;
  1802. border-radius: 16rpx;
  1803. }
  1804. .tongue-summary-title {
  1805. font-size: 24rpx;
  1806. color: #F59E0B;
  1807. font-weight: 600;
  1808. display: block;
  1809. margin-bottom: 8rpx;
  1810. }
  1811. .tongue-summary-text {
  1812. font-size: 26rpx;
  1813. color: #333;
  1814. line-height: 1.6;
  1815. }
  1816. /* ===== 报告快速分析 ===== */
  1817. .quick-analyze-fab {
  1818. position: fixed;
  1819. right: 30rpx;
  1820. bottom: 60rpx;
  1821. display: flex;
  1822. flex-direction: row;
  1823. align-items: center;
  1824. background: linear-gradient(135deg, #5B9BD5, #3B82F6);
  1825. border-radius: 44rpx;
  1826. padding: 18rpx 30rpx;
  1827. box-shadow: 0 4rpx 16rpx rgba(59, 130, 246, 0.4);
  1828. z-index: 90;
  1829. }
  1830. .quick-analyze-fab-icon { font-size: 32rpx; margin-right: 10rpx; }
  1831. .quick-analyze-fab-text { font-size: 28rpx; color: #fff; font-weight: 500; }
  1832. .quick-analyze-fab:active { opacity: 0.85; }
  1833. .quick-analyze-overlay {
  1834. position: fixed;
  1835. top: 0; left: 0; right: 0; bottom: 0;
  1836. background: rgba(0, 0, 0, 0.45);
  1837. z-index: 98;
  1838. }
  1839. .quick-analyze-panel {
  1840. position: fixed;
  1841. left: 30rpx; right: 30rpx;
  1842. bottom: 40rpx;
  1843. background: #fff;
  1844. border-radius: 20rpx;
  1845. padding: 24rpx;
  1846. z-index: 99;
  1847. display: flex;
  1848. flex-direction: column;
  1849. max-height: 70vh;
  1850. }
  1851. .quick-analyze-header {
  1852. display: flex;
  1853. flex-direction: row;
  1854. align-items: center;
  1855. justify-content: space-between;
  1856. margin-bottom: 16rpx;
  1857. }
  1858. .quick-analyze-title { font-size: 30rpx; font-weight: bold; color: #333; }
  1859. .quick-analyze-close { font-size: 32rpx; color: #999; padding: 8rpx; }
  1860. .quick-analyze-hint {
  1861. font-size: 24rpx;
  1862. color: #E65100;
  1863. background: #FFF3E0;
  1864. border-radius: 12rpx;
  1865. padding: 12rpx 16rpx;
  1866. margin-bottom: 12rpx;
  1867. }
  1868. .quick-analyze-messages {
  1869. max-height: 50vh;
  1870. margin-bottom: 16rpx;
  1871. }
  1872. .quick-analyze-message {
  1873. margin-bottom: 12rpx;
  1874. display: flex;
  1875. flex-direction: column;
  1876. }
  1877. .quick-analyze-message.msg-user { align-items: flex-end; }
  1878. .quick-analyze-message.msg-ai { align-items: flex-start; }
  1879. .quick-analyze-msg-text {
  1880. font-size: 26rpx;
  1881. color: #333;
  1882. background: #F3F4F6;
  1883. border-radius: 14rpx;
  1884. padding: 14rpx 18rpx;
  1885. max-width: 80%;
  1886. line-height: 1.5;
  1887. }
  1888. .msg-user .quick-analyze-msg-text { background: #5B9BD5; color: #fff; }
  1889. .quick-analyze-loading { display: flex; justify-content: center; padding: 12rpx 0; }
  1890. .quick-analyze-loading-text { font-size: 24rpx; color: #999; }
  1891. .quick-analyze-chips { display: flex; flex-direction: column; margin-bottom: 16rpx; }
  1892. .quick-analyze-chip {
  1893. background: #EFF6FF;
  1894. border: 1rpx solid #BFDBFE;
  1895. border-radius: 12rpx;
  1896. padding: 14rpx 18rpx;
  1897. margin-bottom: 10rpx;
  1898. }
  1899. .quick-analyze-chip:active { opacity: 0.8; }
  1900. .quick-analyze-chip-text { font-size: 26rpx; color: #1D4ED8; }
  1901. .quick-analyze-input-bar {
  1902. display: flex;
  1903. flex-direction: row;
  1904. align-items: center;
  1905. }
  1906. .quick-analyze-input {
  1907. flex: 1;
  1908. height: 72rpx;
  1909. background: #F3F4F6;
  1910. border-radius: 36rpx;
  1911. padding: 0 28rpx;
  1912. font-size: 26rpx;
  1913. color: #333;
  1914. margin-right: 16rpx;
  1915. }
  1916. .quick-analyze-send {
  1917. background: #5B9BD5;
  1918. border-radius: 36rpx;
  1919. padding: 16rpx 34rpx;
  1920. }
  1921. .quick-analyze-send.send-disabled { opacity: 0.5; }
  1922. .quick-analyze-send-text { font-size: 26rpx; color: #fff; }
  1923. </style>