feat(checkin): open reference-parity details modal from signed buttons
- Rebuild checkin details modal HTML 1:1 with reference theme: colorful header c-blue, user card (points/level), daily reward card and 7-day continuous mini cards - Signed entry buttons (header dropdown, user-card badge, user center) become clickable checkin-details-link modal triggers instead of disabled buttons - Swap data-signin-btn to details link in place after successful signin (reference .initiate-checkin replacement behavior) - Add aksrt-checkin-details-modal runtime shell (modal-mini 400px) - Remove dead code: legacy lite modal, admin-ajax details handler, /signin/history route, signin calendar; rebuild public bundles - Update contract tests to the new checkin modal contract
This commit is contained in:
1 parent
c289016324
commit
4653128a18
15 files changed
+211
-266
No files matched your search
@@ -72,6 +72,26 @@
|
||||
});
|
||||
}
|
||||
|
||||
// 签到成功后,入口按钮就地替换为「已签到」详情弹窗触发链接
|
||||
// (参考主题:.initiate-checkin → details_link 的替换行为)。
|
||||
function swapButtonsToDetailsLink() {
|
||||
var url = window.aksrtData && window.aksrtData.signinDetailsUrl;
|
||||
if (!url) return;
|
||||
currentButtons().forEach(function (button) {
|
||||
var link = document.createElement('a');
|
||||
link.href = 'javascript:;';
|
||||
link.className = (button.className || '') + ' checkin-details-link';
|
||||
link.setAttribute('data-aksrt-modal', 'remote');
|
||||
link.setAttribute('data-aksrt-modal-url', url);
|
||||
link.setAttribute('data-aksrt-modal-class', 'aksrt-checkin-details-modal modal-mini');
|
||||
link.setAttribute('data-aksrt-modal-height', '240');
|
||||
link.setAttribute('data-aksrt-modal-mobile-bottom', 'true');
|
||||
link.setAttribute('data-aksrt-modal-cache', 'false');
|
||||
link.innerHTML = button.innerHTML;
|
||||
button.replaceWith(link);
|
||||
});
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
api('/signin/today').then(function (result) {
|
||||
if (!result.ok) {
|
||||
@@ -90,6 +110,7 @@
|
||||
if (data.signed) {
|
||||
setStatusHtml('已签到 <strong>' + data.streak + '</strong> 天 +' + data.reward_today);
|
||||
setButtonState('done');
|
||||
swapButtonsToDetailsLink();
|
||||
return;
|
||||
}
|
||||
setStatusHtml('连续 <strong>' + data.streak + '</strong> 天,+' + data.reward_if_signin);
|
||||
@@ -120,6 +141,7 @@
|
||||
element.title = element.textContent;
|
||||
});
|
||||
setButtonState('done');
|
||||
swapButtonsToDetailsLink();
|
||||
refresh();
|
||||
}).finally(function () {
|
||||
if (window.AKSRTCaptcha) window.AKSRTCaptcha.reset('signin', captchaMount());
|
||||
|
||||
Reference in new issue
Block a user