优化商店、游戏文字通知

This commit is contained in:
2026-04-27 12:16:18 +08:00
parent f6bc8a83c3
commit c9d4d3dbf4
4 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -213,7 +213,7 @@ class CloseHorseRaceJob implements ShouldQueue
'to_user' => $username,
'content' => "🏇 赛马第 #{$race->id} 场已结束,冠军:{$winnerName}。你押注 {$horseId} 号马 {$betAmountText} 金币,{$summaryText};当前金币:{$freshGold} 枚。",
'is_secret' => true,
'font_color' => '#f59e0b',
'font_color' => '#16a34a',
'action' => '',
'sent_at' => now()->toDateTimeString(),
'toast_notification' => [
@@ -252,7 +252,7 @@ class CloseHorseRaceJob implements ShouldQueue
'to_user' => '大家',
'content' => $content,
'is_secret' => false,
'font_color' => '#f59e0b',
'font_color' => '#16a34a',
'action' => '大声宣告',
'sent_at' => now()->toDateTimeString(),
];
+1 -1
View File
@@ -88,7 +88,7 @@ class OpenHorseRaceJob implements ShouldQueue
'to_user' => '大家',
'content' => $content,
'is_secret' => false,
'font_color' => '#f59e0b',
'font_color' => '#16a34a',
'action' => '大声宣告',
'sent_at' => $now->toDateTimeString(),
];
+1 -1
View File
@@ -78,7 +78,7 @@ class RunHorseRaceJob implements ShouldQueue
'to_user' => '大家',
'content' => "🏇 【赛马】第 #{$race->id} 场押注截止!马匹已进入跑道,比赛开始!参赛阵容:{$horseList}",
'is_secret' => false,
'font_color' => '#336699',
'font_color' => '#16a34a',
'action' => '大声宣告',
'sent_at' => now()->toDateTimeString(),
];
@@ -2558,24 +2558,25 @@
`<div style="font-size: 18px; line-height: 1.75; font-weight: 800; color: #dc2626;">${parsedContent} <span style="color: #999; font-size: 14px; font-weight: 500;">(${timeStr})</span></div>`;
timeStrOverride = true;
} else if (msg.from_user === '系统传音') {
// 游戏播报(百家乐/赛马/神秘箱子/双色球/五子棋/老虎机):参照钓鱼播报的普通样式,无背景色
// 游戏/商店播报(百家乐/赛马/神秘箱子/双色球/五子棋/老虎机/商店购买):参照钓鱼播报的普通样式,无背景色
const content = msg.content || '';
const isGameNotification =
const isPlainNotification =
content.includes('【百家乐】') ||
content.includes('【赛马】') ||
content.includes('神秘箱子') ||
content.includes('【双色球') ||
content.includes('【五子棋】') ||
content.includes('【老虎机】');
content.includes('【老虎机】') ||
content.includes('购买了'); // 商店购买通知
if (isGameNotification) {
// 游戏播报:普通样式(参照钓鱼播报),无背景色无边框
if (isPlainNotification) {
// 游戏/商店播报:普通样式(参照钓鱼播报),无背景色无边框
let parsedContent = msg.content;
parsedContent = parsedContent.replace(/([^]+)/g, function(match, uName) {
return '【' + clickableUser(uName, '#000099') + '】';
});
html =
`${headImg}<span style="font-weight: bold;">${clickableUser(msg.from_user, fontColor, nameClass)}</span><span class="msg-content" style="color: ${fontColor}">${parsedContent}</span>`;
`${headImg}<span style="font-weight: bold;">${clickableUser(msg.from_user, fontColor, nameClass)}</span><span class="msg-content" style="color: ${fontColor}; font-weight: bold;">${parsedContent}</span>`;
} else {
// 自动升级播报 / 赠礼通知 / 婚恋广播 等非游戏系统传音:金色左边框,轻量提示样式,不喧宾夺主
div.style.cssText =