(() => { const $ = (sel) => document.querySelector(sel); const fromEl = $('#from'); const toEl = $('#to'); const tripsEl = $('#trips'); const priceBox = $('#priceBox'); const voucherBox = $('#voucherBox'); let previewSeq = 0; let lastPreviewKey = ''; const api = { fareQuery: async (from, to) => { const r = await fetch(`/api/public/fares/query?from=${encodeURIComponent(from)}&to=${encodeURIComponent(to)}`); return r.json(); }, createOrder: async (payload) => { const r = await fetch('/api/public/orders', { method:'POST', headers:{ 'Content-Type':'application/json' }, body: JSON.stringify(payload) }); return r.json(); } }; // Fetch and Render Map const mapContainer = $('#stationMap'); let selection = [null, null]; let currentRoute = []; let currentRouteTransfers = []; let stationNameByCode = {}; let stationEnByCode = {}; let stationCanonicalByCode = {}; let stationCodesByCanonical = {}; let stationXByCanonical = {}; let stationYByCanonical = {}; let stationTransfer = new Set(); // TVM UI State let activeLineId = null; let allLinesData = []; let allStationsData = []; async function renderSystemMap() { mapContainer.innerHTML = '
暂无可显示的线路数据。
请选择起点与终点
站点解析异常,当前后端返回的站码与页面选择不一致。
已选:${getStationDisplayName(from)}(${from}) -> ${getStationDisplayName(to)}(${to})
返回:${getStationDisplayName(resolvedFrom)}(${resolvedFrom || '-'}) -> ${getStationDisplayName(resolvedTo)}(${resolvedTo || '-'})
请先部署最新后端并清理 CDN 缓存后再试。
票价预估失败,请稍后再试。