feat(ticket): 新增单程票购票与检票功能,优化日志与接口

- 前端新增单程票购票界面,支持票种切换与区间选择、价格预览
- 完善后端检票接口,添加单程票的校验与处理逻辑
- 优化售票机脚本的车票类型映射,新增单程车票支持
- 简化前端售票日志输出,移除冗余站点信息字段
- 新增服务层付费区间计算字段,优化公共接口返回数据
This commit is contained in:
2026-07-10 00:08:31 +08:00
parent 6098590692
commit fc4fe5101c
9 changed files with 246 additions and 54 deletions
+10 -2
View File
@@ -250,6 +250,9 @@ local function normalizeTrainTypeLabel(v)
if s == 'express' or s == 'limited_express' or s == 'limited express' then
return 'Express'
end
if s == 'single' then
return 'single'
end
return 'Local'
end
@@ -2090,10 +2093,13 @@ local function showDone()
local toNameEnArg = tostring(toNameEn or '???')
local fromNameCnUArg = tostring(fromNameCnU or '')
local toNameCnUArg = tostring(toNameCnU or '')
local issueArgsType = 'local'
if state.trainType == 'Express' then issueArgsType = 'limited_express'
elseif state.trainType == 'single' then issueArgsType = 'single' end
local issueArgs = {
start_name_en = fromNameEnArg,
terminal_name_en = toNameEnArg,
type = (state.trainType == 'Express') and 'limited_express' or 'local',
type = issueArgsType,
rides = rides,
cost = cost,
start_station = startStationArg,
@@ -2113,7 +2119,9 @@ local function showDone()
ts = (os.epoch and os.epoch('utc')) or (os.time() * 1000)
}
local apiType = (state.trainType == 'Express') and 'limited_express' or 'local'
local apiType = 'local'
if state.trainType == 'Express' then apiType = 'limited_express'
elseif state.trainType == 'single' then apiType = 'single' end
local localGeneratedTicketId = generateTicketId()
local okIssueTicket, issuedTicketId, issueMethod = issueTicketFromPeripheral(
fromNameEnArg,