feat(web, server): 更新品牌文案,新增IC卡批量查询并重构搜索页面
统一替换全站所有HTML页面的品牌标题为FarSight-T.N.E铁路运输,调整部分页面的中文显示文案,例如删除ticket-board.html中的冗余说明文字。格式化重构blog.html的代码结构与缩进,修复末尾无换行的问题。 后端完善/ic-cards/query接口:支持空查询返回全部IC卡列表,按创建时间倒序排序,添加卡片状态和类型的标准化标签,优化请求日志记录。 全面重构IC卡搜索页面的前端逻辑,新增批量查看所有IC卡功能,支持点击卡片查看详情与操作历史,优化状态管理与渲染流程。
This commit is contained in:
+10
-2
@@ -345,8 +345,16 @@ router.post('/orders/:code/consume', async (req, res) => {
|
||||
router.get('/ic-cards/query', async (req, res) => {
|
||||
const q = String(req.query.q || '').trim();
|
||||
if (!q) {
|
||||
appendReqLog(req, { category: 'public', type: 'ic_card_query_invalid', level: 'warn', detail: { q } });
|
||||
return res.status(400).json({ ok: false, error: 'query required' });
|
||||
const cards = (DataService.getIcCards() || [])
|
||||
.slice()
|
||||
.sort((a, b) => Number(b?.created_ts || 0) - Number(a?.created_ts || 0))
|
||||
.map((card) => ({
|
||||
...presentIcCard(card),
|
||||
status_label: mapIcCardStatus(card.status),
|
||||
card_type_label: mapIcCardType(card.card_type)
|
||||
}));
|
||||
appendReqLog(req, { category: 'public', type: 'ic_card_query_all', detail: { total: cards.length } });
|
||||
return res.json({ ok: true, cards });
|
||||
}
|
||||
const normCardId = normalizeIcCardId(q);
|
||||
const normOrderCode = String(q || '').trim().toUpperCase();
|
||||
|
||||
Reference in New Issue
Block a user