fix(data): 切换成员时补充 id 字段并修复 userId 类型问题
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
32dd83a738
commit
d373da11c7
@@ -232,10 +232,10 @@ Page({
|
||||
relationType?: number | string | null
|
||||
avatar?: string
|
||||
}
|
||||
const selectedUserId = m.userId ?? m.id
|
||||
const storedUserId = (wx.getStorageSync('userInfo') as StorageUserInfo | null)?.userId ?? ''
|
||||
const userInfo: PageUserInfo = {
|
||||
userId: selectedUserId,
|
||||
id: m.id,
|
||||
userId: m.userId ?? '',
|
||||
realname: m.name,
|
||||
sex: m.sex ?? (m.gender === '男' ? 1 : 2),
|
||||
height: m.height,
|
||||
@@ -244,7 +244,7 @@ Page({
|
||||
relationType: m.relationType ?? null,
|
||||
sex_dictText: m.gender,
|
||||
age: m.age,
|
||||
isSelf: selectedUserId === storedUserId,
|
||||
isSelf: m.userId === storedUserId,
|
||||
}
|
||||
this.setData({ showSelectDrawer: false, userInfo })
|
||||
this.loadData()
|
||||
|
||||
Reference in New Issue
Block a user