群聊的基础页面
This commit is contained in:
@@ -51,7 +51,7 @@ const setNotifyBadge = () => {
|
||||
*/
|
||||
const connect = (token, userInfo, callback) => {
|
||||
RongIMLib.connect(token, res => {
|
||||
callback(res)
|
||||
callback(res)
|
||||
// 更新个人信息
|
||||
store.dispatch('setSenderInfo', userInfo)
|
||||
// 设置未读消息数量
|
||||
@@ -61,7 +61,7 @@ const connect = (token, userInfo, callback) => {
|
||||
|
||||
uni.getStorage({
|
||||
key: FK,
|
||||
success: () => {
|
||||
success: () => {
|
||||
const model = uni.model.friendModel
|
||||
model.find((err, results) => {
|
||||
results.map(item => {
|
||||
@@ -193,7 +193,7 @@ const addListeners = () => {
|
||||
}
|
||||
|
||||
// 维护消息列表,检查是否需要通知声音,设置新消息提醒的数量
|
||||
const newMessage = (msg) => {
|
||||
const newMessage = (msg) => {
|
||||
RongIMLib.getConversationNotificationStatus(msg.conversationType, msg.targetId, ({
|
||||
code,
|
||||
status
|
||||
@@ -204,10 +204,12 @@ const newMessage = (msg) => {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setNotifyBadge()
|
||||
|
||||
uni.$emit('onReceiveMessage', msg);
|
||||
setNotifyBadge()
|
||||
if (msg.conversationType === RongIMLib.ConversationType.PRIVATE) {
|
||||
uni.$emit('onReceivePrivateMessage', msg);
|
||||
} else {
|
||||
uni.$emit('onReceiveGroupMessage', msg);
|
||||
}
|
||||
}
|
||||
|
||||
// 播放状态
|
||||
|
||||
Reference in New Issue
Block a user