feat(js): #filters锚点跳转自动展开平台订单筛选面板

This commit is contained in:
萝卜
2026-03-17 16:47:03 +08:00
parent f267d251ed
commit 6d94583231
2 changed files with 50 additions and 0 deletions

View File

@@ -68,6 +68,33 @@
}
})();
// 平台订单列表页:当从批次页等入口带 #filters 跳转过来时,自动展开筛选面板并定位。
// 说明筛选面板会记忆折叠状态localStorage若运营之前手动收起再跳转回来可能看不到筛选条件。
(function () {
if (!window.location || String(window.location.hash || '') !== '#filters') {
return;
}
var d = qs('#filters');
if (!d) {
return;
}
// 若是 <details>,确保展开
if (String(d.tagName || '').toLowerCase() === 'details') {
d.open = true;
}
// 轻量定位(不强依赖 smooth
try {
d.scrollIntoView({ behavior: 'smooth', block: 'start' });
} catch (e) {
try {
d.scrollIntoView();
} catch (e2) {}
}
})();
// 通用:表单提交后禁用按钮,避免运营重复点击造成重复请求
// 用法form 标记 data-action="disable-on-submit"。
(function () {