From e9a41995be05080de9d78b35024f83b20640cbd2 Mon Sep 17 00:00:00 2001 From: lkddi Date: Sun, 1 Mar 2026 19:08:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A9=9A=E7=A4=BC=E7=BA=A2?= =?UTF-8?q?=E5=8C=85=E5=BC=B9=E7=AA=97=EF=BC=9A=E2=91=A0=E5=90=8D=E5=AD=97?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=85=BC=E5=AE=B9=20user.username/groom=5Fna?= =?UTF-8?q?me=20=E5=8F=8C=E6=A0=BC=E5=BC=8F=20=E2=91=A1=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=BF=AE=E6=AD=A3=E4=B8=BA=20/wedding/ceremo?= =?UTF-8?q?ny/{id}/claim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/chat/partials/marriage-modals.blade.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/views/chat/partials/marriage-modals.blade.php b/resources/views/chat/partials/marriage-modals.blade.php index 0361119..b940b59 100644 --- a/resources/views/chat/partials/marriage-modals.blade.php +++ b/resources/views/chat/partials/marriage-modals.blade.php @@ -1238,7 +1238,10 @@ open(detail) { this.marriageId = detail.marriage_id; this.ceremonyId = detail.ceremony_id; - this.title = `${detail.groom_name} × ${detail.bride_name} 婚礼红包`; + // 兼容两种字段命名:groom_name/bride_name 或 user.username/partner.username + const groomName = detail.groom_name ?? detail.user?.username ?? '??'; + const brideName = detail.bride_name ?? detail.partner?.username ?? '??'; + this.title = `${groomName} × ${brideName} 婚礼红包`; this.subTitle = detail.tier_name ? `【${detail.tier_name}】普天同庆` : '婚礼庆典红包'; this.claimed = false; this.claimedAmount = 0; @@ -1253,7 +1256,8 @@ if (this.claiming || this.claimed) return; this.claiming = true; try { - const res = await fetch(`/wedding/${this.marriageId}/claim`, { + // 正确路由:/wedding/ceremony/{ceremonyId}/claim + const res = await fetch(`/wedding/ceremony/${this.ceremonyId}/claim`, { method: 'POST', headers: { 'Content-Type': 'application/json',