修复PHP定时器bug:打开弹窗时隐藏C位按钮,定时器忽略glassLoginDismissed,关闭弹窗时重新显示C位按钮
This commit is contained in:
+5
-2
@@ -866,6 +866,8 @@ if ($currentVersion !== $BUILD_VERSION) {
|
|||||||
const overlay = document.getElementById('glassLoginOverlay');
|
const overlay = document.getElementById('glassLoginOverlay');
|
||||||
overlay.classList.add('show');
|
overlay.classList.add('show');
|
||||||
glassLoginDismissed = false;
|
glassLoginDismissed = false;
|
||||||
|
// 隐藏C位登录按钮
|
||||||
|
document.querySelector('.guest-center-login').classList.remove('show');
|
||||||
// 停止定时弹窗
|
// 停止定时弹窗
|
||||||
if (guestLoginTimer) { clearInterval(guestLoginTimer); guestLoginTimer = null; }
|
if (guestLoginTimer) { clearInterval(guestLoginTimer); guestLoginTimer = null; }
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -880,6 +882,8 @@ if ($currentVersion !== $BUILD_VERSION) {
|
|||||||
document.getElementById('glassLoginOverlay').classList.remove('show');
|
document.getElementById('glassLoginOverlay').classList.remove('show');
|
||||||
glassLoginDismissed = true;
|
glassLoginDismissed = true;
|
||||||
glassLoginReset();
|
glassLoginReset();
|
||||||
|
// 重新显示C位登录按钮(如果还是游客模式)
|
||||||
|
if (IS_PREVIEW) document.querySelector('.guest-center-login').classList.add('show');
|
||||||
// 重新启动定时弹窗
|
// 重新启动定时弹窗
|
||||||
if (IS_PREVIEW) startGuestLoginTimer();
|
if (IS_PREVIEW) startGuestLoginTimer();
|
||||||
}
|
}
|
||||||
@@ -961,9 +965,8 @@ if ($currentVersion !== $BUILD_VERSION) {
|
|||||||
if (guestLoginTimer) clearInterval(guestLoginTimer);
|
if (guestLoginTimer) clearInterval(guestLoginTimer);
|
||||||
guestLoginTimer = setInterval(() => {
|
guestLoginTimer = setInterval(() => {
|
||||||
if (!IS_PREVIEW) { clearInterval(guestLoginTimer); guestLoginTimer = null; return; }
|
if (!IS_PREVIEW) { clearInterval(guestLoginTimer); guestLoginTimer = null; return; }
|
||||||
if (!glassLoginDismissed) {
|
// 只要游客模式就弹窗,忽略glassLoginDismissed
|
||||||
openGlassLogin();
|
openGlassLogin();
|
||||||
}
|
|
||||||
}, 60000);
|
}, 60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user