From 638bc9deda7dd8099e4a458cb8743188e028145e Mon Sep 17 00:00:00 2001 From: lkddi Date: Fri, 27 Feb 2026 12:51:29 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=20=E4=BC=98=E5=8C=96=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AD=98=E7=82=B9=E9=80=9A=E7=9F=A5=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=EF=BC=8C=E6=94=B9=E4=B8=BA=E7=BB=BF=E8=89=B2?= =?UTF-8?q?=E5=B7=A6=E8=BE=B9=E6=A1=86=E7=AE=80=E6=B4=81=E6=9D=A1=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/AutoSaveExp.php | 16 ++++++++-------- resources/views/chat/partials/scripts.blade.php | 8 +++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/Console/Commands/AutoSaveExp.php b/app/Console/Commands/AutoSaveExp.php index 258431f..015b90f 100644 --- a/app/Console/Commands/AutoSaveExp.php +++ b/app/Console/Commands/AutoSaveExp.php @@ -189,21 +189,21 @@ class AutoSaveExp extends Command if ($actualJjbGain > 0) { $gainParts[] = "金币+{$actualJjbGain}"; } - $gainStr = ! empty($gainParts) ? '(' . implode(',', $gainParts) . ')' : ''; $jjbDisplay = $user->jjb ?? 0; + $gainStr = ! empty($gainParts) ? ' 本次获得:' . implode(',', $gainParts) : ''; - $levelInfo = $user->user_level >= $superLevel - ? "级别({$user->user_level});经验({$user->exp_num});金币({$jjbDisplay}枚);已满级。" - : "级别({$user->user_level});经验({$user->exp_num});金币({$jjbDisplay}枚)。"; + // 格式:⏰ 自动存点 · LV.100 · 经验 10,468 · 金币 8,345 · 已满级 · 本次获得:经验+1,金币+3 + $statusTag = $user->user_level >= $superLevel ? ' · 已满级 ✓' : ''; + $content = "⏰ 自动存点 · LV.{$user->user_level} · 经验 {$user->exp_num} · 金币 {$jjbDisplay}{$statusTag}{$gainStr}"; $noticeMsg = [ 'id' => $this->chatState->nextMessageId($roomId), 'room_id' => $roomId, 'from_user' => '系统', - 'to_user' => $username, // 定向推送给本人 - 'content' => "【系统为你自动存点】{$levelInfo} {$gainStr}", - 'is_secret' => true, // 私信模式,只有本人能看到 - 'font_color' => '#16a34a', // 草绿色 + 'to_user' => $username, // 定向推送给本人 + 'content' => $content, + 'is_secret' => false, // 由 to_user + from_user='系统' 控制显示位置 + 'font_color' => '#16a34a', // 草绿色 'action' => '', 'sent_at' => now()->toDateTimeString(), ]; diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index 73adbc2..be83fad 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -218,7 +218,7 @@ let timeStrOverride = false; // 系统用户名列表(不可被选为聊天对象) - const systemUsers = ['钓鱼播报', '星海小博士', '系统传音', '系统公告', 'AI小班长', '送花播报']; + const systemUsers = ['钓鱼播报', '星海小博士', '系统传音', '系统公告', 'AI小班长', '送花播报', '系统']; // 用户名(单击切换发言对象,双击查看资料;系统用户仅显示文本) const clickableUser = (uName, color) => { if (systemUsers.includes(uName)) { @@ -249,6 +249,12 @@ `
${msg.content} (${timeStr})
`; // 由于我们把时间放进了特殊的结构里,这里把原有的外层时间置空,防止重复显示 timeStrOverride = true; + } else if (msg.from_user === '系统' && msg.to_user && msg.to_user !== '大家') { + // 系统私人通知(自动存点等):无头像,绿色左边框简洁条形样式 + div.style.cssText = + 'background:#f0fdf4;border-left:3px solid #16a34a;border-radius:4px;padding:3px 8px;margin:2px 0;font-size:12px;'; + html = + `📢 系统:${msg.content}`; } else { // 其他系统用户(钓鱼播报、送花播报、AI小班长等):普通样式 let giftHtml = '';