From 065e82f8b700c870d5f57a00dc89f0bbc3dbbe0f Mon Sep 17 00:00:00 2001 From: lkddi Date: Thu, 26 Feb 2026 23:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E7=A6=81=E8=A8=80/?= =?UTF-8?q?=E8=A7=A3=E7=A6=81=E9=80=9A=E7=9F=A5=E8=B7=AF=E7=94=B1=E5=88=B0?= =?UTF-8?q?=E8=A2=AB=E7=A6=81=E8=A8=80=E8=80=85=E7=9A=84=E5=8C=85=E5=8E=A2?= =?UTF-8?q?=E7=AA=97=E5=8F=A3(say2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 被禁言者在 say2 看到禁言/解禁提示 - 其他人在 say1(公聊)看到禁言通知 --- .../views/chat/partials/scripts.blade.php | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index 301714b..7242b1c 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -462,16 +462,21 @@ now.getMinutes().toString().padStart(2, '0') + ':' + now.getSeconds().toString().padStart(2, '0'); - // 在聊天窗口显示禁言通知 + const isMe = d.username === window.chatContext.username; + + // 禁言通知:自己被禁言显示在包厢(say2),其他人显示在公聊(say1) const div = document.createElement('div'); div.className = 'msg-line'; div.innerHTML = `【系统】${d.message}(${timeStr})`; - container.appendChild(div); - if (autoScroll) container.scrollTop = container.scrollHeight; + const targetContainer = isMe ? document.getElementById('say2') : container; + if (targetContainer) { + targetContainer.appendChild(div); + targetContainer.scrollTop = targetContainer.scrollHeight; + } // 如果是自己被禁言,设置本地禁言计时 - if (d.username === window.chatContext.username && d.mute_time > 0) { + if (isMe && d.mute_time > 0) { isMutedUntil = Date.now() + d.mute_time * 60 * 1000; const contentInput = document.getElementById('content'); const operatorName = d.operator || '管理员'; @@ -487,8 +492,12 @@ unmuteDiv.className = 'msg-line'; unmuteDiv.innerHTML = '【系统】您的禁言已解除,可以继续发言了。'; - container.appendChild(unmuteDiv); - if (autoScroll) container.scrollTop = container.scrollHeight; + // 解禁提示也显示在包厢窗口 + const say2 = document.getElementById('say2'); + if (say2) { + say2.appendChild(unmuteDiv); + say2.scrollTop = say2.scrollHeight; + } }, d.mute_time * 60 * 1000); } }