feat(ticket): 新增单程票购票与检票功能,优化日志与接口
- 前端新增单程票购票界面,支持票种切换与区间选择、价格预览 - 完善后端检票接口,添加单程票的校验与处理逻辑 - 优化售票机脚本的车票类型映射,新增单程车票支持 - 简化前端售票日志输出,移除冗余站点信息字段 - 新增服务层付费区间计算字段,优化公共接口返回数据
This commit is contained in:
@@ -714,13 +714,19 @@ router.get('/tickets/:id', async (req, res, next) => {
|
||||
action: e.action,
|
||||
ts: e.ts,
|
||||
ticket_id: e.ticket_id,
|
||||
station_name: nameFor(e.station_code),
|
||||
station_name: e.station_name || nameFor(e.station_code),
|
||||
station_code: e.station_code || '',
|
||||
station_en: e.station_code ? enNameFor(e.station_code) : (e.station_en || ''),
|
||||
trips_remaining: e.trips_remaining ?? e.rides_remaining ?? null
|
||||
};
|
||||
} else if (e.type === 'check') {
|
||||
return {
|
||||
...e,
|
||||
station_name: e.station_name || nameFor(e.station_code),
|
||||
station_en: e.station_code ? enNameFor(e.station_code) : (e.station_en || '')
|
||||
};
|
||||
}
|
||||
return { raw: e };
|
||||
return e;
|
||||
});
|
||||
|
||||
appendReqLog(req, { category: 'public', type: 'ticket_detail', detail: { ticket_id: id, ok: true } });
|
||||
|
||||
Reference in New Issue
Block a user