From 3e85cb67bc34b9f71c0d5c4dc76bd21dd2934c43 Mon Sep 17 00:00:00 2001 From: pllx Date: Mon, 27 Apr 2026 05:45:36 +0000 Subject: [PATCH] =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E5=90=8D=E5=8D=95=E5=BE=BD?= =?UTF-8?q?=E6=A0=87=E6=94=B9=E4=B8=BA=E4=BB=85=E5=9B=BE=E6=A0=87=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=96=87=E5=AD=97=E6=A0=87=E7=AD=BE=E8=8A=82?= =?UTF-8?q?=E7=9C=81=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - buildUserStatusBadgeHtml: 状态徽标从 pill 胶囊(图标+文字)改为仅图标 - buildUserSignIdentityBadgeHtml: 签到身份徽标同样改为仅图标 - 两个徽标的 tooltip 信息保留,悬停仍可看到完整描述 --- app/Http/Controllers/ChatController.php | 1 + .../views/chat/partials/scripts.blade.php | 27 ++++--------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/app/Http/Controllers/ChatController.php b/app/Http/Controllers/ChatController.php index eeb9442..191604f 100644 --- a/app/Http/Controllers/ChatController.php +++ b/app/Http/Controllers/ChatController.php @@ -124,6 +124,7 @@ class ChatController extends Controller broadcast(new UserJoined($id, $user->username, $userData))->toOthers(); // 新人首次进入:赠送 6666 金币、播放满场烟花、发送全场欢迎通告 + $user->refresh(); if (! $user->has_received_new_gift) { // 通过统一积分服务发放新人礼包 6666 金币并记录流水 $this->currencyService->change( diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index 302323a..ba85268 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -2212,16 +2212,9 @@ } const safeIcon = escapeHtml(status.icon); - const safeLabel = escapeHtml(status.label); const safeTooltip = escapeHtml(`${status.group} · ${status.label}`); - return ` - - ${safeIcon} - ${safeLabel} - - `; + return `${safeIcon}`; } /** @@ -2232,27 +2225,17 @@ */ function buildUserSignIdentityBadgeHtml(user) { const identityKey = String(user.sign_identity_key ?? user.sign_identity ?? ''); - const identityLabel = String(user.sign_identity_label ?? user.sign_identity_name ?? ''); const identityIcon = String(user.sign_identity_icon ?? ''); - if (!identityKey || !identityLabel || !identityIcon) { + if (!identityKey || !identityIcon) { return ''; } - const color = String(user.sign_identity_color || '#0f766e'); - const bgColor = String(user.sign_identity_bg_color || '#ccfbf1'); - const borderColor = String(user.sign_identity_border_color || '#5eead4'); + const identityLabel = String(user.sign_identity_label ?? user.sign_identity_name ?? ''); const safeIcon = escapeHtml(identityIcon); - const safeLabel = escapeHtml(identityLabel); - const safeTooltip = escapeHtml(`签到 · ${identityLabel}`); + const safeTooltip = escapeHtml(identityLabel ? `签到 · ${identityLabel}` : '签到身份'); - return ` - - ${safeIcon} - ${safeLabel} - - `; + return `${safeIcon}`; } /**