This commit is contained in:
唐明明
2022-02-22 16:38:54 +08:00
9 changed files with 157 additions and 126 deletions

View File

@@ -77,7 +77,6 @@
this.targetId = e.targetId
// 获取群成员数量
getGroupBase(this.targetId).then(res => {
console.log(res);
uni.setNavigationBarTitle({
title: res.name + `(${res.members})`
})
@@ -90,9 +89,25 @@
this.getNewMessage()
}
})
uni.$on('onReceiptRequest', (msg) => {
if (msg.targetId == this.targetId) {
RongIMLib.getMessageByUId(msg.messageUId, (result) => {
RongIMLib.sendReadReceiptResponse(3, this.targetId, [result.message], (res) => {
console.error('发送群聊已读回执成功', res);
})
})
}
})
uni.$on('onReceiptResponse', (msg) => {
console.log('远端消息已读,本地获取有几个人读了', msg);
})
// 清理聊天记录
uni.$once('cleanGroupMessage', this.getMessageList)
},
onUnload() {
uni.$off('onReceiptRequest')
uni.$off('onReceiptResponse')
},
onNavigationBarButtonTap() {
uni.navigateTo({
url: '/pages/im/group/info?targetId=' + this.targetId
@@ -134,6 +149,9 @@
20,
true,
(messages) => {
RongIMLib.sendReadReceiptResponse(3, this.targetId, messages, (res) => {
console.error('发送群聊已读回执成功', res);
})
this.messages = messages
this.scrollBottom()
})
@@ -144,8 +162,6 @@
// 清理当前会话,未读消息数量
RongIMLib.clearMessagesUnreadStatus(this.conversationType, this.targetId, this.latestMessage
.sentTime)
// // 发送消息已读状态给对方
// RongIMLib.sendReadReceiptMessage(this.conversationType, this.targetId, this.latestMessage.sentTime)
// 更新badge提醒数量
im.setNotifyBadge()
}
@@ -179,7 +195,7 @@
justify-content: flex-end;
.cell {
padding: 10rpx 30rpx;
padding: 10rpx 20rpx;
.time {
text-align: center;
@@ -187,9 +203,9 @@
color: #666;
}
.cell-item {
.cell-item {
display: flex;
width: 690rpx;
width: 710rpx;
justify-content: flex-start;
&.left {
@@ -207,20 +223,6 @@
.msg {
margin: 0 20rpx;
.state {
padding-top: 10rpx;
.state-text {
font-size: $title-size-m - 2;
color: rgba($color: $main-color, $alpha: 0.3)
}
.state-text-active {
font-size: $title-size-m - 2;
color: #cecece;
}
}
}
}