修复:求婚按钮异性判断,mySex 存入 Alpine data 避免 x-show 内 window 访问失效
This commit is contained in:
@@ -116,6 +116,7 @@
|
||||
// 婚姻状态
|
||||
targetMarriage: null, // 对方婚姻状态 { status, partner_name, marriage_id }
|
||||
marriageLoading: false,
|
||||
mySex: window.chatContext?.userSex ?? '', // 当前用户性别(用于求婚异性判断)
|
||||
|
||||
// 自定义弹窗:直接代理到全局 window.chatDialog
|
||||
$alert: (...args) => window.chatDialog.alert(...args),
|
||||
@@ -714,8 +715,8 @@
|
||||
x-show="!marriageLoading
|
||||
&& (!targetMarriage || targetMarriage.status === 'none')
|
||||
&& userInfo.sex
|
||||
&& window.chatContext.userSex
|
||||
&& userInfo.sex !== window.chatContext.userSex"
|
||||
&& mySex
|
||||
&& userInfo.sex !== mySex"
|
||||
style="flex:1; padding: 7px 10px; border-radius: 5px; font-size: 12px; font-weight: bold; cursor: pointer;
|
||||
background: linear-gradient(135deg,#f43f5e,#ec4899); color:#fff; border:none;"
|
||||
x-on:click="showUserModal = false; openProposeModal(userInfo.username)">
|
||||
|
||||
Reference in New Issue
Block a user