fix(user-center): restore ajax tab navigation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,9 +10,8 @@
|
||||
@media (max-width: 767px) {
|
||||
.uc-mobile-tabs {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
flex-wrap: wrap;
|
||||
overflow: hidden;
|
||||
gap: 4px;
|
||||
padding-bottom: 12px;
|
||||
margin-bottom: 16px;
|
||||
|
||||
@@ -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]'));
|
||||
})();
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
var target = panels[name].panel;
|
||||
if (target.dataset.panelLoaded === 'true') return Promise.resolve();
|
||||
if (target._aksrtPanelRequest) return target._aksrtPanelRequest;
|
||||
var restUrl = (window.aksrtData && (window.aksrtData.restUrl || window.aksrtData.apiUrl)) || '';
|
||||
var restUrl = (window.aksrtData && (window.aksrtData.restUrl || window.aksrtData.apiUrl)) || cfg.restUrl || '';
|
||||
if (!restUrl) return Promise.reject(new Error('rest-unavailable'));
|
||||
target.classList.add('is-loading');
|
||||
var url = restUrl.replace(/\/$/, '') + '/user-center/panel/' + encodeURIComponent(name);
|
||||
|
||||
Reference in New Issue
Block a user