fix: 修复右侧列表切换Tab时由于表情包被移除导致的JS报错

This commit is contained in:
2026-03-12 13:23:36 +08:00
parent 16498a4657
commit d36da26c44
2 changed files with 2 additions and 20 deletions

View File

@@ -68,17 +68,6 @@
</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>

View File

@@ -43,18 +43,11 @@
// ── Tab 切换 ──────────────────────────────────────
function switchTab(tab) {
// 切换名单/房间/贴图/酷库 面板
['users', 'rooms', 'emoji', 'action'].forEach(t => {
// 切换名单/房间/酷库 面板
['users', 'rooms', 'action'].forEach(t => {
document.getElementById('panel-' + t).style.display = t === tab ? 'block' : 'none';
document.getElementById('tab-' + t)?.classList.toggle('active', t === tab);
});
// 贴图 Tab 懒加载
if (tab === 'emoji') {
document.querySelectorAll('#panel-emoji img[data-src]').forEach(img => {
img.src = img.dataset.src;
img.removeAttribute('data-src');
});
}
// 房间 Tab拉取在线人数列表
if (tab === 'rooms') {
loadRoomsOnlineStatus();