From 86f3d478d66ad6708dfdba589285ca36d24a1c0f Mon Sep 17 00:00:00 2001
From: HenryDu8133 <813367384@qq.com>
Date: Wed, 15 Jul 2026 20:41:11 +0800
Subject: [PATCH] =?UTF-8?q?feat(ticket-order):=20=E9=87=8D=E5=86=99?=
=?UTF-8?q?=E7=BA=BF=E8=B7=AF=E5=9C=B0=E5=9B=BE=E5=8F=AF=E8=A7=86=E5=8C=96?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=9B=BF=E6=8D=A2=E5=8E=9F=E6=9C=89?=
=?UTF-8?q?=E7=BA=BF=E8=B7=AFUI?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
替换原有的标签式线路站点UI,新增加载渲染官方线路SVG地图、线路分段展示、换乘站标记、站点中英文标注、路线规划高亮预览等功能,优化响应式布局与交互逻辑。
---
web/ticket-order.js | 676 +++++++++++++++++++++++++++++---------------
1 file changed, 446 insertions(+), 230 deletions(-)
diff --git a/web/ticket-order.js b/web/ticket-order.js
index ff7087f..90ab193 100644
--- a/web/ticket-order.js
+++ b/web/ticket-order.js
@@ -32,10 +32,71 @@
let stationYByCanonical = {};
let stationTransfer = new Set();
- // TVM UI State
- let activeLineId = null;
- let allLinesData = [];
- let allStationsData = [];
+ const piePath = (cx, cy, r, a0, a1) => {
+ const x0 = cx + r * Math.cos(a0);
+ const y0 = cy + r * Math.sin(a0);
+ const x1 = cx + r * Math.cos(a1);
+ const y1 = cy + r * Math.sin(a1);
+ const large = (a1 - a0) > Math.PI ? 1 : 0;
+ return `M ${cx} ${cy} L ${x0} ${y0} A ${r} ${r} 0 ${large} 1 ${x1} ${y1} Z`;
+ };
+
+ const pieSvg = (cx, cy, r, colors) => {
+ const cols = (Array.isArray(colors) ? colors.filter(Boolean) : []).slice(0, 4);
+ if (cols.length === 0) return '';
+ if (cols.length === 1) return `
暂无可显示的线路数据。
暂无可显示的线路数据。