diff --git a/resources/views/chat/partials/toolbar.blade.php b/resources/views/chat/partials/toolbar.blade.php index 1cf3abb..0c579a1 100644 --- a/resources/views/chat/partials/toolbar.blade.php +++ b/resources/views/chat/partials/toolbar.blade.php @@ -35,7 +35,32 @@
排行
@endif -
离开 +
离开 +
+
+ +{{-- ═══════════ 离开确认弹窗(自定义,避免 Chrome 原生 confirm 冲突)═══════════ --}} + @@ -315,6 +340,20 @@ btn.style.cursor = 'pointer'; } } + /** 显示离开确认弹窗(替代原生 confirm,避免 Chrome 弹窗冲突) */ + function showLeaveConfirm() { + document.getElementById('leave-confirm-modal').style.display = 'flex'; + } + + /** 隐藏离开确认弹窗 */ + function hideLeaveConfirm() { + document.getElementById('leave-confirm-modal').style.display = 'none'; + } + + // 点遮罩关闭 + document.getElementById('leave-confirm-modal').addEventListener('click', function(e) { + if (e.target === this) hideLeaveConfirm(); + }); {{-- ═══════════ 商店弹窗 ═══════════ --}}