Files
chatroom/resources/views/chat/partials/layout/right-panel.blade.php
T
lkddi bfb1a3bca4 重构(chat): 聊天室 Partials 第二阶段分类拆分及修复红包弹窗隐藏 Bug
- 完成对 scripts.blade.php 中非核心业务逻辑(钓鱼游戏、AI机器人、系统全局公告)的深度抽象隔离
- 修复抢红包逻辑中 setInterval 缺失时间参数(1000)引发浏览器前端主线程挂起的重度阻塞问题
- 修复 lottery-panel 组件结尾漏写 </div> 导致的连锁级渲染树崩溃(该崩溃导致红包节点被意外当作隐藏后代节点渲染,造成彻底不可见)
- 对相关模板规范代码结构,执行 Laravel Pint 格式化并提交
2026-03-09 11:30:11 +08:00

98 lines
5.1 KiB
PHP

{{--
文件功能:右侧用户面板(复刻原版)
包含:名单/房间/贴图/酷库 四个 Tab 面板
独立文件方便维护
依赖变量:$room(当前房间模型)
--}}
<div class="chat-right">
{{-- Tab 标题栏 --}}
<div class="right-tabs">
<button class="tab-btn active" id="tab-users" onclick="switchTab('users')">名单</button>
<button class="tab-btn" id="tab-rooms" onclick="switchTab('rooms')">房间</button>
<button class="tab-btn" id="tab-action" onclick="switchTab('action')">酷库</button>
</div>
{{-- 用户列表面板 --}}
<div class="user-list-content" id="panel-users">
{{-- 房间信息头部(原版风格:房间名 + 人气 + 在线人数) --}}
<div style="text-align:center; padding:4px 6px; border-bottom:1px solid #cde; background:#f0f6ff;">
<div style="color:#336699; font-weight:bold; font-size:12px;">{{ $room->name }}</div>
<div style="color:#cc6600; font-size:11px;">人气:{{ $room->visit_num ?? 0 }}</div>
<div style="font-size:11px; color:#999; margin-top:2px;">
<span id="online-count-bottom">0</span>
<a href="#" onclick="renderUserList(); return false;"
style="color:#c00; font-size:10px; margin-left:4px;">刷新</a>
</div>
</div>
{{-- 排序 + 搜索(原版风格) --}}
<div style="padding:3px 4px; border-bottom:1px solid #cde; background:#f8fbff; font-size:11px;">
<div style="display:flex; align-items:center; gap:4px; margin-bottom:3px;">
<span style="color:#666; flex-shrink:0;">排序:</span>
<select id="user-sort-select" onchange="renderUserList()"
style="flex:1; font-size:11px; padding:1px; border:1px solid #aac; border-radius:2px;">
<option value="default">默认</option>
<option value="name">按名称</option>
<option value="level">按等级</option>
</select>
</div>
<div style="display:flex; align-items:center; gap:2px;">
<input type="text" id="user-search-input" placeholder="搜索用户" onkeyup="filterUserList()"
style="width:100%; font-size:11px; padding:2px 4px; border:1px solid #aac; border-radius:2px; box-sizing:border-box;">
</div>
</div>
{{-- 用户列表 --}}
<div id="online-users-list" style="padding:2px;">
<div style="text-align:center; color:#999; padding:20px 0; font-size:11px;">加载中...</div>
</div>
{{-- 管理员名单链接 --}}
<div style="text-align:center; padding:4px; border-top:1px solid #cde; font-size:11px;">
<a href="#" style="color:#336699; font-weight:bold;">管理员名单</a>
</div>
</div>
{{-- 房间列表面板 --}}
<div class="user-list-content" id="panel-rooms" style="display: none;">
{{-- 顶部标题栏 --}}
<div style="text-align:center; padding:4px 6px; border-bottom:1px solid #cde; background:#f0f6ff;">
<div style="color:#336699; font-weight:bold; font-size:12px;">所有聊天室</div>
<div style="font-size:10px; color:#999; margin-top:1px;">点击可切换房间</div>
</div>
{{-- 房间列表容器 --}}
<div id="rooms-online-list" style="padding:4px 2px;">
<div style="text-align:center; color:#bbb; padding:16px 0; font-size:11px;">加载中...</div>
</div>
</div>
{{-- 贴图面板(懒加载:切换到该 Tab 时才加载图片) --}}
<div class="user-list-content" id="panel-emoji" style="display: none; padding: 6px;">
<div style="display: flex; flex-wrap: wrap; gap: 2px; justify-content: center;">
@for ($i = 1; $i <= 50; $i++)
<img data-src="/images/emoji/{{ $i }}.gif" width="24" height="24"
style="cursor: pointer; border: 1px solid transparent; border-radius: 2px;"
onmouseover="this.style.borderColor='#336699'" onmouseout="this.style.borderColor='transparent'"
onclick="insertEmoji('[IMG]{{ $i }}[/IMG]')" title="表情{{ $i }}"
onerror="this.style.display='none'">
@endfor
</div>
</div>
{{-- 酷库面板 --}}
<div class="user-list-content" id="panel-action" style="display: none; padding: 6px;">
<div style="font-size: 11px; color: #666; line-height: 2;">
@foreach (['微笑', '大笑', '愤怒', '哭泣', '害羞', '鄙视', '得意', '疑惑', '同情', '无奈', '拳打', '飞吻', '偷看', '战战兢兢'] as $act)
<a href="#" onclick="setAction('{{ $act }}'); return false;"
style="display: inline-block; padding: 2px 6px; background: #f0f6ff; border: 1px solid #dde8ff; border-radius: 3px; margin: 1px; color: #336699; font-size: 11px;">{{ $act }}</a>
@endforeach
</div>
</div>
{{-- 底部在线统计 --}}
<div class="online-stats">
在线: <strong id="online-count-footer">0</strong>
</div>
</div>