feat(js): #filters锚点跳转自动展开平台订单筛选面板
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user