fix(payment): 修复卡密管理分页:页码夹取、显式基准 URL、补齐每页条数入口
- render_pagenavi():页码先夹到 [1, total_pages],禁用状态由 $on_first / $on_last 一次导出。旧写法是一串 if/elseif,页码越界时三个分支一个都不命中, 上一页与下一页同时停在 '#':既不打 disabled 也点不动。 - 翻页链接改用显式基准 URL(page_url + 当前筛选参数),不再依赖 add_query_arg() 默认取 $_SERVER['REQUEST_URI'] 的行为; status / type / other / s / orderby / desc / ice_perpage 随链接带走。 - render_list():页码越界(手改 URL、或筛选后总数变小)时回退到最后一页重查, 消除「空白表格 + 一个分页控件都没有」的死胡同。 - 新增「每页显示」选择器(ice_perpage)。该参数此前只有服务端读取、界面上没有 任何入口能改,条数小于默认每页条数时永远只有一页,分页条恒为 disabled。 - 禁用按钮加 pointer-events:none,避免点空还滚回页首。 - 新增 tests/admin/charge-cards-pagination.test.cjs(6 条契约)。 验证:容器内真实渲染 7 组 URL(默认 / 每页 5 / 第 2 页 / paged=2 越界 / paged=99 越界 / 带 status 筛选 / 非预设每页 7),无头 Chrome 截图核对版式; node --test 三套 18/18 通过;负向对照(还原旧写法)按要求失败 2 条;php -l 通过。
This commit is contained in:
1 parent
1e5286d36b
commit
0e7b888277
3 files changed
+242
-35
No files matched your search
@@ -59,6 +59,7 @@
|
||||
/tests/admin/*
|
||||
!/tests/admin/charge-cards-page-contract.test.cjs
|
||||
!/tests/admin/charge-cards-dependency.test.cjs
|
||||
!/tests/admin/charge-cards-pagination.test.cjs
|
||||
!/tests/front-submit/
|
||||
/tests/front-submit/*
|
||||
!/tests/front-submit/video-cover-contract.test.cjs
|
||||
|
||||
Reference in new issue
Block a user