好友申请流程优化,群创建简化
This commit is contained in:
@@ -41,6 +41,21 @@ const getMessageList = (conversationType, targetId, timeStamp, count, isForward,
|
||||
)
|
||||
}
|
||||
|
||||
// 获取好友申请列表
|
||||
const getPendingList = (callback, total) => {
|
||||
total = total || 100
|
||||
RongIMLib.getConversationList([RongIMLib.ConversationType.SYSTEM], total, 0, (res) => {
|
||||
if (res.code === 0) {
|
||||
const pendings = res.conversations.filter((item) => {
|
||||
return item.objectName == RongIMLib.ObjectName.ContactNotification &&
|
||||
item.latestMessage.operation === 'Request'
|
||||
})
|
||||
|
||||
callback(pendings)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送文本消息
|
||||
* @param {number} conversationType 消息类型
|
||||
@@ -57,16 +72,16 @@ const sentText = (conversationType, targetId, content, user, callback) => {
|
||||
content: content,
|
||||
userInfo: user
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RongIMLib.sendMessage(msg, ({
|
||||
code,
|
||||
messageId
|
||||
}) => {
|
||||
if (code === 0) {
|
||||
callback(messageId)
|
||||
} else {
|
||||
console.log('发送失败', msg);
|
||||
} else {
|
||||
console.log('发送失败', msg);
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '发送失败' + code
|
||||
@@ -189,7 +204,8 @@ const sendFile = (conversationType, targetId, fileUrl, time, callback) => {
|
||||
}
|
||||
|
||||
export default {
|
||||
getMessageList,
|
||||
getMessageList,
|
||||
getPendingList,
|
||||
sentText,
|
||||
sentVoice,
|
||||
sentImage,
|
||||
|
||||
Reference in New Issue
Block a user