2026-02-26 21:10:34 +08:00
|
|
|
|
{{--
|
|
|
|
|
|
文件功能:聊天室主界面框架(frame 页面)
|
|
|
|
|
|
全屏沉浸式布局,不使用统一 layout
|
|
|
|
|
|
CSS 抽取到 /public/css/chat.css
|
|
|
|
|
|
JS 抽取到 chat.partials.scripts Blade 模板
|
|
|
|
|
|
|
|
|
|
|
|
@author ChatRoom Laravel
|
|
|
|
|
|
@version 1.0.0
|
|
|
|
|
|
--}}
|
2026-02-26 13:35:38 +08:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
<html lang="zh-CN">
|
|
|
|
|
|
|
|
|
|
|
|
<head>
|
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
<title>{{ $room->name ?? '聊天室' }} - 飘落流星</title>
|
|
|
|
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
2026-04-02 18:35:54 +08:00
|
|
|
|
<meta http-equiv="Delegate-CH" content="Sec-CH-UA https://s.magsrv.com; Sec-CH-UA-Mobile https://s.magsrv.com; Sec-CH-UA-Arch https://s.magsrv.com; Sec-CH-UA-Model https://s.magsrv.com; Sec-CH-UA-Platform https://s.magsrv.com; Sec-CH-UA-Platform-Version https://s.magsrv.com; Sec-CH-UA-Bitness https://s.magsrv.com; Sec-CH-UA-Full-Version-List https://s.magsrv.com; Sec-CH-UA-Full-Version https://s.magsrv.com;">
|
2026-02-26 21:10:34 +08:00
|
|
|
|
@php
|
|
|
|
|
|
// 从 sysparam 读取权限等级配置
|
2026-02-26 22:38:33 +08:00
|
|
|
|
$levelWarn = (int) \App\Models\Sysparam::getValue('level_warn', '5');
|
|
|
|
|
|
$levelKick = (int) \App\Models\Sysparam::getValue('level_kick', '10');
|
|
|
|
|
|
$levelMute = (int) \App\Models\Sysparam::getValue('level_mute', '8');
|
|
|
|
|
|
$levelBan = (int) \App\Models\Sysparam::getValue('level_ban', '12');
|
|
|
|
|
|
$levelBanip = (int) \App\Models\Sysparam::getValue('level_banip', '14');
|
|
|
|
|
|
$levelFreeze = (int) \App\Models\Sysparam::getValue('level_freeze', '14');
|
2026-02-26 21:10:34 +08:00
|
|
|
|
$superLevel = (int) \App\Models\Sysparam::getValue('superlevel', '100');
|
2026-02-26 22:38:33 +08:00
|
|
|
|
$myLevel = Auth::user()->user_level;
|
2026-04-21 16:43:17 +08:00
|
|
|
|
$positionPermissions = array_keys(array_filter($roomPermissionMap ?? []));
|
2026-04-21 18:00:02 +08:00
|
|
|
|
$operatorActivePosition = Auth::user()->activePosition?->load('position.department')->position;
|
|
|
|
|
|
$operatorDepartmentRank = (int) ($operatorActivePosition?->department?->rank ?? 0);
|
|
|
|
|
|
$operatorPositionRank = (int) ($operatorActivePosition?->rank ?? 0);
|
2026-02-26 21:10:34 +08:00
|
|
|
|
@endphp
|
2026-02-26 13:35:38 +08:00
|
|
|
|
<script>
|
|
|
|
|
|
window.chatContext = {
|
|
|
|
|
|
roomId: {{ $room->id }},
|
2026-03-01 01:41:04 +08:00
|
|
|
|
userId: {{ $user->id }},
|
2026-02-26 13:35:38 +08:00
|
|
|
|
username: "{{ $user->username }}",
|
2026-03-01 16:04:32 +08:00
|
|
|
|
userSex: "{{ match ((int) $user->sex) {1 => '男',2 => '女',default => ''} }}",
|
2026-02-26 13:35:38 +08:00
|
|
|
|
userLevel: {{ $user->user_level }},
|
2026-02-26 21:10:34 +08:00
|
|
|
|
superLevel: {{ $superLevel }},
|
|
|
|
|
|
levelKick: {{ $levelKick }},
|
|
|
|
|
|
levelMute: {{ $levelMute }},
|
|
|
|
|
|
levelBan: {{ $levelBan }},
|
|
|
|
|
|
levelBanip: {{ $levelBanip }},
|
2026-02-26 13:35:38 +08:00
|
|
|
|
sendUrl: "{{ route('chat.send', $room->id) }}",
|
2026-02-26 21:10:34 +08:00
|
|
|
|
leaveUrl: "{{ route('chat.leave', $room->id) }}",
|
2026-04-11 22:40:42 +08:00
|
|
|
|
expiredLeaveUrl: "{{ \Illuminate\Support\Facades\URL::temporarySignedRoute('chat.leave.expired', now()->addHours(12), ['id' => $room->id, 'user' => $user->id]) }}",
|
2026-02-26 21:10:34 +08:00
|
|
|
|
heartbeatUrl: "{{ route('chat.heartbeat', $room->id) }}",
|
|
|
|
|
|
fishCastUrl: "{{ route('fishing.cast', $room->id) }}",
|
2026-02-26 21:30:07 +08:00
|
|
|
|
fishReelUrl: "{{ route('fishing.reel', $room->id) }}",
|
|
|
|
|
|
chatBotUrl: "{{ route('chatbot.chat') }}",
|
|
|
|
|
|
chatBotClearUrl: "{{ route('chatbot.clear') }}",
|
2026-03-26 11:15:11 +08:00
|
|
|
|
@php
|
|
|
|
|
|
$chatbotEnabledState = \App\Models\Sysparam::getValue('chatbot_enabled', '0') === '1';
|
|
|
|
|
|
$botUserData = null;
|
|
|
|
|
|
if ($chatbotEnabledState) {
|
|
|
|
|
|
$botUser = \App\Models\User::where('username', 'AI小班长')->first();
|
|
|
|
|
|
if ($botUser) {
|
2026-04-24 21:17:44 +08:00
|
|
|
|
$botUserData = app(\App\Services\ChatUserPresenceService::class)->build($botUser);
|
|
|
|
|
|
$botUserData['headfaceUrl'] = $botUser->headfaceUrl;
|
2026-03-26 11:15:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@endphp
|
|
|
|
|
|
chatBotEnabled: {{ $chatbotEnabledState ? 'true' : 'false' }},
|
|
|
|
|
|
botUser: @json($botUserData),
|
2026-02-28 23:44:38 +08:00
|
|
|
|
hasPosition: {{ Auth::user()->activePosition || Auth::user()->user_level >= $superLevel ? 'true' : 'false' }},
|
2026-04-21 17:14:12 +08:00
|
|
|
|
hasRoomManagementPermission: {{ (! empty($hasRoomManagementPermission) || Auth::id() === 1) ? 'true' : 'false' }},
|
|
|
|
|
|
isSiteOwner: {{ Auth::id() === 1 ? 'true' : 'false' }},
|
2026-04-21 16:43:17 +08:00
|
|
|
|
positionPermissions: @json($positionPermissions),
|
|
|
|
|
|
positionPermissionMap: @json($roomPermissionMap ?? []),
|
2026-03-17 21:19:38 +08:00
|
|
|
|
@php
|
|
|
|
|
|
$activePos = Auth::user()->activePosition;
|
|
|
|
|
|
$deptName = $activePos?->position?->department?->name ?? '';
|
|
|
|
|
|
$posName = $activePos?->position?->name ?? '';
|
|
|
|
|
|
@endphp
|
|
|
|
|
|
welcomePrefix: "{{ $deptName ? "{$deptName} {$posName} {$user->username}" : $user->username }}",
|
2026-04-21 18:00:02 +08:00
|
|
|
|
operatorDepartmentRank: {{ $operatorDepartmentRank }},
|
|
|
|
|
|
operatorPositionRank: {{ $operatorPositionRank }},
|
2026-03-01 11:39:28 +08:00
|
|
|
|
myMaxReward: @php
|
2026-03-01 11:43:51 +08:00
|
|
|
|
if (Auth::id() === 1) {
|
|
|
|
|
|
// 超级管理员(id=1)无需职务,直接拥有不限量奖励权
|
|
|
|
|
|
echo -1;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
$pos = Auth::user()->activePosition?->position;
|
|
|
|
|
|
// -1 = 有权限但无上限(null),0 = 禁止,正整数 = 有具体上限
|
|
|
|
|
|
echo $pos ? ($pos->max_reward === null ? -1 : (int) $pos->max_reward) : 0;
|
|
|
|
|
|
}
|
2026-03-01 11:39:28 +08:00
|
|
|
|
@endphp,
|
2026-02-28 23:44:38 +08:00
|
|
|
|
appointPositionsUrl: "{{ route('chat.appoint.positions') }}",
|
|
|
|
|
|
appointUrl: "{{ route('chat.appoint.appoint') }}",
|
2026-03-01 11:09:29 +08:00
|
|
|
|
revokeUrl: "{{ route('chat.appoint.revoke') }}",
|
2026-03-01 11:50:12 +08:00
|
|
|
|
rewardUrl: "{{ route('command.reward') }}",
|
2026-03-01 15:31:07 +08:00
|
|
|
|
rewardQuotaUrl: "{{ route('command.reward_quota') }}",
|
2026-04-21 17:14:12 +08:00
|
|
|
|
refreshAllUrl: "{{ route('command.refresh_all') }}",
|
2026-04-14 22:48:29 +08:00
|
|
|
|
chatPreferencesUrl: "{{ route('user.update_chat_preferences') }}",
|
2026-04-24 21:17:44 +08:00
|
|
|
|
dailyStatusUpdateUrl: "{{ route('user.update_daily_status') }}",
|
2026-04-24 22:47:27 +08:00
|
|
|
|
dailySignInStatusUrl: @json(\Illuminate\Support\Facades\Route::has('daily-sign-in.status') ? route('daily-sign-in.status') : null),
|
|
|
|
|
|
dailySignInCalendarUrl: @json(\Illuminate\Support\Facades\Route::has('daily-sign-in.calendar') ? route('daily-sign-in.calendar') : null),
|
|
|
|
|
|
dailySignInClaimUrl: @json(\Illuminate\Support\Facades\Route::has('daily-sign-in.claim') ? route('daily-sign-in.claim') : null),
|
|
|
|
|
|
dailySignInMakeupUrl: @json(\Illuminate\Support\Facades\Route::has('daily-sign-in.makeup') ? route('daily-sign-in.makeup') : null),
|
2026-03-01 17:19:27 +08:00
|
|
|
|
userJjb: {{ (int) $user->jjb }}, // 当前用户金币(求婚前金额预检查用)
|
2026-03-18 20:12:17 +08:00
|
|
|
|
myGold: {{ (int) $user->jjb }}, // 赠金币面板显示余额用(赠送成功后前端更新)
|
2026-04-14 22:48:29 +08:00
|
|
|
|
chatPreferences: @json($user->chat_preferences ?? []),
|
2026-04-24 21:17:44 +08:00
|
|
|
|
currentDailyStatus: @json($activeDailyStatus),
|
|
|
|
|
|
dailyStatusCatalog: @json($dailyStatusCatalog),
|
2026-03-18 20:12:17 +08:00
|
|
|
|
|
2026-03-01 15:31:07 +08:00
|
|
|
|
// ─── 婚姻系统 ──────────────────────────────
|
2026-03-01 17:19:27 +08:00
|
|
|
|
minWeddingCost: {{ (int) \App\Models\WeddingTier::where('is_active', true)->orderBy('amount')->value('amount') ?? 0 }},
|
2026-03-01 15:31:07 +08:00
|
|
|
|
marriage: {
|
|
|
|
|
|
proposeUrl: "{{ route('marriage.propose') }}",
|
|
|
|
|
|
statusUrl: "{{ route('marriage.status') }}",
|
|
|
|
|
|
targteStatusUrl: "/marriage/target",
|
|
|
|
|
|
myRingsUrl: "{{ route('marriage.rings') }}",
|
|
|
|
|
|
acceptUrl: (id) => `/marriage/${id}/accept`,
|
|
|
|
|
|
rejectUrl: (id) => `/marriage/${id}/reject`,
|
|
|
|
|
|
divorceUrl: (id) => `/marriage/${id}/divorce`,
|
|
|
|
|
|
confirmDivorceUrl: (id) => `/marriage/${id}/confirm-divorce`,
|
2026-03-01 19:02:43 +08:00
|
|
|
|
rejectDivorceUrl: (id) => `/marriage/${id}/reject-divorce`,
|
|
|
|
|
|
divorceConfigUrl: '/marriage/divorce-config',
|
2026-03-01 15:31:07 +08:00
|
|
|
|
weddingTiersUrl: "/wedding/tiers",
|
|
|
|
|
|
weddingSetupUrl: (id) => `/wedding/${id}/setup`,
|
|
|
|
|
|
claimEnvelopeUrl: (id, ceremonyId) => `/wedding/${id}/claim`,
|
|
|
|
|
|
envelopeStatusUrl: (id) => `/wedding/${id}/envelope-status`,
|
2026-04-02 18:35:54 +08:00
|
|
|
|
},
|
2026-04-12 14:04:18 +08:00
|
|
|
|
earnRewardUrl: "{{ route('earn.video_reward') }}",
|
|
|
|
|
|
chatImageRetentionDays: 3
|
2026-02-26 13:35:38 +08:00
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@vite(['resources/css/app.css', 'resources/js/app.js', 'resources/js/chat.js'])
|
2026-03-15 17:08:13 +08:00
|
|
|
|
<script defer src="/js/alpinejs.min.js"></script>
|
2026-04-24 23:40:55 +08:00
|
|
|
|
<link rel="stylesheet" href="{{ asset('css/chat.css') }}?v={{ filemtime(public_path('css/chat.css')) }}">
|
2026-02-26 13:35:38 +08:00
|
|
|
|
</head>
|
|
|
|
|
|
|
2026-02-26 21:10:34 +08:00
|
|
|
|
<body>
|
|
|
|
|
|
<div class="chat-layout">
|
2026-02-26 13:35:38 +08:00
|
|
|
|
|
2026-02-26 21:10:34 +08:00
|
|
|
|
{{-- ═══════════ 左侧主区域 ═══════════ --}}
|
|
|
|
|
|
<div class="chat-left">
|
2026-02-26 13:35:38 +08:00
|
|
|
|
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- 顶部标题栏 + 公告滚动条(layout/ 子目录维护) --}}
|
|
|
|
|
|
@include('chat.partials.layout.header')
|
2026-02-26 13:35:38 +08:00
|
|
|
|
|
2026-02-26 21:10:34 +08:00
|
|
|
|
{{-- 消息窗格(双窗格,默认只显示 say1) --}}
|
|
|
|
|
|
<div class="message-panes" id="message-panes">
|
|
|
|
|
|
{{-- 主消息窗 --}}
|
|
|
|
|
|
<div class="message-pane say1" id="chat-messages-container">
|
|
|
|
|
|
<div class="msg-line">
|
|
|
|
|
|
<span style="color: #cc0000; font-weight: bold;">【公众窗口】</span>显示公众的发言!
|
|
|
|
|
|
<span class="msg-time">({{ now()->format('H:i:s') }})</span><br>
|
|
|
|
|
|
<span
|
|
|
|
|
|
style="color: #000099;">『{{ $room->name }}』{{ $room->description ?? '欢迎光临!畅所欲言,文明聊天。' }}</span>
|
|
|
|
|
|
</div>
|
2026-02-26 13:35:38 +08:00
|
|
|
|
</div>
|
2026-02-26 21:10:34 +08:00
|
|
|
|
{{-- 副消息窗(包厢窗) --}}
|
|
|
|
|
|
<div class="message-pane say2" id="chat-messages-container2">
|
|
|
|
|
|
<div class="msg-line">
|
|
|
|
|
|
<span style="color: #cc0000; font-weight: bold;">【包厢窗口】</span>显示包厢名单中聊友的发言!
|
|
|
|
|
|
<span class="msg-time">({{ now()->format('H:i:s') }})</span>
|
|
|
|
|
|
</div>
|
2026-02-26 13:35:38 +08:00
|
|
|
|
</div>
|
2026-02-26 21:10:34 +08:00
|
|
|
|
</div>
|
2026-02-26 13:35:38 +08:00
|
|
|
|
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- 底部输入工具栏(layout/ 子目录维护) --}}
|
|
|
|
|
|
@include('chat.partials.layout.input-bar')
|
2026-02-26 13:35:38 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- ═══════════ 竖向工具条(layout/ 子目录维护) ═══════════ --}}
|
|
|
|
|
|
@include('chat.partials.layout.toolbar')
|
2026-02-26 21:10:34 +08:00
|
|
|
|
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- ═══════════ 右侧用户面板(layout/ 子目录维护) ═══════════ --}}
|
|
|
|
|
|
@include('chat.partials.layout.right-panel')
|
2026-02-26 21:10:34 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-03-17 17:49:14 +08:00
|
|
|
|
{{-- ═══════════ 手机端浮动按钮 + 抽屉(≤ 640px 屏幕有效,独立维护)═══════════ --}}
|
|
|
|
|
|
@include('chat.partials.layout.mobile-drawer')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- ═══════════ 全局 UI 公共组件 ═══════════ --}}
|
2026-03-17 17:49:14 +08:00
|
|
|
|
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- 自定义弹窗(替代原生 alert/confirm/prompt,全页面可用) --}}
|
2026-03-01 00:34:11 +08:00
|
|
|
|
@include('chat.partials.global-dialog')
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- Toast 轻提示 --}}
|
2026-03-01 12:15:18 +08:00
|
|
|
|
@include('chat.partials.toast-notification')
|
2026-04-12 14:04:18 +08:00
|
|
|
|
{{-- 聊天图片大图预览层 --}}
|
|
|
|
|
|
<div id="chat-image-lightbox"
|
|
|
|
|
|
style="display:none; position:fixed; inset:0; z-index:10020; background:rgba(15,23,42,.86); backdrop-filter:blur(4px);"
|
|
|
|
|
|
onclick="closeChatImageLightbox(event)">
|
|
|
|
|
|
<div
|
|
|
|
|
|
style="position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:32px;"
|
|
|
|
|
|
onclick="closeChatImageLightbox(event)">
|
|
|
|
|
|
<img id="chat-image-lightbox-img" src="" alt="聊天图片预览"
|
|
|
|
|
|
onclick="event.stopPropagation()"
|
|
|
|
|
|
style="max-width:92vw; max-height:86vh; border-radius:12px; box-shadow:0 18px 50px rgba(0,0,0,.45);">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<button type="button" onclick="closeChatImageLightbox(event)"
|
|
|
|
|
|
style="position:absolute; top:20px; right:24px; z-index:10021; border:none; background:transparent; color:#fff; font-size:34px; cursor:pointer;">×</button>
|
|
|
|
|
|
<div id="chat-image-lightbox-name"
|
|
|
|
|
|
style="position:absolute; left:50%; bottom:24px; transform:translateX(-50%); z-index:10021; max-width:88vw; color:#e2e8f0; font-size:12px; text-align:center; word-break:break-all;">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- 大卡片通知(任命公告、好友通知、礼包选择等) --}}
|
|
|
|
|
|
@include('chat.partials.chat-banner')
|
|
|
|
|
|
|
|
|
|
|
|
{{-- ═══════════ 聊天室交互脚本(用户操作、好友通知等) ═══════════ --}}
|
2026-02-27 00:17:32 +08:00
|
|
|
|
@include('chat.partials.user-actions')
|
2026-03-09 11:30:11 +08:00
|
|
|
|
|
|
|
|
|
|
{{-- ═══════════ 活动与系统弹窗 ═══════════ --}}
|
|
|
|
|
|
{{-- 婚姻系统弹窗 --}}
|
2026-03-01 15:31:07 +08:00
|
|
|
|
@include('chat.partials.marriage-modals')
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- 节日福利弹窗 --}}
|
2026-03-01 20:06:53 +08:00
|
|
|
|
@include('chat.partials.holiday-modal')
|
2026-04-24 22:47:27 +08:00
|
|
|
|
@include('chat.partials.daily-sign-in-modal')
|
2026-03-09 11:30:11 +08:00
|
|
|
|
|
|
|
|
|
|
{{-- ═══════════ 游戏面板(partials/games/ 子目录,各自独立,包含 CSS + HTML + JS) ═══════════ --}}
|
|
|
|
|
|
@include('chat.partials.games.baccarat-panel')
|
|
|
|
|
|
@include('chat.partials.games.slot-machine')
|
|
|
|
|
|
@include('chat.partials.games.mystery-box')
|
|
|
|
|
|
@include('chat.partials.games.horse-race-panel')
|
|
|
|
|
|
@include('chat.partials.games.fortune-panel')
|
|
|
|
|
|
@include('chat.partials.games.lottery-panel')
|
|
|
|
|
|
@include('chat.partials.games.red-packet-panel')
|
|
|
|
|
|
@include('chat.partials.games.fishing-panel')
|
2026-03-12 08:35:21 +08:00
|
|
|
|
@include('chat.partials.games.game-hall')
|
2026-04-11 23:27:29 +08:00
|
|
|
|
@include('chat.partials.games.baccarat-loss-cover-panel')
|
2026-03-12 08:35:21 +08:00
|
|
|
|
@include('chat.partials.games.gomoku-panel')
|
2026-04-02 18:35:54 +08:00
|
|
|
|
@include('chat.partials.games.earn-panel')
|
2026-02-27 14:14:35 +08:00
|
|
|
|
|
2026-04-12 16:48:58 +08:00
|
|
|
|
{{-- 全屏特效系统:管理员和会员入场可触发的全屏动效 --}}
|
2026-03-01 13:07:36 +08:00
|
|
|
|
<script src="/js/effects/effect-sounds.js"></script>
|
2026-02-27 14:14:35 +08:00
|
|
|
|
<script src="/js/effects/effect-manager.js"></script>
|
|
|
|
|
|
<script src="/js/effects/fireworks.js"></script>
|
|
|
|
|
|
<script src="/js/effects/rain.js"></script>
|
|
|
|
|
|
<script src="/js/effects/lightning.js"></script>
|
2026-02-27 14:22:13 +08:00
|
|
|
|
<script src="/js/effects/snow.js"></script>
|
2026-04-12 16:48:58 +08:00
|
|
|
|
<script src="/js/effects/sakura.js"></script>
|
|
|
|
|
|
<script src="/js/effects/meteors.js"></script>
|
|
|
|
|
|
<script src="/js/effects/gold-rain.js"></script>
|
|
|
|
|
|
<script src="/js/effects/hearts.js"></script>
|
|
|
|
|
|
<script src="/js/effects/confetti.js"></script>
|
|
|
|
|
|
<script src="/js/effects/fireflies.js"></script>
|
2026-02-27 14:14:35 +08:00
|
|
|
|
|
2026-02-26 21:10:34 +08:00
|
|
|
|
@include('chat.partials.scripts')
|
|
|
|
|
|
|
2026-03-09 11:30:11 +08:00
|
|
|
|
{{-- 辅助与全局事件组件 --}}
|
|
|
|
|
|
@include('chat.partials.ai-chatbot')
|
|
|
|
|
|
@include('chat.partials.system-events')
|
2026-02-28 11:17:09 +08:00
|
|
|
|
{{-- 页面初始加载时,渲染自带的历史记录(解决入场欢迎语错过断网的问题) --}}
|
|
|
|
|
|
@if (!empty($historyMessages))
|
|
|
|
|
|
<script>
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
const historyMsgs = @json($historyMessages);
|
2026-02-28 11:20:34 +08:00
|
|
|
|
const clearId = parseInt(localStorage.getItem(`local_clear_msg_id_{{ $room->id }}`) || '0', 10);
|
|
|
|
|
|
|
2026-02-28 11:17:09 +08:00
|
|
|
|
if (historyMsgs && historyMsgs.length > 0) {
|
|
|
|
|
|
// 全局函数 appendMessage 在 scripts.blade.php 中定义
|
|
|
|
|
|
historyMsgs.forEach(msg => {
|
2026-02-28 11:20:34 +08:00
|
|
|
|
// 如果开启了本地清屏,之前的历史记录不再显示
|
|
|
|
|
|
if (msg.id > clearId) {
|
|
|
|
|
|
if (typeof window.appendMessage === 'function') {
|
|
|
|
|
|
window.appendMessage(msg);
|
|
|
|
|
|
}
|
2026-02-28 11:17:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@endif
|
2026-04-11 15:58:38 +08:00
|
|
|
|
@if (!empty($initialWelcomeMessage))
|
|
|
|
|
|
<script>
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
if (typeof window.appendMessage === 'function') {
|
|
|
|
|
|
window.appendMessage(@json($initialWelcomeMessage));
|
|
|
|
|
|
}
|
|
|
|
|
|
}, 220);
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@endif
|
2026-04-11 15:44:30 +08:00
|
|
|
|
@if (!empty($newbieEffect) || !empty($weekEffect) || !empty($initialPresenceTheme['presence_effect']))
|
2026-02-27 15:57:12 +08:00
|
|
|
|
<script>
|
2026-02-27 17:21:33 +08:00
|
|
|
|
/**
|
2026-04-11 15:44:30 +08:00
|
|
|
|
* 延迟1秒待页面完成初始化后,自动播放进房附带的特效。
|
|
|
|
|
|
* 优先级:新人礼包特效 -> 会员专属进场特效 -> 周卡特效。
|
2026-02-27 17:21:33 +08:00
|
|
|
|
*/
|
2026-02-27 15:57:12 +08:00
|
|
|
|
setTimeout(() => {
|
2026-04-02 16:21:35 +08:00
|
|
|
|
if (typeof EffectManager !== 'undefined') {
|
2026-02-27 17:21:33 +08:00
|
|
|
|
@if (!empty($newbieEffect))
|
2026-04-02 16:21:35 +08:00
|
|
|
|
EffectManager.play('{{ $newbieEffect }}');
|
2026-04-11 15:44:30 +08:00
|
|
|
|
@elseif (!empty($initialPresenceTheme['presence_effect']))
|
|
|
|
|
|
EffectManager.play('{{ $initialPresenceTheme['presence_effect'] }}');
|
2026-02-27 17:21:33 +08:00
|
|
|
|
@elseif (!empty($weekEffect))
|
2026-04-02 16:21:35 +08:00
|
|
|
|
EffectManager.play('{{ $weekEffect }}');
|
2026-02-27 17:21:33 +08:00
|
|
|
|
@endif
|
2026-02-27 15:57:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@endif
|
2026-04-11 15:44:30 +08:00
|
|
|
|
@if (!empty($initialPresenceTheme))
|
|
|
|
|
|
<script>
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
if (typeof window.showVipPresenceBanner === 'function') {
|
|
|
|
|
|
window.showVipPresenceBanner(@json($initialPresenceTheme));
|
|
|
|
|
|
}
|
|
|
|
|
|
}, 700);
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@endif
|
2026-02-26 22:50:35 +08:00
|
|
|
|
|
2026-03-01 18:08:50 +08:00
|
|
|
|
{{-- 页面初始加载时,若存在挂起的求婚 / 离婚请求,则弹窗 --}}
|
|
|
|
|
|
@if (!empty($pendingProposal) || !empty($pendingDivorce))
|
|
|
|
|
|
<script>
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
// 等待短暂延迟以确保 Alpine 和 window.chatDialog 初始化完成
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
@if (!empty($pendingProposal))
|
|
|
|
|
|
window.dispatchEvent(new CustomEvent('chat:marriage-proposed', {
|
|
|
|
|
|
detail: @json($pendingProposal)
|
|
|
|
|
|
}));
|
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
@if (!empty($pendingDivorce))
|
|
|
|
|
|
window.dispatchEvent(new CustomEvent('chat:divorce-requested', {
|
|
|
|
|
|
detail: @json($pendingDivorce)
|
|
|
|
|
|
}));
|
|
|
|
|
|
@endif
|
|
|
|
|
|
}, 800);
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@endif
|
|
|
|
|
|
|
2026-02-26 13:35:38 +08:00
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
|
|
</html>
|