fix(data): 切换成员时补充 id 字段并修复 userId 类型问题

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-05-27 10:40:37 +08:00
co-authored by Claude Sonnet 4.6
parent 32dd83a738
commit d373da11c7
2 changed files with 5 additions and 4 deletions
+3 -3
View File
@@ -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()