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 = '';