From 46fde766e5f42b9a9c2c69b54ce36b674b8c00f6 Mon Sep 17 00:00:00 2001 From: lkddi Date: Tue, 17 Mar 2026 21:12:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=AC=A2=E8=BF=8E=E8=AF=AD?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E6=8C=89=E9=92=AE=EF=BC=9A=E8=81=8C=E5=8A=A1?= =?UTF-8?q?=E4=BA=BA=E5=91=98/id=3D1=E5=8F=AF=E8=A7=81=EF=BC=8C10=E6=9D=A1?= =?UTF-8?q?=E9=A2=84=E8=AE=BE=E8=AF=AD=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=A1=AB?= =?UTF-8?q?=E5=85=A5=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/chat.css | 37 ++++++++++++++++++ .../partials/games/baccarat-panel.blade.php | 5 ++- .../chat/partials/layout/input-bar.blade.php | 29 ++++++++++++++ .../views/chat/partials/scripts.blade.php | 38 +++++++++++++++++++ 4 files changed, 108 insertions(+), 1 deletion(-) diff --git a/public/css/chat.css b/public/css/chat.css index 770c068..2f20f97 100644 --- a/public/css/chat.css +++ b/public/css/chat.css @@ -261,6 +261,43 @@ a:hover { gap: 3px; } +/* 欢迎语下拉浮层 */ +.welcome-menu { + position: absolute; + bottom: calc(100% + 4px); + left: 0; + z-index: 9000; + background: #fff; + border: 1px solid #b0c8e0; + border-radius: 6px; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); + min-width: 280px; + max-width: 360px; + padding: 4px 0; +} + +.welcome-menu-item { + padding: 6px 12px; + font-size: 12px; + color: #224466; + cursor: pointer; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + border-bottom: 1px solid #eef4fb; + transition: background 0.1s; +} + +.welcome-menu-item:last-child { + border-bottom: none; +} + +.welcome-menu-item:hover { + background: #ddeeff; + color: #003366; +} + + .input-bar select, .input-bar input[type="text"], .input-bar input[type="checkbox"] { diff --git a/resources/views/chat/partials/games/baccarat-panel.blade.php b/resources/views/chat/partials/games/baccarat-panel.blade.php index f710992..f5eb862 100644 --- a/resources/views/chat/partials/games/baccarat-panel.blade.php +++ b/resources/views/chat/partials/games/baccarat-panel.blade.php @@ -537,7 +537,10 @@ this.settledResult = data.result; this.resultLabel = data.result_label; this.phase = 'settled'; - this.show = true; + // 只有本局有押注的用户才弹出结算面板 + if (this.myBet) { + this.show = true; + } // 判断本人是否中奖(从后端拿到的 result 与我的下注 type 比较) if (this.myBet && this.myBetType === data.result && data.result !== 'kill') { diff --git a/resources/views/chat/partials/layout/input-bar.blade.php b/resources/views/chat/partials/layout/input-bar.blade.php index ab61439..0358529 100644 --- a/resources/views/chat/partials/layout/input-bar.blade.php +++ b/resources/views/chat/partials/layout/input-bar.blade.php @@ -71,6 +71,35 @@ + @if ($user->id === 1 || $user->activePosition()->exists()) + {{-- 欢迎语快捷按钮 + 下拉浮层 --}} +
+ + +
+ @endif + @if ( $user->user_level >= (int) \App\Models\Sysparam::getValue('level_announcement', '10') || $room->master == $user->username) diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index e20cb66..7063228 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -117,6 +117,44 @@ + + // ── 欢迎语快捷菜单 ────────────────────────────────────── + /** + * 切换欢迎语下拉浮层的显示/隐藏 + */ + function toggleWelcomeMenu(event) { + event.stopPropagation(); + const menu = document.getElementById('welcome-menu'); + if (!menu) { return; } + menu.style.display = menu.style.display === 'none' ? 'block' : 'none'; + } + + /** + * 将选中的欢迎语模板填入输入框,{name} 替换为当前选中的聊天对象 + * + * @param {string} tpl 欢迎语模板,含 {name} 占位符 + */ + function sendWelcomeTpl(tpl) { + const toUser = document.getElementById('to_user')?.value || '大家'; + const name = toUser === '大家' ? '大家' : toUser; + const msg = tpl.replace(/\{name\}/g, name); + + const input = document.getElementById('content'); + if (input) { + input.value = msg; + input.focus(); + } + + const menu = document.getElementById('welcome-menu'); + if (menu) { menu.style.display = 'none'; } + } + + // 点击页面任意位置,关闭欢迎语浮层 + document.addEventListener('click', function () { + const menu = document.getElementById('welcome-menu'); + if (menu) { menu.style.display = 'none'; } + }); + // ── 动作选择 ────────────────────────────────────── /** * 设置发言动作并聚焦输入框