From 5b065fdcce4c9d7e4c8dc81da2236b6b792df00d Mon Sep 17 00:00:00 2001 From: lkddi Date: Tue, 17 Mar 2026 21:24:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AC=A2=E8=BF=8E=E8=AF=AD=EF=BC=9A=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E4=B8=BA=E8=93=9D=E8=89=B2=E8=BE=B9=E6=A1=86=E5=85=AC?= =?UTF-8?q?=E5=91=8A=E6=A0=B7=E5=BC=8F=EF=BC=88=E4=BD=8E=E4=BA=8E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=85=AC=E5=91=8A=EF=BC=89=EF=BC=8C=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=89=8D=E4=B8=B4=E6=97=B6=E8=AE=BE=20action=3D=E6=AC=A2?= =?UTF-8?q?=E8=BF=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chat/partials/scripts.blade.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index b59035c..83ad890 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -151,8 +151,16 @@ const menu = document.getElementById('welcome-menu'); if (menu) { menu.style.display = 'none'; } + // 临时把 action 设为「欢迎」,让消息在聊天窗口以瓦蓝边框样式显示 + const actionSel = document.getElementById('action'); + const prevAction = actionSel?.value || ''; + if (actionSel) { actionSel.value = '欢迎'; } + // 自动触发发送 - sendMessage(null); + sendMessage(null).finally(() => { + // 发完后恢复原来的 action + if (actionSel) { actionSel.value = prevAction; } + }); } // 点击页面任意位置,关闭欢迎语浮层 @@ -492,6 +500,19 @@ html = `${iconImg} ${parsedContent}`; } + // 贾妖语 —— 蓝色左边框渐变样式,比 系统公告 低调 + else if (msg.action === '欢迎') { + div.style.cssText = + 'background: linear-gradient(135deg, #eff6ff, #f0f9ff); border: 1.5px solid #3b82f6; border-radius: 5px; padding: 5px 10px; margin: 3px 0; box-shadow: 0 1px 3px rgba(59,130,246,0.12);'; + + let parsedContent = msg.content; + parsedContent = parsedContent.replace(/【([^】]+)】/g, function(match, uName) { + return '【' + clickableUser(uName, '#1d4ed8') + '】'; + }); + + html = `
💬 ${parsedContent} (${timeStr})
`; + timeStrOverride = true; + } // 接下来再判断各类发话人 else if (systemUsers.includes(msg.from_user)) { if (msg.from_user === '系统公告') {