fix: 远距不导航 + 卡片按钮自适应 + 寻车换铃铛图标

- 直线距离 ≥ 20km 时卡片不再显示「导航」按钮(距离格同隐藏),
  正在导航该车时仍保留「结束」
- startNavigation 兜底静默返回;_requestNavRoute 识别 too_far 不弹报错
- 后端 get_nav_route 调百度前按上限拦截(步行/骑行 200km、驾车 500km),
  返回 error_kind=too_far 与中文提示;百度的
  "the distance of path must less then 200Km" 也翻成中文
- 顺手修 get_nav_route 里 float(d_lng) -> float(dest_lng) 的笔误
  (会让整个函数抛 UnboundLocalError)
- 卡片顶部按钮是否收成纯图标改为实测:车牌被 ellipsis 截断才收,
  同时考虑车牌长度与屏宽;resize 与「导航/结束」换字后重新测量
- 「寻车」放大镜换成描边铃铛 SVG,title 改为「寻车(响铃)」

测试:136 pytest + 30 node 全绿
This commit is contained in:
zzy
2026-11-15 01:33:46 +08:00
parent e51d77d42a
commit e01bd67cd8
5 changed files with 113 additions and 5 deletions
+4 -4
View File
@@ -743,11 +743,11 @@
<div class="bike-card-header-btns">
<button class="bike-card-find-btn" id="bike-nav-btn" onclick="toggleNavigation()" title="导航到车">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 11l19-9-9 19-2-8-8-2z"/></svg>
<span id="bike-nav-btn-text">导航</span>
<span class="btn-label" id="bike-nav-btn-text">导航</span>
</button>
<button class="bike-card-find-btn" id="bike-find-btn-header" onclick="findBike()" title="寻车">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg>
<span>寻车</span>
<button class="bike-card-find-btn" id="bike-find-btn-header" onclick="findBike()" title="寻车(响铃)">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.7 21a2 2 0 0 1-3.4 0"/></svg>
<span class="btn-label">寻车</span>
</button>
<button class="bike-card-close" onclick="closeCard()">✕</button>
</div>