This commit is contained in:
唐明明
2022-02-07 16:04:35 +08:00
11 changed files with 218 additions and 806 deletions

View File

@@ -55,7 +55,7 @@
import sentVoice from '../components/sentVoice'
import sentPopups from '../components/sentPopups'
const ChatList = uni.requireNativePlugin('dom')
const ChatList = uni.requireNativePlugin('dom')
export default {
data() {
@@ -86,8 +86,8 @@
this.userInfo = this.$store.getters.userInfo(this.targetId)
// 获取消息列表
this.initMessageList()
this.initMessageList()
uni.setNavigationBarTitle({
title: this.userInfo.name
})
@@ -125,11 +125,18 @@
this.chatType = this.chatType === 1 ? 0 : 1
},
// 获取消息列表
getMessageList() {
im.getMessageList(this.conversationType, this.targetId, (messages) => {
this.messages = messages.reverse()
this.scrollBottom()
})
getMessageList() {
im.getMessageList(
this.conversationType,
this.targetId,
new Date().getTime(),
10,
true,
(messages) => {
console.log(messages);
this.messages = messages.reverse()
this.scrollBottom()
})
},
// 展示好友信息, type 1 是自己, 2 是对方
showUser(targetId, type) {