fix(float): repair VIP rail entry front and admin

Always open VIP modal for float pay_vip, drop forced admin link,
normalize gem icon, harden pay-vip click binding and SPA form UX.
This commit is contained in:
kate522 committed 2026-07-22 10:32:00 +08:00
1 parent b7ee5987f0
commit b8ee6b6a43
6 files changed
+132 -23

No files matched your search

+29 -5
View File
@@ -242,23 +242,47 @@
}
function onDocClick(e) {
var t = e.target.closest(".pay-vip");
// Header CTA, float rail, UC buttons, VIP hover cards.
var t = e.target.closest(".pay-vip, a.pay-vip, .float-btn.pay-vip, [data-aksrt-pay-vip]");
if (!t) return;
// Allow real links without intercept if they point elsewhere and lack pay-vip intent.
// Real external href without modal intent: leave alone.
var href = (t.getAttribute("href") || "").trim();
if (href && href !== "#" && href.indexOf("javascript:") !== 0 && !t.classList.contains("pay-vip") && !t.hasAttribute("data-aksrt-pay-vip") && !t.hasAttribute("vip-level") && !t.hasAttribute("data-vip-level")) {
return;
}
e.preventDefault();
e.stopPropagation();
vipPay(t);
}
function init() {
// Capture phase so float/header anchors with href never navigate first.
document.addEventListener("click", onDocClick, true);
}
if (window.AksrtFrontend && typeof window.AksrtFrontend.register === "function") {
window.AksrtFrontend.register("aksrt-pay-vip", init);
// Prefer module registry, but always bind once as hard fallback
// (float rail must work even if AksrtFrontend.rehydrate is a no-op).
if (window.__aksrtPayVipBound) {
// already initialized
} else if (window.AksrtFrontend && typeof window.AksrtFrontend.register === "function") {
window.AksrtFrontend.register("aksrt-pay-vip", function () {
if (window.__aksrtPayVipBound) return;
window.__aksrtPayVipBound = true;
init();
});
// Also bind immediately — float button is in footer, available now.
if (!window.__aksrtPayVipBound) {
window.__aksrtPayVipBound = true;
init();
}
} else if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
document.addEventListener("DOMContentLoaded", function () {
if (window.__aksrtPayVipBound) return;
window.__aksrtPayVipBound = true;
init();
});
} else {
window.__aksrtPayVipBound = true;
init();
}