Fix: 系统存点通知改回悄悄话私信,避免多人刷屏;前端单独渲染为绿色通知条无头像

This commit is contained in:
2026-02-27 12:53:30 +08:00
parent 638bc9deda
commit caecceba1b
2 changed files with 14 additions and 6 deletions
@@ -266,11 +266,19 @@
`${headImg}<span class="msg-user" style="color: ${fontColor}; font-weight: bold;">${msg.from_user}</span><span class="msg-content" style="color: ${fontColor}">${msg.content}</span>${giftHtml}`;
}
} else if (msg.is_secret) {
// 悄悄话样式(原版:紫色斜体)
html =
`<span class="msg-secret">${headImg}${clickableUser(msg.from_user, '#cc00cc')}对${clickableUser(msg.to_user, '#cc00cc')}`;
if (msg.action) html += `${msg.action}`;
html += `悄悄说:${msg.content}</span>`;
if (msg.from_user === '系统') {
// 系统悄悄通知(自动存点等):绿色左边框条形,无头像,不显示"悄悄说"
div.style.cssText =
'background:#f0fdf4;border-left:3px solid #16a34a;border-radius:4px;padding:3px 8px;margin:2px 0;font-size:12px;';
html =
`<span style="color:#16a34a;font-weight:bold;">📢 系统:</span><span style="color:#15803d;">${msg.content}</span>`;
} else {
// 普通悄悄话样式(原版:紫色斜体)
html =
`<span class="msg-secret">${headImg}${clickableUser(msg.from_user, '#cc00cc')}对${clickableUser(msg.to_user, '#cc00cc')}`;
if (msg.action) html += `${msg.action}`;
html += `悄悄说:${msg.content}</span>`;
}
} else if (msg.to_user && msg.to_user !== '大家') {
html = `${headImg}${clickableUser(msg.from_user, '#000099')}对${clickableUser(msg.to_user, '#000099')}`;
if (msg.action) html += `${msg.action}`;