新增聊天室状态与功能快捷菜单

This commit is contained in:
2026-04-24 21:17:44 +08:00
parent d7ec42a025
commit 0f0bfef2a8
18 changed files with 1361 additions and 124 deletions
@@ -15,6 +15,7 @@
$canSendRedPacket = $roomPermissionMap[\App\Support\PositionPermissionRegistry::ROOM_RED_PACKET] ?? false;
$canManageLossCover = $roomPermissionMap[\App\Support\PositionPermissionRegistry::ROOM_BACCARAT_LOSS_COVER] ?? false;
$canTriggerFullscreenEffect = $roomPermissionMap[\App\Support\PositionPermissionRegistry::ROOM_FULLSCREEN_EFFECT] ?? false;
$currentDailyStatusKey = $activeDailyStatus['key'] ?? '';
@endphp
<div class="input-bar">
@@ -165,6 +166,94 @@ $welcomeMessages = [
</div>
</div>
<div style="position:relative;display:inline-block;" id="feature-btn-wrap">
<button type="button" onclick="toggleFeatureMenu(event)"
style="font-size:11px;padding:1px 6px;background:linear-gradient(135deg,#4f46e5,#6366f1);color:#fff;border:none;border-radius:2px;cursor:pointer;font-weight:bold;">
⚙️ 功能
</button>
<div id="feature-menu"
onclick="event.stopPropagation()"
style="display:none;position:absolute;bottom:calc(100% + 6px);left:0;z-index:10020;min-width:236px;padding:10px;background:#eef2ff;border:1px solid #c7d2fe;border-radius:10px;box-shadow:0 10px 24px rgba(15,23,42,.18);">
<div style="font-size:10px;color:#4338ca;padding:0 2px 8px;">常用操作</div>
<div style="display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;">
<button type="button" onclick="handleFeatureLocalClear()"
style="font-size:11px;padding:6px 8px;background:#fff;color:#475569;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">🧹 清屏</button>
<button type="button" onclick="openDailyStatusEditor()"
style="font-size:11px;padding:6px 8px;background:#fff;color:#4f46e5;border:1px solid #a5b4fc;border-radius:6px;cursor:pointer;">
<span id="daily-status-shortcut-icon">{{ $activeDailyStatus['icon'] ?? '🙂' }}</span>
<span id="daily-status-shortcut-label">{{ $activeDailyStatus['label'] ?? '状态' }}</span>
</button>
</div>
<div style="font-size:10px;color:#4338ca;padding:10px 2px 8px;">快捷入口</div>
<div style="display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;">
<button type="button" onclick="runFeatureShortcut('shop')"
style="font-size:11px;padding:6px 8px;background:#fff;color:#334155;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">🛍 商店</button>
<button type="button" onclick="runFeatureShortcut('vip')"
style="font-size:11px;padding:6px 8px;background:#fff;color:#334155;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">👑 会员</button>
<button type="button" onclick="runFeatureShortcut('game')"
style="font-size:11px;padding:6px 8px;background:#fff;color:#334155;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">🎮 娱乐</button>
<button type="button" onclick="runFeatureShortcut('avatar')"
style="font-size:11px;padding:6px 8px;background:#fff;color:#334155;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">🖼 头像</button>
<button type="button" onclick="runFeatureShortcut('bank')"
style="font-size:11px;padding:6px 8px;background:#fff;color:#334155;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">🏦 银行</button>
<button type="button" onclick="runFeatureShortcut('marriage')"
style="font-size:11px;padding:6px 8px;background:#fff;color:#334155;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">💍 婚姻</button>
<button type="button" onclick="runFeatureShortcut('friend')"
style="font-size:11px;padding:6px 8px;background:#fff;color:#334155;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">👥 好友</button>
<button type="button" onclick="runFeatureShortcut('settings')"
style="font-size:11px;padding:6px 8px;background:#fff;color:#334155;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;">⚙️ 设置</button>
</div>
</div>
</div>
<div id="daily-status-editor-overlay"
onclick="closeDailyStatusEditor()"
style="display:none;position:fixed;inset:0;z-index:10030;background:rgba(15,23,42,.45);backdrop-filter:blur(2px);">
<div id="daily-status-editor"
onclick="event.stopPropagation()"
style="position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(92vw,620px);max-height:min(78vh,680px);overflow-y:auto;padding:14px;background:linear-gradient(180deg,#eef2ff 0%,#f8fafc 100%);border:1px solid #c7d2fe;border-radius:14px;box-shadow:0 18px 40px rgba(15,23,42,.28);">
<div style="display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:4px 4px 12px;">
<div>
<div style="font-size:22px;font-weight:bold;color:#312e81;line-height:1.2;">设个状态</div>
<div style="font-size:12px;color:#6366f1;margin-top:4px;">朋友当天内可见,次日会自动失效</div>
</div>
<button type="button" onclick="closeDailyStatusEditor()"
style="width:28px;height:28px;border:none;border-radius:999px;background:#e0e7ff;color:#4338ca;font-size:18px;cursor:pointer;line-height:1;">×</button>
</div>
<div
style="display:flex;flex-wrap:wrap;gap:8px;padding:0 4px 12px;margin-bottom:12px;border-bottom:1px solid #dbeafe;">
<button type="button" onclick="clearDailyStatus()"
style="font-size:12px;padding:7px 12px;background:#fff7ed;color:#c2410c;border:1px solid #fdba74;border-radius:999px;cursor:pointer;">
♻️ 清除状态
</button>
</div>
@foreach ($dailyStatusCatalog as $group)
<div style="padding:0 4px 14px;">
<div style="font-size:15px;font-weight:bold;color:#475569;margin-bottom:10px;">
{{ $group['group'] }}
</div>
<div style="display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;">
@foreach ($group['items'] as $item)
<button type="button"
class="daily-status-item"
data-status-key="{{ $item['key'] }}"
data-status-label="{{ $item['label'] }}"
data-status-icon="{{ $item['icon'] }}"
data-status-active="{{ $currentDailyStatusKey === $item['key'] ? '1' : '0' }}"
onclick="updateDailyStatus('{{ $item['key'] }}')"
style="display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:82px;padding:10px 6px;background:#ffffffcc;border:1px solid #e5e7eb;border-radius:12px;cursor:pointer;transition:all .15s ease;color:#334155;">
<span style="font-size:24px;line-height:1;">{{ $item['icon'] }}</span>
<span style="font-size:12px;line-height:1.25;text-align:center;">{{ $item['label'] }}</span>
</button>
@endforeach
</div>
</div>
@endforeach
</div>
</div>
@if (! empty($hasRoomManagementPermission))
<div style="position:relative;display:inline-block;" id="admin-btn-wrap">
<button type="button" onclick="toggleAdminMenu(event)"
@@ -235,10 +324,6 @@ $welcomeMessages = [
</div>
</div>
@endif
<button type="button" onclick="localClearScreen()"
style="font-size: 11px; padding: 1px 6px; background: #64748b; color: #fff; border: none; border-radius: 2px; cursor: pointer;">🔄
清屏</button>
</div>
{{-- 第二行:输入框 + 发送 --}}
@@ -24,7 +24,7 @@
<div class="tool-btn" onclick="openMarriageStatusModal()" title="婚姻状态">婚姻</div>
<div class="tool-btn" onclick="openFriendPanel()" title="好友列表">好友</div>
<div class="tool-btn" onclick="openAvatarPicker()" title="修改头像">头像</div>
<div class="tool-btn" onclick="document.getElementById('settings-modal').style.display='flex'" title="个人设置">设置
<div class="tool-btn" onclick="openSettingsModal()" title="个人设置">设置
</div>
<div class="tool-btn" onclick="window.open('{{ route('feedback.index') }}', '_blank')" title="反馈">反馈</div>
<div class="tool-btn" onclick="window.open('{{ route('guestbook.index') }}', '_blank')" title="留言板/私信">留言</div>
@@ -89,9 +89,10 @@
{{-- ═══════════ 个人设置弹窗 ═══════════ --}}
<div id="settings-modal"
onclick="closeSettingsModal()"
style="display:none; position:fixed; top:0; left:0; right:0; bottom:0;
background:rgba(0,0,0,0.5); z-index:10000; justify-content:center; align-items:center;">
<div
<div onclick="event.stopPropagation()"
style="background:#fff; border-radius:8px; width:380px; max-height:90vh;
box-shadow:0 8px 32px rgba(0,0,0,0.3); display:flex; flex-direction:column;">
{{-- --}}
@@ -99,7 +100,7 @@
style="background:linear-gradient(135deg,#336699,#5a8fc0); color:#fff;
padding:12px 16px; border-radius:8px 8px 0 0; display:flex; justify-content:space-between; align-items:center; flex-shrink:0;">
<span style="font-size:14px; font-weight:bold;">⚙️ 个人设置</span>
<span onclick="document.getElementById('settings-modal').style.display='none'"
<span onclick="closeSettingsModal()"
style="cursor:pointer; font-size:18px; opacity:0.8;">&times;</span>
</div>
@@ -261,6 +262,20 @@
document.getElementById('avatar-picker-modal').style.display = 'none';
}
/**
* 打开个人设置弹窗。
*/
function openSettingsModal() {
document.getElementById('settings-modal').style.display = 'flex';
}
/**
* 关闭个人设置弹窗。
*/
function closeSettingsModal() {
document.getElementById('settings-modal').style.display = 'none';
}
/**
* 加载头像列表(懒加载,首次打开时请求)
*/