优化 会员页面;

This commit is contained in:
2026-04-12 17:06:38 +08:00
parent 1e64d2d5e2
commit 77c17f87f9
7 changed files with 508 additions and 11 deletions
+10 -1
View File
@@ -76,12 +76,21 @@ class VipPresenceService
? $this->vipService->getJoinMessage($user)
: $this->vipService->getLeaveMessage($user);
// 只有在等级允许自定义时,才允许覆盖默认特效。
$customEffect = $type === 'join'
? $user->custom_join_effect
: $user->custom_leave_effect;
if (! $user->canCustomizeVipPresence()) {
$customEffect = null;
}
return [
'enabled' => true,
'type' => $type,
'text' => $customMessage ?: $templateMessage,
'color' => $vipLevel->color ?: '#f59e0b',
'effect' => $type === 'join' ? $this->normalizeEffect($vipLevel->joinEffectKey()) : $this->normalizeEffect($vipLevel->leaveEffectKey()),
'effect' => $this->normalizeEffect($customEffect ?: ($type === 'join' ? $vipLevel->joinEffectKey() : $vipLevel->leaveEffectKey())),
'banner_style' => $type === 'join' ? $vipLevel->joinBannerStyleKey() : $vipLevel->leaveBannerStyleKey(),
'level_name' => $vipLevel->name,
'icon' => $vipLevel->icon,