迁移管理菜单和钓鱼按钮事件绑定

This commit is contained in:
2026-04-25 04:03:13 +08:00
parent 54faf8b501
commit 4df557bb9e
6 changed files with 115 additions and 21 deletions
@@ -452,7 +452,6 @@
const btn = document.getElementById('fishing-btn');
btn.textContent = '🎣 钓鱼';
btn.disabled = false;
btn.onclick = startFishing;
fishingTimer = null;
fishingReelTimeout = null;
removeBobber();
@@ -107,7 +107,7 @@ $welcomeMessages = [
</div>
</div>
<button type="button" id="fishing-btn" onclick="startFishing()"
<button type="button" id="fishing-btn" data-chat-fishing-start
style="font-size: 11px; padding: 1px 6px; background: #2563eb; color: #fff; border: none; border-radius: 2px; cursor: pointer;">🎣
钓鱼</button>
@@ -244,16 +244,16 @@ $welcomeMessages = [
@if (! empty($hasRoomManagementPermission))
<div style="position:relative;display:inline-block;" id="admin-btn-wrap">
<button type="button" onclick="toggleAdminMenu(event)"
<button type="button" data-chat-admin-menu-toggle
style="font-size:11px;padding:1px 6px;background:linear-gradient(135deg,#b45309,#d97706);color:#fff;border:none;border-radius:2px;cursor:pointer;font-weight:bold;">
🛠 管理
</button>
<div id="admin-menu"
<div id="admin-menu" data-chat-admin-menu
style="display:none;position:absolute;bottom:calc(100% + 6px);left:0;z-index:10020;min-width:244px;max-width:min(80vw,288px);max-height:min(62vh,460px);overflow-y:auto;padding:10px;background:#fffaf0;border:1px solid #fdba74;border-radius:10px;box-shadow:0 10px 24px rgba(15,23,42,.18);">
@if ($canSetAnnouncement)
<div style="font-size:10px;color:#9a3412;padding:0 2px 6px;">房间管理</div>
<div style="display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;">
<button type="button" onclick="runAdminAction('announcement')"
<button type="button" data-chat-admin-action="announcement"
style="font-size:11px;padding:6px 8px;background:#fff;color:#047857;border:1px solid #86efac;border-radius:6px;cursor:pointer;">🪧 设公告</button>
</div>
@endif
@@ -262,23 +262,23 @@ $welcomeMessages = [
<div style="font-size:10px;color:#9a3412;padding:10px 2px 6px;">聊天室管理</div>
<div style="display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;">
@if ($canPublicBroadcast)
<button type="button" onclick="runAdminAction('announce-message')"
<button type="button" data-chat-admin-action="announce-message"
style="font-size:11px;padding:6px 8px;background:#fff;color:#7c3aed;border:1px solid #c4b5fd;border-radius:6px;cursor:pointer;">📢 公屏</button>
@endif
@if ($canClearScreen)
<button type="button" onclick="runAdminAction('admin-clear')"
<button type="button" data-chat-admin-action="admin-clear"
style="font-size:11px;padding:6px 8px;background:#fff;color:#dc2626;border:1px solid #fca5a5;border-radius:6px;cursor:pointer;">🧹 清屏</button>
@endif
@if ($canSendRedPacket)
<button type="button" onclick="runAdminAction('red-packet')"
<button type="button" data-chat-admin-action="red-packet"
style="font-size:11px;padding:6px 8px;background:#fff;color:#b91c1c;border:1px solid #fdba74;border-radius:6px;cursor:pointer;">🧧 礼包</button>
@endif
@if ($canManageLossCover)
<button type="button" onclick="runAdminAction('loss-cover')"
<button type="button" data-chat-admin-action="loss-cover"
style="font-size:11px;padding:6px 8px;background:#fff;color:#15803d;border:1px solid #86efac;border-radius:6px;cursor:pointer;">🎁 买单活动</button>
@endif
@if (Auth::id() === 1)
<button type="button" onclick="runAdminAction('refresh-all')"
<button type="button" data-chat-admin-action="refresh-all"
style="font-size:11px;padding:6px 8px;background:#fff;color:#0f766e;border:1px solid #99f6e4;border-radius:6px;cursor:pointer;">♻️ 刷新全员</button>
@endif
</div>
@@ -287,25 +287,25 @@ $welcomeMessages = [
@if ($canTriggerFullscreenEffect)
<div style="font-size:10px;color:#9a3412;padding:10px 2px 6px;">全屏特效</div>
<div style="display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;">
<button type="button" onclick="selectEffect('fireworks')"
<button type="button" data-chat-admin-effect="fireworks"
style="font-size:11px;padding:6px 8px;background:#fff;color:#ea580c;border:1px solid #fdba74;border-radius:6px;cursor:pointer;">🎆 烟花</button>
<button type="button" onclick="selectEffect('rain')"
<button type="button" data-chat-admin-effect="rain"
style="font-size:11px;padding:6px 8px;background:#fff;color:#2563eb;border:1px solid #93c5fd;border-radius:6px;cursor:pointer;">🌧️ 下雨</button>
<button type="button" onclick="selectEffect('lightning')"
<button type="button" data-chat-admin-effect="lightning"
style="font-size:11px;padding:6px 8px;background:#fff;color:#7c3aed;border:1px solid #c4b5fd;border-radius:6px;cursor:pointer;"> 雷电</button>
<button type="button" onclick="selectEffect('snow')"
<button type="button" data-chat-admin-effect="snow"
style="font-size:11px;padding:6px 8px;background:#fff;color:#0891b2;border:1px solid #bae6fd;border-radius:6px;cursor:pointer;">❄️ 下雪</button>
<button type="button" onclick="selectEffect('sakura')"
<button type="button" data-chat-admin-effect="sakura"
style="font-size:11px;padding:6px 8px;background:#fff;color:#db2777;border:1px solid #f9a8d4;border-radius:6px;cursor:pointer;">🌸 樱花飘落</button>
<button type="button" onclick="selectEffect('meteors')"
<button type="button" data-chat-admin-effect="meteors"
style="font-size:11px;padding:6px 8px;background:#fff;color:#2563eb;border:1px solid #bfdbfe;border-radius:6px;cursor:pointer;">🌠 流星</button>
<button type="button" onclick="selectEffect('gold-rain')"
<button type="button" data-chat-admin-effect="gold-rain"
style="font-size:11px;padding:6px 8px;background:#fff;color:#ca8a04;border:1px solid #fde68a;border-radius:6px;cursor:pointer;">🪙 金币雨</button>
<button type="button" onclick="selectEffect('hearts')"
<button type="button" data-chat-admin-effect="hearts"
style="font-size:11px;padding:6px 8px;background:#fff;color:#e11d48;border:1px solid #fda4af;border-radius:6px;cursor:pointer;">💖 爱心飘落</button>
<button type="button" onclick="selectEffect('confetti')"
<button type="button" data-chat-admin-effect="confetti"
style="font-size:11px;padding:6px 8px;background:#fff;color:#7c3aed;border:1px solid #ddd6fe;border-radius:6px;cursor:pointer;">🎊 彩带庆典</button>
<button type="button" onclick="selectEffect('fireflies')"
<button type="button" data-chat-admin-effect="fireflies"
style="font-size:11px;padding:6px 8px;background:#fff;color:#15803d;border:1px solid #bbf7d0;border-radius:6px;cursor:pointer;"> 萤火虫</button>
</div>
@endif