feat(ticketmachine): 升级版本并优化站点与线路名称获取逻辑
更新package.json、gate.lua、ticketmachine.lua的版本号,新增en、enName字段的兼容以完善名称展示逻辑
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local DEFAULT_SERVER_BASE = "http://ticket.fse-media.group"
|
||||
local DEFAULT_SERVER_PATH = "/api/tickets/check"
|
||||
local GATE_OPEN_SECONDS = 2
|
||||
local VERSION = "v1.5.9"
|
||||
local VERSION = "v1.5.10"
|
||||
local VERSION_CHECK_INTERVAL = 5
|
||||
|
||||
local CONFIG_PATH = "gate_config.json"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ticketmachine",
|
||||
"version": "1.0.13",
|
||||
"version": "1.0.14",
|
||||
"main": "server/index.js",
|
||||
"scripts": {
|
||||
"start": "node server/index.js",
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
local CURRENT_STATION_CODE = 'Ticket-Machine'
|
||||
local API_BASE = 'http://ticket.fse-media.group/api'
|
||||
local VERSION = 'v1.5.10'
|
||||
local VERSION = 'v1.5.11'
|
||||
|
||||
-- ###########################
|
||||
-- Core HTTP & JSON Utilities
|
||||
@@ -1092,7 +1092,7 @@ local function stationDisplay(code)
|
||||
if #code == 0 then return '' end
|
||||
if code == 'SINGLE_SEGMENT' then return 'Any 1 Segment' end
|
||||
local st = stationByCode[code]
|
||||
if st then return tostring(st.en_name or st.name or code) .. ' ' .. code end
|
||||
if st then return tostring(st.en_name or st.en or st.enName or st.name or code) .. ' ' .. code end
|
||||
return code
|
||||
end
|
||||
|
||||
@@ -1201,7 +1201,7 @@ local function buildSingleSegments()
|
||||
end
|
||||
for cost, _ in pairs(lineFares) do
|
||||
table.insert(segments, {
|
||||
lineName = line.name or line['线路名称'] or 'Unknown',
|
||||
lineName = line.en_name or line.enName or line.en or line.name or line['线路名称'] or 'Unknown',
|
||||
color = line.color or line['颜色'],
|
||||
cost = cost
|
||||
})
|
||||
@@ -1275,7 +1275,7 @@ local function showSingleSegmentSelection()
|
||||
end
|
||||
|
||||
local function showHome()
|
||||
state.stationName = (CFG.current_station and (CFG.current_station.en_name or CFG.current_station.name)) or 'Station'
|
||||
state.stationName = (CFG.current_station and (CFG.current_station.en_name or CFG.current_station.en or CFG.current_station.enName or CFG.current_station.name)) or 'Station'
|
||||
state.stationCode = (CFG.current_station and CFG.current_station.code) or CURRENT_STATION_CODE
|
||||
drawHeader('FSE Ticket Machine', 'Select Mode', true)
|
||||
Buttons = {}
|
||||
|
||||
Reference in New Issue
Block a user