feat(ticket): 新增单程票购票与检票功能,优化日志与接口
- 前端新增单程票购票界面,支持票种切换与区间选择、价格预览 - 完善后端检票接口,添加单程票的校验与处理逻辑 - 优化售票机脚本的车票类型映射,新增单程车票支持 - 简化前端售票日志输出,移除冗余站点信息字段 - 新增服务层付费区间计算字段,优化公共接口返回数据
This commit is contained in:
@@ -231,7 +231,8 @@ const LogicService = {
|
||||
regular_path: [src],
|
||||
express_path: [src],
|
||||
regular_transfers: [],
|
||||
express_transfers: []
|
||||
express_transfers: [],
|
||||
paid_segments: 0
|
||||
};
|
||||
}
|
||||
|
||||
@@ -245,6 +246,7 @@ const LogicService = {
|
||||
const totals = accumulateFareAlongPath(graph, result.path);
|
||||
if (!totals) return null;
|
||||
const transfers = computeTransfersAlongPath(graph, result.path);
|
||||
const dstCost = result.dist.get(dst);
|
||||
|
||||
return {
|
||||
regular: Math.round(Number(totals.regular ?? 0) || 0),
|
||||
@@ -253,6 +255,7 @@ const LogicService = {
|
||||
express_path: result.path,
|
||||
regular_transfers: transfers,
|
||||
express_transfers: transfers,
|
||||
paid_segments: dstCost ? dstCost.paidSegments : Infinity
|
||||
};
|
||||
} catch (_) { return null; }
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user