fix(nav): publish menu contrast, check-in toast and button layout
Use solid light plate + forced ink on 发布 items, notyf instead of alert, and keep header check-in flex layout after success.
This commit is contained in:
1 parent
77164fee45
commit
35ac26db28
5 files changed
+238
-81
No files matched your search
@@ -206,6 +206,10 @@
|
||||
window.aksrtToast = function (msg, type) {
|
||||
aksrt.notyf(msg, { type: type || 'info', duration: 2200 });
|
||||
};
|
||||
// Alias used by several modules that call aksrt.toast(...)
|
||||
aksrt.toast = function (msg, type) {
|
||||
return aksrt.notyf(msg, typeof type === 'string' ? { type: type, duration: 2200 } : (type || { duration: 2200 }));
|
||||
};
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// §10.10 — confirm: i18n confirm dialog + [data-confirm]
|
||||
|
||||
@@ -17,12 +17,24 @@
|
||||
}
|
||||
|
||||
function toast(msg, type) {
|
||||
if (window.aksrt && typeof window.aksrt.toast === 'function') {
|
||||
window.aksrt.toast(msg, type || 'info');
|
||||
type = type || 'info';
|
||||
// Site-wide notification widget (aksrt-runtime notyf).
|
||||
if (window.aksrt && typeof window.aksrt.notyf === 'function') {
|
||||
window.aksrt.notyf(msg, { type: type, duration: 2200 });
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line no-alert
|
||||
window.alert(msg);
|
||||
if (typeof window.aksrtToast === 'function') {
|
||||
window.aksrtToast(msg, type);
|
||||
return;
|
||||
}
|
||||
if (typeof window.AksrtToast === 'function') {
|
||||
window.AksrtToast(msg, type);
|
||||
return;
|
||||
}
|
||||
// Last resort: non-blocking console (never native alert for UX).
|
||||
if (window.console && typeof window.console.log === 'function') {
|
||||
window.console.log('[aksrt]', type, msg);
|
||||
}
|
||||
}
|
||||
|
||||
function openModal(id) {
|
||||
@@ -91,7 +103,12 @@
|
||||
}
|
||||
toast((res.data && res.data.message) || '签到成功', 'success');
|
||||
btn.classList.add('is-done');
|
||||
btn.innerHTML = '<i class="fas fa-calendar-check" aria-hidden="true"></i> 今日已签到';
|
||||
btn.disabled = true;
|
||||
btn.setAttribute('disabled', 'disabled');
|
||||
// Keep existing structure so CSS layout (.but.block flex) is not lost.
|
||||
btn.innerHTML =
|
||||
'<i class="fas fa-calendar-check" aria-hidden="true"></i>' +
|
||||
'<span>今日已签到</span>';
|
||||
})
|
||||
.catch(function () {
|
||||
toast('网络错误', 'danger');
|
||||
|
||||
Reference in new issue
Block a user