triage.html · 约 4476 字符
1<!DOCTYPE html>2<html lang="zh-CN">3<head>4<meta charset="utf-8">5<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">6<title>智能导诊 · 小草医院</title>7<link rel="stylesheet" href="style.css">8</head>9<body>10 <div class="app-top">11 <div class="loc">🤖 AI 智能导诊</div>12 <h1 id="topTitle">描述症状</h1>13 <div class="sub" id="topSub">输入不适部位或症状,秒级分诊推荐科室与医生</div>14 </div>1516 <div class="card">17 <div style="font-weight:700;margin-bottom:10px">📝 您哪里不舒服?</div>18 <textarea id="sym" rows="3" placeholder="例如:最近一周咳嗽、有点发热、喉咙痛…"19 style="width:100%;border:1px solid var(--border);border-radius:12px;padding:11px;font-size:14px;resize:none;font-family:inherit"></textarea>20 <div style="margin-top:11px" class="row">21 <button class="btn full" onclick="runTriage()">🔍 智能分诊</button>22 </div>23 <div style="margin-top:10px">24 <div style="font-size:12.5px;color:var(--text-mute);margin-bottom:4px">快捷症状:</div>25 <span class="chip" onclick="setSym('咳嗽发热咽痛')">咳嗽发热</span>26 <span class="chip" onclick="setSym('头晕血压偏高')">头晕血压高</span>27 <span class="chip" onclick="setSym('皮疹瘙痒过敏')">皮疹瘙痒</span>28 <span class="chip" onclick="setSym('宝宝发烧咳嗽')">儿童发烧</span>29 <span class="chip" onclick="setSym('失眠乏力调理')">失眠乏力</span>30 </div>31 </div>3233 <div id="result"></div>3435 <div class="card">36 <div style="font-weight:700;margin-bottom:8px">🏥 按科室浏览</div>37 <div id="deptGrid" class="row" style="flex-wrap:wrap;gap:8px"></div>38 </div>3940 <div class="tabbar" id="tabbar"></div>41 <script src="data.js"></script><script src="app.js"></script>42 <script>43 function setSym(t){ document.getElementById('sym').value = t; }4445 document.getElementById('deptGrid').innerHTML = DEPARTMENTS.map(d=>46 `<span class="chip" onclick="go('doctors.html?dept=${d.id}')">${d.emoji} ${d.name}</span>`47 ).join('');4849 function runTriage(){50 const txt = document.getElementById('sym').value.trim();51 if(!txt){ toast('请先描述症状'); return; }52 const t = txt.toLowerCase();53 let hit = null;54 for(const r of TRIAGE){ if(r.kw.some(k=>t.includes(k.toLowerCase()))){ hit = r; break; } }55 const box = document.getElementById('result');56 if(!hit){57 box.innerHTML = `<div class="card" style="border:1px solid var(--brand-l)">58 <div style="font-weight:700">🤔 暂未匹配到明确科室</div>59 <div class="ds" style="margin-top:6px">建议选择「全科/内科」由医生进一步判断,或拨打健康咨询热线。</div>60 <div class="row bt" style="margin-top:12px">61 <button class="btn sm" onclick="go('doctors.html?dept=nk')">看内科医生</button>62 <button class="btn ghost sm" onclick="go('consult.html')">免费健康咨询</button>63 </div></div>`;64 box.scrollIntoView({behavior:'smooth'}); return;65 }66 const docs = DOCTORS.filter(d=>d.dept===hit.dept);67 box.innerHTML = `<div class="card" style="border:1px solid var(--brand-l);background:linear-gradient(135deg,#ecfdf5,#f0fdfa)">68 <div style="font-weight:800;color:var(--brand-d)">✅ 分诊建议:${hit.dept}</div>69 <div class="ds" style="margin:6px 0 10px">${hit.tip}。以下为该科室在线医生,可立即发起问诊。</div>70 ${docs.map(d=>`<div class="doc" onclick="go('chat.html?id=${d.id}')">71 <div class="avatar">${d.name[0]}</div>72 <div style="flex:1"><div class="nm">${d.name} <span style="font-weight:500;color:var(--text-mute);font-size:12px">${d.title}</span></div>73 <div class="mt">${d.good}</div>74 <div class="rt">⭐ ${d.rating} · ${d.online?'<span style="color:var(--brand-d)">在线</span>':'暂离线'}</div></div>75 <button class="btn sm" onclick="event.stopPropagation();go('chat.html?id=${d.id}')">问诊 ¥${d.price}</button>76 </div>`).join('')}77 <button class="btn full" style="margin-top:8px" onclick="go('doctors.html?dept=${DEPARTMENTS.find(x=>x.name===hit.dept).id}')">查看 ${hit.dept} 全部医生</button>78 </div>`;79 box.scrollIntoView({behavior:'smooth'});80 }81 renderTab('问诊');82 </script>83</body>84</html>85