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',