fix(health-consult): 修复返回键路由问题,新增科室/疾病专家数量展示

- 使用 ?from 参数记录来源页,修复多入口页面返回键硬编码问题
- expert-profile 返回键根据来源跳回 index/expert-list,fallback history.back
- text-chat 移除返回键(咨询进行中不允许随意返回,避免循环跳转)
- rate-doctor 新增返回键,提交后跳转 my-records 而非 index
- record-detail 跳转 text-chat 时携带 ?from=record-detail 参数
- find-expert 科室面板和疾病面板新增专家数量展示

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 09:14:07 +08:00
co-authored by Claude Sonnet 4.6
parent 6eecd54f49
commit 52776c18e9
7 changed files with 115 additions and 42 deletions
+3 -3
View File
@@ -113,7 +113,7 @@
<div class="expert-list-container" id="expertListContainer">
<!-- [交互] 专家卡片1 - 点击跳转到专家详情页 -->
<div class="expert-card" data-name="张建国" onclick="window.location.href='expert-profile.html'">
<div class="expert-card" data-name="张建国" onclick="window.location.href='expert-profile.html?from=expert-list'">
<div class="ec-avatar">&#128104;&#8205;&#9877;&#65039;</div>
<div class="ec-info">
<div class="ec-row1">
@@ -134,7 +134,7 @@
</div>
<!-- [交互] 专家卡片2 - 点击跳转到专家详情页 -->
<div class="expert-card" data-name="陈美华" onclick="window.location.href='expert-profile.html'">
<div class="expert-card" data-name="陈美华" onclick="window.location.href='expert-profile.html?from=expert-list'">
<div class="ec-avatar">&#128105;&#8205;&#9877;&#65039;</div>
<div class="ec-info">
<div class="ec-row1">
@@ -155,7 +155,7 @@
</div>
<!-- [交互] 专家卡片3 - 点击跳转到专家详情页 -->
<div class="expert-card" data-name="刘海波" onclick="window.location.href='expert-profile.html'">
<div class="expert-card" data-name="刘海波" onclick="window.location.href='expert-profile.html?from=expert-list'">
<div class="ec-avatar">&#128104;&#8205;&#9877;&#65039;</div>
<div class="ec-info">
<div class="ec-row1">
@@ -360,7 +360,7 @@
<!-- 导航栏(透明,绝对定位在头部上方) -->
<!-- [交互] 返回按钮:点击返回上一页 -->
<div class="nav-bar">
<button class="nav-back" onclick="history.back()">&#8592;</button>
<button class="nav-back" onclick="goBack()">&#8592;</button>
<!-- [交互] 分享按钮 -->
<button class="nav-share">分享</button>
</div>
@@ -518,7 +518,7 @@
/* [交互] 确认须知后根据类型跳转 */
function confirmNotice() {
if (currentNoticeType === 'text') {
window.location.href = 'text-chat.html';
window.location.href = 'text-chat.html?from=expert-profile';
} else if (currentNoticeType === 'video') {
window.location.href = 'video-booking.html';
}
@@ -530,6 +530,23 @@
closeModal('noticeModal');
}
});
/**
* 返回上一页:优先读取 ?from 参数,否则 history.back(),最终 fallback 到 index.html
*/
function goBack() {
var params = new URLSearchParams(window.location.search);
var from = params.get('from');
if (from === 'index') {
window.location.href = 'index.html';
} else if (from === 'expert-list') {
window.location.href = 'expert-list.html';
} else if (history.length > 1) {
history.back();
} else {
window.location.href = 'index.html';
}
}
</script>
</body>
+55 -22
View File
@@ -70,10 +70,12 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
.dept-right-content { flex: 1; overflow-y: auto; padding: 16px 12px; background: #fff; }
.dept-grid { display: none; flex-wrap: wrap; gap: 10px; }
.dept-grid.active { display: flex; }
.dept-item { width: calc(50% - 5px); background: #f7f8fa; border-radius: 10px; padding: 14px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: all 0.2s; font-size: 13px; color: #333; }
.dept-item { width: calc(50% - 5px); background: #f7f8fa; border-radius: 10px; padding: 12px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: all 0.2s; font-size: 13px; color: #333; }
.dept-item:hover { background: #e6f4ff; color: #1677ff; }
.dept-item:active { transform: scale(0.96); }
.dept-icon { font-size: 18px; flex-shrink: 0; }
.dept-item-text { display: flex; flex-direction: column; gap: 2px; }
.dept-item-count { font-size: 11px; color: #999; }
/* ===== 疾病面板 ===== */
/* 疾病分类横向Tab */
@@ -90,6 +92,7 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
.disease-item:active { transform: scale(0.98); }
.disease-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.disease-name { font-size: 14px; color: #333; flex: 1; }
.disease-count { font-size: 12px; color: #999; margin-right: 4px; }
.disease-arrow { color: #ccc; flex-shrink: 0; }
</style>
</head>
@@ -201,37 +204,37 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
<div class="dept-right-content">
<!-- [交互] 点击二级科室跳转到expert-list.html -->
<div id="dept-neike" class="dept-grid active">
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">❤️</span><span>心内科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🧠</span><span>神经内科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🔬</span><span>内分泌科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🫁</span><span>消化内科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">💨</span><span>呼吸科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🫘</span><span>肾内科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">❤️</span><div class="dept-item-text"><span>心内科</span><span class="dept-item-count">12位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🧠</span><div class="dept-item-text"><span>神经内科</span><span class="dept-item-count">9位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🔬</span><div class="dept-item-text"><span>内分泌科</span><span class="dept-item-count">8位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🫁</span><div class="dept-item-text"><span>消化内科</span><span class="dept-item-count">11位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">💨</span><div class="dept-item-text"><span>呼吸科</span><span class="dept-item-count">7位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🫘</span><div class="dept-item-text"><span>肾内科</span><span class="dept-item-count">6位专家</span></div></div>
</div>
<div id="dept-waike" class="dept-grid">
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🦴</span><span>骨科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🔪</span><span>普通外科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🧠</span><span>神经外科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🫀</span><span>泌尿外科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🦴</span><div class="dept-item-text"><span>骨科</span><span class="dept-item-count">10位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🔪</span><div class="dept-item-text"><span>普通外科</span><span class="dept-item-count">8位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🧠</span><div class="dept-item-text"><span>神经外科</span><span class="dept-item-count">5位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🫀</span><div class="dept-item-text"><span>泌尿外科</span><span class="dept-item-count">7位专家</span></div></div>
</div>
<div id="dept-fuchan" class="dept-grid">
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">👩</span><span>妇科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🤰</span><span>产科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🧬</span><span>生殖科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">👩</span><div class="dept-item-text"><span>妇科</span><span class="dept-item-count">9位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🤰</span><div class="dept-item-text"><span>产科</span><span class="dept-item-count">6位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🧬</span><div class="dept-item-text"><span>生殖科</span><span class="dept-item-count">4位专家</span></div></div>
</div>
<div id="dept-erke" class="dept-grid">
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">👶</span><span>儿内科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🩹</span><span>儿外科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🍼</span><span>新生儿科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">👶</span><div class="dept-item-text"><span>儿内科</span><span class="dept-item-count">8位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🩹</span><div class="dept-item-text"><span>儿外科</span><span class="dept-item-count">5位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🍼</span><div class="dept-item-text"><span>新生儿科</span><span class="dept-item-count">3位专家</span></div></div>
</div>
<div id="dept-yanerbi" class="dept-grid">
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">👁️</span><span>眼科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">👂</span><span>耳鼻喉科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🦷</span><span>口腔科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">👁️</span><div class="dept-item-text"><span>眼科</span><span class="dept-item-count">7位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">👂</span><div class="dept-item-text"><span>耳鼻喉科</span><span class="dept-item-count">6位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🦷</span><div class="dept-item-text"><span>口腔科</span><span class="dept-item-count">5位专家</span></div></div>
</div>
<div id="dept-pifu" class="dept-grid">
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🧴</span><span>皮肤科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">💊</span><span>性病科</span></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">🧴</span><div class="dept-item-text"><span>皮肤科</span><span class="dept-item-count">8位专家</span></div></div>
<div class="dept-item" onclick="window.location.href='expert-list.html'"><span class="dept-icon">💊</span><div class="dept-item-text"><span>性病科</span><span class="dept-item-count">3位专家</span></div></div>
</div>
</div>
</div>
@@ -253,26 +256,31 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff4d4f;"></div>
<span class="disease-name">冠心病</span>
<span class="disease-count">12位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff7a45;"></div>
<span class="disease-name">高血压</span>
<span class="disease-count">18位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ffa940;"></div>
<span class="disease-name">心律失常</span>
<span class="disease-count">9位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ffc53d;"></div>
<span class="disease-name">心肌炎</span>
<span class="disease-count">6位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff85c0;"></div>
<span class="disease-name">心力衰竭</span>
<span class="disease-count">8位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
</div>
@@ -281,26 +289,31 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#597ef7;"></div>
<span class="disease-name">糖尿病</span>
<span class="disease-count">15位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#73d13d;"></div>
<span class="disease-name">甲状腺疾病</span>
<span class="disease-count">10位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff9c6e;"></div>
<span class="disease-name">肥胖症</span>
<span class="disease-count">7位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#b37feb;"></div>
<span class="disease-name">痛风</span>
<span class="disease-count">8位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#5cdbd3;"></div>
<span class="disease-name">骨质疏松</span>
<span class="disease-count">6位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
</div>
@@ -309,26 +322,31 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff7a45;"></div>
<span class="disease-name">颈椎病</span>
<span class="disease-count">11位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ffc53d;"></div>
<span class="disease-name">腰椎间盘突出</span>
<span class="disease-count">9位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff85c0;"></div>
<span class="disease-name">关节炎</span>
<span class="disease-count">13位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#597ef7;"></div>
<span class="disease-name">骨折</span>
<span class="disease-count">8位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#73d13d;"></div>
<span class="disease-name">肩周炎</span>
<span class="disease-count">7位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
</div>
@@ -337,26 +355,31 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#b37feb;"></div>
<span class="disease-name">头痛偏头痛</span>
<span class="disease-count">9位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#5cdbd3;"></div>
<span class="disease-name">失眠</span>
<span class="disease-count">12位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff9c6e;"></div>
<span class="disease-name">眩晕</span>
<span class="disease-count">7位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff4d4f;"></div>
<span class="disease-name">帕金森</span>
<span class="disease-count">5位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ffa940;"></div>
<span class="disease-name">癫痫</span>
<span class="disease-count">6位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
</div>
@@ -365,26 +388,31 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#73d13d;"></div>
<span class="disease-name">胃炎</span>
<span class="disease-count">14位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff7a45;"></div>
<span class="disease-name">胃溃疡</span>
<span class="disease-count">10位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#597ef7;"></div>
<span class="disease-name">结肠炎</span>
<span class="disease-count">8位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ffc53d;"></div>
<span class="disease-name">肝炎</span>
<span class="disease-count">11位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#b37feb;"></div>
<span class="disease-name">胆囊炎</span>
<span class="disease-count">7位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
</div>
@@ -393,26 +421,31 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#5cdbd3;"></div>
<span class="disease-name">慢性咳嗽</span>
<span class="disease-count">9位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff85c0;"></div>
<span class="disease-name">哮喘</span>
<span class="disease-count">11位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff4d4f;"></div>
<span class="disease-name">慢阻肺</span>
<span class="disease-count">8位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ff9c6e;"></div>
<span class="disease-name">肺炎</span>
<span class="disease-count">13位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
<div class="disease-item" onclick="window.location.href='expert-list.html'">
<div class="disease-dot" style="background:#ffa940;"></div>
<span class="disease-name">支气管炎</span>
<span class="disease-count">10位专家</span>
<svg class="disease-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="#ccc" stroke-width="1.5"><path d="M6 4l4 4-4 4"/></svg>
</div>
</div>
+15 -7
View File
@@ -140,7 +140,7 @@
<!-- [交互] 导航栏:返回按钮 + 标题 + 右侧消息图标 -->
<div class="nav-bar">
<a class="nav-back" onclick="history.back()">← 返回</a>
<a class="nav-back" onclick="goBack()">← 返回</a>
<span class="nav-title">健康咨询</span>
<span class="nav-right">💬</span>
</div>
@@ -180,7 +180,7 @@
</div>
<!-- [交互] 专家卡片1:张建国,点击跳转专家详情页 -->
<div class="expert-card" onclick="window.location.href='expert-profile.html'">
<div class="expert-card" onclick="window.location.href='expert-profile.html?from=index'">
<div class="expert-avatar">👨‍⚕️</div>
<div class="expert-info">
<div class="name">张建国 <span style="font-size:12px;font-weight:400;color:#666;">主任医师</span></div>
@@ -196,12 +196,12 @@
<div class="count">咨询 2,356次</div>
<div class="reply">回复率 99%</div>
<!-- [交互] 咨询按钮 -->
<button class="consult-btn" onclick="event.stopPropagation(); window.location.href='expert-profile.html'">咨询</button>
<button class="consult-btn" onclick="event.stopPropagation(); window.location.href='expert-profile.html?from=index'">咨询</button>
</div>
</div>
<!-- [交互] 专家卡片2:李晓梅,点击跳转专家详情页 -->
<div class="expert-card" onclick="window.location.href='expert-profile.html'">
<div class="expert-card" onclick="window.location.href='expert-profile.html?from=index'">
<div class="expert-avatar">👩‍⚕️</div>
<div class="expert-info">
<div class="name">李晓梅 <span style="font-size:12px;font-weight:400;color:#666;">副主任医师</span></div>
@@ -217,12 +217,12 @@
<div class="count">咨询 1,892次</div>
<div class="reply">回复率 98%</div>
<!-- [交互] 咨询按钮 -->
<button class="consult-btn" onclick="event.stopPropagation(); window.location.href='expert-profile.html'">咨询</button>
<button class="consult-btn" onclick="event.stopPropagation(); window.location.href='expert-profile.html?from=index'">咨询</button>
</div>
</div>
<!-- [交互] 专家卡片3:王志远,点击跳转专家详情页 -->
<div class="expert-card" onclick="window.location.href='expert-profile.html'">
<div class="expert-card" onclick="window.location.href='expert-profile.html?from=index'">
<div class="expert-avatar">👨‍⚕️</div>
<div class="expert-info">
<div class="name">王志远 <span style="font-size:12px;font-weight:400;color:#666;">主任医师</span></div>
@@ -238,7 +238,7 @@
<div class="count">咨询 3,105次</div>
<div class="reply">回复率 97%</div>
<!-- [交互] 咨询按钮 -->
<button class="consult-btn" onclick="event.stopPropagation(); window.location.href='expert-profile.html'">咨询</button>
<button class="consult-btn" onclick="event.stopPropagation(); window.location.href='expert-profile.html?from=index'">咨询</button>
</div>
</div>
@@ -248,5 +248,13 @@
<div class="bottom-spacer"></div>
</div><!-- /.phone-shell -->
<script>
function goBack() {
if (history.length > 1) {
history.back();
}
// index.html 是入口页,无需 fallback 跳转
}
</script>
</body>
</html>
+19 -3
View File
@@ -96,8 +96,9 @@
</div>
</div>
<!-- 导航栏(无返回按钮) -->
<!-- 导航栏 -->
<div class="nav-bar">
<span class="nav-back-btn" onclick="goBack()" style="position:absolute;left:16px;font-size:22px;cursor:pointer;color:#1a1a1a;">&#8592;</span>
<span class="nav-title">评价医生</span>
</div>
@@ -149,10 +150,25 @@
}
/**
* 提交评价,跳转到
* 提交评价,跳转到咨询记录
*/
function submitRate() {
window.location.href = 'index.html';
window.location.href = 'my-records.html';
}
/**
* 返回上一页:读取 ?from 参数决定目标页
*/
function goBack() {
var params = new URLSearchParams(window.location.search);
var from = params.get('from');
if (from === 'text-chat') {
window.location.href = 'text-chat.html';
} else if (history.length > 1) {
history.back();
} else {
window.location.href = 'my-records.html';
}
}
</script>
</body>
@@ -173,7 +173,7 @@
</div>
<!-- [交互] 对话入口卡片:点击跳转 text-chat.html 查看历史对话 -->
<a class="chat-entry" href="text-chat.html">
<a class="chat-entry" href="text-chat.html?from=record-detail">
<span class="ce-icon">💬</span>
<div class="ce-info">
<div class="ce-title">查看历史对话记录</div>
@@ -186,7 +186,7 @@
<!-- [交互] 底部操作栏:继续咨询按钮 → text-chat.html -->
<div class="detail-footer">
<button class="btn-continue" onclick="window.location.href='text-chat.html'">💬 继续咨询</button>
<button class="btn-continue" onclick="window.location.href='text-chat.html?from=record-detail'">💬 继续咨询</button>
</div>
<!-- 底部安全区留白 -->
+2 -3
View File
@@ -102,9 +102,8 @@
<span>&#128267;</span>
</span>
</div>
<!-- [交互] 返回按钮跳转到专家主页 -->
<!-- [交互] 聊天头部:无返回键,通过"结束咨询"按钮离开 -->
<div class="chat-header">
<a href="expert-profile.html" class="back-btn"></a>
<div class="chat-avatar">👨‍⚕️</div>
<div class="chat-info">
<span class="chat-name">张建国医生</span>
@@ -167,7 +166,7 @@
<!-- [交互] 关闭弹窗继续咨询 -->
<button class="btn-cancel" onclick="closeModal('endConfirmModal')">继续咨询</button>
<!-- [交互] 确认结束跳转到评价页面 -->
<button class="btn-confirm" onclick="location.href='rate-doctor.html'">确认结束</button>
<button class="btn-confirm" onclick="location.href='rate-doctor.html?from=text-chat'">确认结束</button>
</div>
</div>
</div>