群邀请的数据列表

This commit is contained in:
2022-02-18 14:11:38 +08:00
parent 9357a686a0
commit 1f6e3078d3
5 changed files with 37 additions and 20 deletions

View File

@@ -373,9 +373,7 @@
{
"path": "pages/im/private/chat",
"style": {
"disableScroll": true,
"navigationBarTitleText": "聊天",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F3F6FB"
}
},

View File

@@ -5,7 +5,8 @@
<view class="cell" v-for="(item, index) in messages" :key="index">
<view class="time">{{ item.sentTime|timeCustomCN }}</view>
<view :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
<u-avatar class="avatar" size="40" shape="square" @click="showUser(item.senderUserId, item.messageDirection)"
<u-avatar class="avatar" size="40" shape="square"
@click="showUser(item.senderUserId, item.messageDirection)"
:src="contact(item.senderUserId).portraitUrl" />
<view class="msg">
<show-voice v-if="item.objectName === 'RC:HQVCMsg'" :guest="item.messageDirection == 1"
@@ -158,14 +159,14 @@
<style scoped lang="scss">
/* 窗口 */
.chat {
background: $window-color;
height: 100vh;
display: flex;
flex-direction: column;
overflow: scroll;
.body {
flex: 1;
overflow-y: scroll;
background: blue;
height: 90vh;
display: flex;
flex-direction: column-reverse;
justify-content: flex-end;

View File

@@ -70,6 +70,7 @@ const imLibListeners = () => {
// 调用完更新之后,删除这条消息
IMLib.deleteMessagesByIds([message.messageId])
} else if (message.objectName === IMLib.ObjectName.ContactNotification) {
console.error('触发一个新好友的通知事件', message);
// 触发一个新好友的通知事件
uni.$emit('onContactNotification', message)
} else if (message.objectName === IMLib.ObjectName.GroupNotification) {

View File

@@ -57,6 +57,22 @@ const getPendingList = (callback, total) => {
})
}
// 群组申请列表,邀请列表
const getGroupPendinglist = (targetId, callback) => {
total = total || 100
RongIMLib.getConversationList([RongIMLib.ConversationType.SYSTEM], total, 0, (res) => {
if (res.code === 0) {
const pendings = res.conversations.filter((item) => {
return item.targetId == targetId &&
item.objectName == RongIMLib.ObjectName.ContactNotification &&
item.latestMessage.operation === 'GroupPending'
})
callback(pendings)
}
})
}
/**
* 发送文本消息
* @param {number} conversationType 消息类型
@@ -209,6 +225,7 @@ const sendFile = (conversationType, targetId, fileUrl, time, user, callback) =>
export default {
getMessageList,
getPendingList,
getGroupPendinglist,
sentText,
sentVoice,
sentImage,