用户昵称,头像,本地缓存与更新规则
This commit is contained in:
@@ -108,8 +108,8 @@
|
||||
onLoad(e) {
|
||||
this.targetId = e.targetId
|
||||
getFriendInfo(e.targetId).then(res => {
|
||||
this.userInfo = res
|
||||
// 获取到用户信息之后,去检查一下要不要更新
|
||||
this.userInfo = res
|
||||
// 获取到用户信息之后,去检查一下要不要更新
|
||||
this.$store.dispatch('updateFriend', res)
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.name
|
||||
@@ -143,7 +143,7 @@
|
||||
},
|
||||
toPrivate() {
|
||||
uni.redirectTo({
|
||||
url: '/pages/im/private/chat?conversationType=1&targetId=' + this.targetId
|
||||
url: '/pages/im/private/chat?targetId=' + this.targetId
|
||||
});
|
||||
},
|
||||
setRemark() {
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</view>
|
||||
<view class="content u-border-bottom">
|
||||
<view class="header">
|
||||
<view class="name">{{ friend(item.targetId).name || '未知用户' }}</view>
|
||||
<view class="name">{{ friend(item.targetId).name }}</view>
|
||||
<view class="time">{{ item.sentTime|timeCustomCN }}</view>
|
||||
</view>
|
||||
<message-preview class="preview" :msg="item.latestMessage" />
|
||||
@@ -218,8 +218,7 @@
|
||||
toDetail(item) {
|
||||
this.hidePop()
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/private/chat?targetId=' + item.targetId + '&conversationType=' + item
|
||||
.conversationType
|
||||
url: '/pages/im/private/chat?targetId=' + item.targetId
|
||||
})
|
||||
},
|
||||
toFriend(targetId) {
|
||||
|
||||
@@ -87,16 +87,12 @@
|
||||
},
|
||||
onLoad(e) {
|
||||
this.targetId = e.targetId
|
||||
this.conversationType = e.conversationType // 会话类型
|
||||
this.userInfo = this.$store.getters.userInfo(this.targetId)
|
||||
|
||||
console.log(this.userInfo);
|
||||
// 获取消息列表
|
||||
this.initMessageList()
|
||||
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.userInfo.name
|
||||
})
|
||||
// 获取消息列表
|
||||
this.initMessageList()
|
||||
// 监听消息已读状态
|
||||
uni.$on('onReadReceiptReceived', (data) => {
|
||||
if (data.targetId == this.targetId) {
|
||||
|
||||
Reference in New Issue
Block a user