fix(user-center): restore ajax tab navigation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-08-06 12:41:36 +08:00
1 parent 02fcde3c84
commit 8a007b9ee7
3 files changed
+15 -8

No files matched your search

+12 -4
View File
@@ -226,6 +226,10 @@
setWithdrawBusy(false);
}).catch(function () { setWithdrawBusy(false); setWithdrawTip('网络错误,请稍后重试', true); });
});
}
}
function initRewardNavigation(root, rest, data) {
var rewardTabs = root.querySelectorAll('.uc-reward-tabs a, .uc-reward-pagination a');
rewardTabs.forEach(function (link) {
link.addEventListener('click', function (event) {
@@ -246,16 +250,20 @@
if (!next) throw new Error('revenue-html-empty');
current.replaceWith(next);
window.history.pushState({}, '', targetUrl);
init(next);
window.AKSRTRevenueCenterInit(next);
});
}).catch(function () {
if (typeof showToast === 'function') showToast('加载失败,请重试');
});
});
});
}
}
window.AKSRTRevenueCenterInit = init;
init(document.querySelector('[data-aksrt-revenue-page]'));
window.AKSRTRevenueCenterInit = function (root) {
init(root);
var data = window.aksrtData || {};
var rest = data.restUrl || data.apiUrl || '';
if (root && rest) initRewardNavigation(root, rest.replace(/\/$/, ''), data);
};
window.AKSRTRevenueCenterInit(document.querySelector('[data-aksrt-revenue-page]'));
})();