From 9ccc0b379da7402f0af6429a475f049139e25ebd Mon Sep 17 00:00:00 2001 From: lkddi Date: Sun, 1 Mar 2026 17:19:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E6=B1=82=E5=A9=9A?= =?UTF-8?q?=E5=89=8D=E6=8F=90=E7=A4=BA=E6=9C=80=E4=BD=8E=E5=A9=9A=E7=A4=BC?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E5=B9=B6=E6=A3=80=E6=9F=A5=E9=87=91=E5=B8=81?= =?UTF-8?q?=E4=BD=99=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 点击「送出求婚」前弹出确认弹窗: 💍 确认向【XXX】发出求婚吗? 📋 婚礼费用说明: • 婚礼最低费用:🪙 5,888 金币 • 您当前金币:🪙 XXX 金币 ⚠️ 戒指一旦送出即消耗,对方拒绝则戒指遗失。 金币不足时:直接拦截并弹 alert 说明,不发出请求 金币充足时:需确认后才发出求婚请求 同时在 chatContext 注入 userJjb 和 minWeddingCost --- resources/views/chat/frame.blade.php | 2 ++ .../chat/partials/marriage-modals.blade.php | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/resources/views/chat/frame.blade.php b/resources/views/chat/frame.blade.php index 9c718a7..3ced5f4 100644 --- a/resources/views/chat/frame.blade.php +++ b/resources/views/chat/frame.blade.php @@ -62,7 +62,9 @@ revokeUrl: "{{ route('chat.appoint.revoke') }}", rewardUrl: "{{ route('command.reward') }}", rewardQuotaUrl: "{{ route('command.reward_quota') }}", + userJjb: {{ (int) $user->jjb }}, // 当前用户金币(求婚前金额预检查用) // ─── 婚姻系统 ────────────────────────────── + minWeddingCost: {{ (int) \App\Models\WeddingTier::where('is_active', true)->orderBy('amount')->value('amount') ?? 0 }}, marriage: { proposeUrl: "{{ route('marriage.propose') }}", statusUrl: "{{ route('marriage.status') }}", diff --git a/resources/views/chat/partials/marriage-modals.blade.php b/resources/views/chat/partials/marriage-modals.blade.php index 6055997..c300411 100644 --- a/resources/views/chat/partials/marriage-modals.blade.php +++ b/resources/views/chat/partials/marriage-modals.blade.php @@ -423,6 +423,38 @@ async doPropose() { if (this.sending || !this.selectedRing) return; + + // ── 发送前:显示婚礼费用提示 + 金币检查 ────────────────── + const minCost = window.chatContext?.minWeddingCost ?? 0; + const userJjb = window.chatContext?.userJjb ?? 0; + const costStr = Number(minCost).toLocaleString(); + const jjbStr = Number(userJjb).toLocaleString(); + + if (minCost > 0 && userJjb < minCost) { + // 金币不足:直接拦截,引导赚金币 + await window.chatDialog?.alert( + `💰 您的金币不足以举办婚礼!\n\n婚礼最低费用:🪙 ${costStr} 金币\n您当前余额:🪙 ${jjbStr} 金币\n\n请先通过钓鱼、聊天、签到等方式积累金币后再求婚哦~`, + '金币不足', + '#dc2626' + ); + return; + } + + // 金币充足:弹出费用说明 + 确认 + const noticeLines = [ + `💍 确认向【${this.targetUsername}】发出求婚吗?`, + '', + `📋 婚礼费用说明:`, + ` • 婚礼最低费用:🪙 ${costStr} 金币`, + ` • 您当前金币:🪙 ${jjbStr} 金币`, + '', + `⚠️ 戒指一旦送出即消耗,对方拒绝则戒指遗失。`, + ].join('\n'); + + const confirmed = await window.chatDialog?.confirm(noticeLines, '确认求婚'); + if (!confirmed) return; + // ───────────────────────────────────────────────────────── + this.sending = true; this.error = ''; try {