聊天显示bug

This commit is contained in:
yj 2025-02-24 10:08:36 +08:00
parent 61c37c4b59
commit a95e977ca1
1 changed files with 2 additions and 1 deletions

View File

@ -1145,9 +1145,10 @@ Page({
roomNum: this.data.channelId, roomNum: this.data.channelId,
msg: e.target.dataset.item || this.data.messageStr msg: e.target.dataset.item || this.data.messageStr
}) })
const item = this.data.roomUserList.find(row => row.uid === this.data.user.uid)
this.setData({ this.setData({
chatList: [...this.data.chatList, { chatList: [...this.data.chatList, {
userName: this.data.user.userName, userName: item.userName,
message: e.target.dataset.item || this.data.messageStr, message: e.target.dataset.item || this.data.messageStr,
timestamp: dayjs(+new Date()).format('HH:mm:ss'), timestamp: dayjs(+new Date()).format('HH:mm:ss'),
me: true me: true