Files
saasshop/public/js/admin.js

35 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// SaaSShop Admin JS
// 说明:用于增强总台管理的运营交互体验(尽量保持小而可治理)。
// 原则:不引入复杂构建链;以渐进增强为主,页面无 JS 也应可用。
(function () {
if (window.__SAASSHOP_ADMIN_JS__) {
return;
}
window.__SAASSHOP_ADMIN_JS__ = true;
function qs(sel, root) {
return (root || document).querySelector(sel);
}
// 续费缺订阅治理订单详情页“绑定订阅ID”输入框小交互增强
// - 输入后按 Enter 直接提交
// - 自动聚焦,减少点击
var attachInput = qs('#attach_site_subscription_id');
if (attachInput) {
try {
attachInput.focus();
} catch (e) {}
attachInput.addEventListener('keydown', function (e) {
if (e && (e.key === 'Enter' || e.keyCode === 13)) {
var form = attachInput.form;
if (form) {
e.preventDefault();
form.submit();
}
}
});
}
})();