From 5b3378389bcb2efe5aef744ce9dda063a0b16dc2 Mon Sep 17 00:00:00 2001 From: lkddi Date: Fri, 27 Feb 2026 11:09:36 +0800 Subject: [PATCH] =?UTF-8?q?UI:=20=E4=BC=98=E5=8C=96=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E6=A0=B7=E5=BC=8F=EF=BC=8C=E5=B0=86=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=97=B6=E9=97=B4=E7=A7=BB=E5=8A=A8=E8=87=B3=E5=8F=B3?= =?UTF-8?q?=E4=B8=8B=E8=A7=92=E5=B9=B6=E9=98=B2=E6=AD=A2=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E9=87=8D=E5=A4=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/chat/partials/scripts.blade.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index f551360..6b13e99 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -215,6 +215,7 @@ div.className = 'msg-line'; const timeStr = msg.sent_at || ''; + let timeStrOverride = false; // 系统用户名列表(不可被选为聊天对象) const systemUsers = ['钓鱼播报', '星海小博士', '系统传音', '系统公告', 'AI小班长', '送花播报']; @@ -241,11 +242,14 @@ // 系统用户消息以醒目公告样式显示 if (systemUsers.includes(msg.from_user)) { if (msg.from_user === '系统公告' || msg.from_user === '系统传音') { - // 管理员公告/系统传音:大字醒目样式 + // 管理员公告/系统传音:大字醒目样式,时间右下角对齐 div.style.cssText = - 'background: linear-gradient(135deg, #fef2f2, #fff1f2); border: 2px solid #ef4444; border-radius: 6px; padding: 8px 12px; margin: 4px 0; box-shadow: 0 2px 4px rgba(239,68,68,0.15);'; + 'background: linear-gradient(135deg, #fef2f2, #fff1f2); border: 2px solid #ef4444; border-radius: 6px; padding: 8px 12px; margin: 4px 0; box-shadow: 0 2px 4px rgba(239,68,68,0.15); display: flex; flex-direction: column; gap: 8px;'; html = - `
${msg.content}
`; + `
${msg.content}
+
(${timeStr})
`; + // 由于我们把时间放进了特殊的结构里,这里把原有的外层时间置空,防止重复显示 + timeStrOverride = true; } else { // 其他系统用户(钓鱼播报、送花播报、AI小班长等):普通样式 let giftHtml = ''; @@ -272,7 +276,9 @@ html += `说:${msg.content}`; } - html += ` (${timeStr})`; + if (!timeStrOverride) { + html += ` (${timeStr})`; + } div.innerHTML = html; // 路由规则(复刻原版):