From 13aed4abf5c682358825e8845d5ee75943382ccb Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 10 Feb 2022 13:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=90=8D=E7=A7=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/im/components/conversationGroup.vue | 66 ++-------- pages/im/components/conversationPrivate.vue | 71 ++--------- pages/im/components/messageCell.vue | 85 +++++++++++++ pages/im/components/messagePreview.nvue | 20 +-- pages/im/components/sentMessageBar.nvue | 3 +- pages/im/friends/index.vue | 8 +- pages/im/friends/info.vue | 4 +- pages/im/group/chat.nvue | 27 ++-- pages/im/index.vue | 11 +- pages/im/private/chat.nvue | 27 ++-- store/modules/im.js | 130 ++++++++++---------- utils/im/historyMessages.json | 23 ---- utils/im/index.js | 75 ++++++----- utils/im/listeners.js | 0 utils/im/message.js | 3 +- utils/im/models.js | 8 +- utils/im/profile-update.json | 20 --- utils/im/群聊的会话列表.json | 27 ---- utils/im/视频呼入.json | 51 -------- utils/im/语音呼入.json | 51 -------- 20 files changed, 258 insertions(+), 452 deletions(-) create mode 100644 pages/im/components/messageCell.vue delete mode 100644 utils/im/historyMessages.json create mode 100644 utils/im/listeners.js delete mode 100644 utils/im/profile-update.json delete mode 100644 utils/im/群聊的会话列表.json delete mode 100644 utils/im/视频呼入.json delete mode 100644 utils/im/语音呼入.json diff --git a/pages/im/components/conversationGroup.vue b/pages/im/components/conversationGroup.vue index 46bcfee..6e7d222 100644 --- a/pages/im/components/conversationGroup.vue +++ b/pages/im/components/conversationGroup.vue @@ -2,19 +2,9 @@ - - - - - - - 群组名称 - {{ item.sentTime|timeCustomCN }} - - - - - + + + @@ -26,9 +16,9 @@ + + diff --git a/pages/im/components/messagePreview.nvue b/pages/im/components/messagePreview.nvue index a4ce457..8a0efab 100644 --- a/pages/im/components/messagePreview.nvue +++ b/pages/im/components/messagePreview.nvue @@ -1,28 +1,28 @@ @@ -33,6 +33,10 @@ msg: { type: Object, default: {} + }, + conversationType: { + type: Number, + default: 0 }, user: { type: Object, diff --git a/pages/im/components/sentMessageBar.nvue b/pages/im/components/sentMessageBar.nvue index 8c721a7..b09be2e 100644 --- a/pages/im/components/sentMessageBar.nvue +++ b/pages/im/components/sentMessageBar.nvue @@ -12,7 +12,7 @@ @success="onSuccess" /> - + @@ -27,7 +27,6 @@ import sentVoice from '../components/sentVoice' import sentPopups from '../components/sentPopups' - export default { props: { conversationType: { diff --git a/pages/im/friends/index.vue b/pages/im/friends/index.vue index 990fc7f..14b79a4 100644 --- a/pages/im/friends/index.vue +++ b/pages/im/friends/index.vue @@ -17,9 +17,9 @@ - + - {{ friend(friendItem.userId).name }} + {{ contact(friendItem.userId).name }} {{ friendItem.address }} @@ -48,9 +48,9 @@ }; }, computed: { - friend() { + contact() { return function(targetId) { - return this.$store.getters.userInfo(targetId) + return this.$store.getters.contactInfo(targetId) } } }, diff --git a/pages/im/friends/info.vue b/pages/im/friends/info.vue index 7ef9dcb..a05311e 100644 --- a/pages/im/friends/info.vue +++ b/pages/im/friends/info.vue @@ -5,8 +5,8 @@ - {{userInfo.name}} - 地址:{{userInfo.address}} + {{ userInfo.name }} + 地址:{{ userInfo.address }} diff --git a/pages/im/group/chat.nvue b/pages/im/group/chat.nvue index 0f6f6ca..22e9bff 100644 --- a/pages/im/group/chat.nvue +++ b/pages/im/group/chat.nvue @@ -49,23 +49,17 @@ }, onLoad(e) { this.targetId = e.targetId - this.initMessageList() + this.getMessageList() uni.$on('onReceiveGroupMessage', (msg) => { if (msg.targetId == this.targetId) { - this.initMessageList() + this.getMessageList() } }) }, + onBackPress() { + uni.$off('onReceiveGroupMessage') + }, methods: { - initMessageList() { - this.getMessageList() - // 清理当前会话,未读消息数量 - RongIMLib.clearMessagesUnreadStatus(this.conversationType, this.targetId, new Date().getTime()) - // 发送消息已读状态给对方 - RongIMLib.sendReadReceiptMessage(this.conversationType, this.targetId, new Date().getTime()) - // 更新badge提醒数量 - im.setNotifyBadge() - }, // 获取消息列表 getMessageList() { im.getMessageList( @@ -75,16 +69,19 @@ 20, true, (messages) => { - console.log('获取到的消息', messages); this.messages = messages.reverse() this.scrollBottom() }) }, // 滚动到底部 scrollBottom(type) { - if (type === 'msgPopups') { - this.showPopups = !this.showPopups - } + // 清理当前会话,未读消息数量 + RongIMLib.clearMessagesUnreadStatus(this.conversationType, this.targetId, new Date().getTime() + 1100) + // 发送消息已读状态给对方 + RongIMLib.sendReadReceiptMessage(this.conversationType, this.targetId, new Date().getTime()) + // 更新badge提醒数量 + im.setNotifyBadge() + setTimeout(() => { let el = this.$refs.chatBottom ChatList.scrollToElement(el, { diff --git a/pages/im/index.vue b/pages/im/index.vue index f0606bf..a260de3 100644 --- a/pages/im/index.vue +++ b/pages/im/index.vue @@ -54,7 +54,6 @@ export default { data() { return { - isShown: true, // 当前页面显示状态 showType: 1, // 0 单聊,1 群聊 conversations: [], // 会话列表 groupConversations: [], @@ -80,7 +79,9 @@ if (this.$store.state.token !== '') { this.getPrivateConversationList() this.getGroupConversationList() - } + } + + console.log('开始监听'); // 监听新消息 uni.$on('onReceivePrivateMessage', (msg) => { this.getPrivateConversationList() @@ -88,13 +89,11 @@ uni.$on('onReceiveGroupMessage', (msg) => { this.getGroupConversationList() }) - - this.isShown = true }, onHide() { uni.$off('onReceivePrivateMessage') - uni.$off('onReceiveGroupMessage') - this.isShown = false + uni.$off('onReceiveGroupMessage') + console.log('index 隐藏'); }, onNavigationBarButtonTap(e) { if (e.index == 0) { diff --git a/pages/im/private/chat.nvue b/pages/im/private/chat.nvue index 0876967..4c49374 100644 --- a/pages/im/private/chat.nvue +++ b/pages/im/private/chat.nvue @@ -62,12 +62,12 @@ }, onLoad(e) { this.targetId = e.targetId - this.userInfo = this.$store.getters.userInfo(this.targetId) + this.userInfo = this.$store.getters.contactInfo(this.targetId) uni.setNavigationBarTitle({ title: this.userInfo.name }) // 获取消息列表 - this.initMessageList() + this.getMessageList() // 监听消息已读状态 uni.$on('onReadReceiptReceived', (data) => { if (data.targetId == this.targetId) { @@ -77,20 +77,11 @@ // 监听收到新消息,判断是否是当前会话,更新会话内容 uni.$on('onReceivePrivateMessage', (msg) => { if (msg.targetId == this.targetId) { - this.initMessageList() + this.getMessageList() } }) }, methods: { - initMessageList() { - this.getMessageList() - // 清理当前会话,未读消息数量 - RongIMLib.clearMessagesUnreadStatus(this.conversationType, this.targetId, new Date().getTime()) - // 发送消息已读状态给对方 - RongIMLib.sendReadReceiptMessage(this.conversationType, this.targetId, new Date().getTime()) - // 更新badge提醒数量 - im.setNotifyBadge() - }, customCN(val) { return timeCustomCN(val) }, @@ -103,7 +94,6 @@ 10, true, (messages) => { - console.log('获取到的消息', messages); this.messages = messages.reverse() this.scrollBottom() }) @@ -116,10 +106,13 @@ }) }, // 滚动到底部 - scrollBottom(type) { - if (type === 'msgPopups') { - this.showPopups = !this.showPopups - } + scrollBottom(type) { + // 清理当前会话,未读消息数量 + RongIMLib.clearMessagesUnreadStatus(this.conversationType, this.targetId, new Date().getTime() + 1100) + // 发送消息已读状态给对方 + RongIMLib.sendReadReceiptMessage(this.conversationType, this.targetId, new Date().getTime()) + // 更新badge提醒数量 + im.setNotifyBadge() setTimeout(() => { let el = this.$refs.chatBottom ChatList.scrollToElement(el, { diff --git a/store/modules/im.js b/store/modules/im.js index 1437b04..b7512ea 100644 --- a/store/modules/im.js +++ b/store/modules/im.js @@ -2,135 +2,134 @@ import im from "@/utils/im/index.js" export default { state: { - friends: {}, + contacts: {}, myInfo: {} }, getters: { - friends(state) { - return state.friends + contacts(state) { + return state.contacts }, - userInfo: (state) => (targetId) => { - if (state.friends[targetId]) { - const info = state.friends[targetId] + contactInfo: (state) => (targetId) => { + if (state.contacts[targetId]) { + const info = state.contacts[targetId] return { - userId: info.userId, - name: info.name, + name: info.name, + hash: info.hash, portraitUrl: info.localAvatar ? info.localAvatar : require('@/static/user/cover.png') } } else { return { - userId: '', - name: '', + name: '', + hash: '', portraitUrl: '' } } + }, + // 联系人是否存在 + contactIsExist: (state) => (targetId) => { + return Boolean(state.contacts[targetId]) }, sender(state) { return state.myInfo } }, mutations: { - updateFriendInfo(state, userInfo) { - Vue.set(state.friends, userInfo.userId, userInfo) + updateContactInfo(state, contactInfo) { + Vue.set(state.contacts, contactInfo.targetId, contactInfo) }, - SET_state_sender(state, userInfo) { + setSenderInfo(state, contactInfo) { state.myInfo = { - userId: userInfo.userId, - name: userInfo.name, - portraitUrl: userInfo.portraitUrl + userId: contactInfo.targetId, + name: contactInfo.name, + portraitUrl: contactInfo.portraitUrl } } }, actions: { setSenderInfo({ commit - }, userInfo) { - commit('SET_state_sender', userInfo) + }, contactInfo) { + commit('setSenderInfo', contactInfo) }, // 载入好友信息 - launchFriend({ + launchContact({ commit }, data) { - commit('updateFriendInfo', data) + commit('updateContactInfo', data) }, // 更新好友信息,这个时候要校验hash值了 - updateFriend({ + updateContact({ commit - }, userInfo) { - const model = uni.model.friendModel - model.find('userId=' + userInfo.userId, (err, result) => { - if (userInfo.hash != result[0].hash) { - commit('updateFriendInfo', userInfo) - if (userInfo.portraitUrl && userInfo.portraitUrl != result[0].portraitUrl) { - saveAvatar(userInfo, (savedFilePath) => { + }, contactInfo) { + const model = uni.model.contactModel + model.find('targetId=' + contactInfo.targetId, (err, result) => { + if (contactInfo.hash != result[0].hash) { + commit('updateContactInfo', contactInfo) + if (contactInfo.portraitUrl && contactInfo.portraitUrl != result[0].portraitUrl) { + saveAvatar(contactInfo, (savedFilePath) => { const info = { - userId: userInfo.userId, - name: userInfo.name, - hash: userInfo.hash, - portraitUrl: userInfo.portraitUrl, + targetId: contactInfo.targetId, + name: contactInfo.name, + hash: contactInfo.hash, + portraitUrl: contactInfo.portraitUrl, localAvatar: savedFilePath } - model.update('userId=' + userInfo.userId, info, (err, res) => { - }) - commit('updateFriendInfo', info) + model.update('targetId=' + contactInfo.targetId, info, (err, res) => {}) + commit('updateContactInfo', info) }) } else { const info = { - userId: userInfo.userId, - name: userInfo.name, - hash: userInfo.hash, - portraitUrl: userInfo.portraitUrl, + targetId: contactInfo.targetId, + name: contactInfo.name, + hash: contactInfo.hash, + portraitUrl: contactInfo.portraitUrl, localAvatar: result[0].localAvatar } - model.update('userId=' + userInfo.userId, info, (err, res) => { - }) + model.update('targetId=' + contactInfo.targetId, info, (err, res) => {}) } - } else { - } + } else {} }) }, // 初始化好友信息 - initFriend({ + initContact({ commit - }, userInfo) { + }, contactInfo) { // 将好友信息保存到vuex的内存中,方便立即使用 - commit('updateFriendInfo', userInfo) - const model = uni.model.friendModel + commit('updateContactInfo', contactInfo) + const model = uni.model.contactModel // 用户头像,是否需要下载到本地 - if (userInfo.portraitUrl) { - saveAvatar(userInfo, (savedFilePath) => { + if (contactInfo.portraitUrl) { + saveAvatar(contactInfo, (savedFilePath) => { const info = { - userId: userInfo.userId, - name: userInfo.name, - hash: userInfo.hash, - portraitUrl: userInfo.portraitUrl, + targetId: contactInfo.targetId, + name: contactInfo.name, + hash: contactInfo.hash, + portraitUrl: contactInfo.portraitUrl, localAvatar: savedFilePath } - model.insert(info, (err, res) => { - }) + model.insert(info, (err, res) => {}) // 保存头像后,更新信息 - commit('updateFriendInfo', info) + commit('updateContactInfo', info) }) } else { // 直接将信息,写入数据库 const info = { - userId: userInfo.userId, - name: userInfo.name, - hash: userInfo.hash, - portraitUrl: userInfo.portraitUrl, + targetId: contactInfo.targetId, + name: contactInfo.name, + hash: contactInfo.hash, + portraitUrl: contactInfo.portraitUrl, localAvatar: '' } - model.insert(info, (err, res) => { - }) + model.insert(info, (err, res) => {}) } } } } -const saveAvatar = (userInfo, callback) => { +const saveAvatar = (contactInfo, callback) => { uni.downloadFile({ - url: userInfo.portraitUrl, + url: contactInfo.portraitUrl, success: ({ tempFilePath }) => { @@ -143,7 +142,6 @@ const saveAvatar = (userInfo, callback) => { } }) }, - fail: (err) => { - } + fail: (err) => {} }) } diff --git a/utils/im/historyMessages.json b/utils/im/historyMessages.json deleted file mode 100644 index 97f2e47..0000000 --- a/utils/im/historyMessages.json +++ /dev/null @@ -1,23 +0,0 @@ -[{ - "objectName": "RC:TxtMsg", - "receivedTime": 1643080237399, - "extra": "", - "messageUId": "BUFC-3FSU-OLE4-I31K", - "conversationType": 1, - "messageDirection": 2, - "senderUserId": "10041", - "content": { - "content": "你好,这是 1710 条消息条消息条消息条消息条消息条消息条消息条消息条消息0.97796900 1642741562", - "objectName": "RC:TxtMsg", - "userInfo": { - "userId": "10041", - "name": "我是eth", - "portraitUrl": "http://storage.zh.shangkelian.cn/images/2022/01/12/3d2a103386df6822db7e5290272e8bc2.png" - } - }, - "targetId": "10041", - "sentTime": 1642741563003, - "messageId": 2, - "receivedStatus": 1, - "sentStatus": 30 -}] diff --git a/utils/im/index.js b/utils/im/index.js index db0c4dd..081d77c 100644 --- a/utils/im/index.js +++ b/utils/im/index.js @@ -2,6 +2,7 @@ import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index' import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index' import store from '@/store/index.js' import message from './message.js' +import listeners from './listeners.js' import { getFriends, getUserInfo, @@ -47,25 +48,25 @@ const setNotifyBadge = () => { /** * 连接IM服务 * @param {string} token token - * @param {object} userInfo {userId: string, name: string, portraitUrl: string} + * @param {object} userInfo {targetId: string, name: string, portraitUrl: string} */ const connect = (token, userInfo, callback) => { RongIMLib.connect(token, res => { - callback(res) + callback(res) // 更新个人信息 store.dispatch('setSenderInfo', userInfo) // 设置未读消息数量 setNotifyBadge() // 首次运行获取好友列表 - const FK = 'IFT_' + userInfo.userId + const FK = 'IFTJ_' + userInfo.targetId uni.getStorage({ key: FK, - success: () => { - const model = uni.model.friendModel + success: () => { + const model = uni.model.contactModel model.find((err, results) => { results.map(item => { - store.dispatch('launchFriend', item) + store.dispatch('launchContact', item) }) }) }, @@ -73,9 +74,9 @@ const connect = (token, userInfo, callback) => { // 程序是首次运行,初始化加载好友信息 getFriends().then(res => { res.map(item => { - store.dispatch('initFriend', item) + store.dispatch('initContact', item) }) - uni.setStorageSync(FK, userInfo.userId) + uni.setStorageSync(FK, userInfo.targetId) }) } }) @@ -114,36 +115,42 @@ const notifyMsgTypes = [ function inArray(search, array) { for (var i in array) { if (array[i] == search) { - return true; + return true } } - return false; + return false } const addListeners = () => { // 添加连接状态监听函数 RongIMLib.addConnectionStatusListener((res) => { - console.log('连接状态监听', res.data.status); + console.log('连接状态监听', res.data.status) uni.$emit('onConnectionStatusChange', res.data.status) }) // 添加消息监听函数 RongIMLib.addReceiveMessageListener((res) => { const message = res.data.message - console.log('收到消息', message); + console.log('收到消息', message) if (inArray(message.objectName, notifyMsgTypes)) { - console.log('通知并计数的消息'); + if (!store.getters.contactIsExist(message.targetId)) { + getUserInfo(message.targetId).then(res => { + store.dispatch('initContact', res) + }).catch(err => { + console.log('ERR', err) + }) + } newMessage(message) } else if (message.objectName === RongIMLib.ObjectName.ProfileNotification) { - store.dispatch('updateFriend', JSON.parse(message.content.data)) + store.dispatch('updateContact', JSON.parse(message.content.data)) // 调用完更新之后,删除这条消息 RongIMLib.deleteMessagesByIds([message.messageId], ({ code }) => { - console.log('消息删除结果', code); + console.log('消息删除结果', code) }) - } else if (message.objectName === RongIMLib.ObjectName.ContactNotification) { - // 触发一个新好友的通知事件 - uni.$emit('onContactNotification', message.content) + } else if (message.objectName === RongIMLib.ObjectName.ContactNotification) { + // 触发一个新好友的通知事件 + uni.$emit('onContactNotification', message.content) } }) @@ -166,34 +173,34 @@ const addListeners = () => { }) // 通话建立成功 CallLib.onCallConnected(() => { - uni.$emit('onCallConnected'); + uni.$emit('onCallConnected') }) // 外呼 CallLib.onCallOutgoing((res) => { - uni.$emit('onCallOutgoing'); + uni.$emit('onCallOutgoing') }) // 远端响铃 CallLib.onRemoteUserRinging((res) => { - uni.$emit('onRemoteUserRinging'); + uni.$emit('onRemoteUserRinging') }) // 远端加入 CallLib.onRemoteUserJoined((res) => { - uni.$emit('onRemoteUserJoined'); + uni.$emit('onRemoteUserJoined') }) // 断开链接 CallLib.onCallDisconnected((res) => { - console.log('断开链接', res); - uni.$emit('onCallDisconnected'); + console.log('断开链接', res) + uni.$emit('onCallDisconnected') }) // 远端挂断 CallLib.onRemoteUserLeft((res) => { - console.log('远端离开', res); - uni.$emit('onRemoteUserLeft'); + console.log('远端离开', res) + uni.$emit('onRemoteUserLeft') }) } // 维护消息列表,检查是否需要通知声音,设置新消息提醒的数量 -const newMessage = (msg) => { +const newMessage = (msg) => { RongIMLib.getConversationNotificationStatus(msg.conversationType, msg.targetId, ({ code, status @@ -203,13 +210,13 @@ const newMessage = (msg) => { triTone() } } - }); - setNotifyBadge() - if (msg.conversationType === RongIMLib.ConversationType.PRIVATE) { - uni.$emit('onReceivePrivateMessage', msg); - } else { - uni.$emit('onReceiveGroupMessage', msg); - } + }) + setNotifyBadge() + if (msg.conversationType === RongIMLib.ConversationType.PRIVATE) { + uni.$emit('onReceivePrivateMessage', msg) + } else { + uni.$emit('onReceiveGroupMessage', msg) + } } // 播放状态 diff --git a/utils/im/listeners.js b/utils/im/listeners.js new file mode 100644 index 0000000..e69de29 diff --git a/utils/im/message.js b/utils/im/message.js index f83e268..849b7cf 100644 --- a/utils/im/message.js +++ b/utils/im/message.js @@ -66,9 +66,10 @@ const sentText = (conversationType, targetId, content, user, callback) => { if (code === 0) { callback(messageId) } else { + console.log('发送失败', msg); uni.showToast({ icon: 'none', - title: '发送失败' + title: '发送失败' + code }) } }) diff --git a/utils/im/models.js b/utils/im/models.js index d560acb..a7c6ef0 100644 --- a/utils/im/models.js +++ b/utils/im/models.js @@ -2,8 +2,8 @@ import { usqlite } from '@/uni_modules/onemue-USQLite/js_sdk/usqlite.js' -const friendModel = usqlite.model('friends', { - userId: { +const contactModel = usqlite.model('contacts', { + targetId: { type: String, primaryKey: true, unique: true @@ -15,8 +15,8 @@ const friendModel = usqlite.model('friends', { }, portraitUrl: String, localAvatar: String -}) +}) export default { - friendModel + contactModel } diff --git a/utils/im/profile-update.json b/utils/im/profile-update.json deleted file mode 100644 index c3d1147..0000000 --- a/utils/im/profile-update.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "objectName": "RC:ProfileNtf", - "receivedTime": 1644312766084, - "extra": "", - "messageUId": "BUR2-MQHQ-SMIO-I32D", - "conversationType": 6, - "messageDirection": 2, - "senderUserId": "10047", - "content": { - "extra": "", - "operation": "Update", - "objectName": "RC:ProfileNtf", - "data": "{\"a\":2,\"m\":\"修改用户信息\"}" - }, - "targetId": "10047", - "sentTime": 1644312766699, - "messageId": 26, - "receivedStatus": 0, - "sentStatus": 30 -} \ No newline at end of file diff --git a/utils/im/群聊的会话列表.json b/utils/im/群聊的会话列表.json deleted file mode 100644 index 091b0f0..0000000 --- a/utils/im/群聊的会话列表.json +++ /dev/null @@ -1,27 +0,0 @@ -[{ - "latestMessage": { - "content": "你好,这是 725 条消息条消息条消息条消息条消息条消息条消息条消息条消息0.47447800 1644388415", - "objectName": "RC:TxtMsg", - "userInfo": { - "userId": "10051", - "name": "Jason.Chen", - "extra": "", - "portraitUrl": "" - } - }, - "objectName": "RC:TxtMsg", - "receivedTime": 1644388414889, - "sentTime": 1644388415510, - "draft": "", - "conversationType": 3, - "receivedStatus": 0, - "conversationTitle": "", - "sentStatus": 30, - "mentionedCount": 0, - "latestMessageId": 98, - "isTop": false, - "senderUserId": "10005", - "unreadMessageCount": 3, - "hasUnreadMentioned": false, - "targetId": "TG001" -}] diff --git a/utils/im/视频呼入.json b/utils/im/视频呼入.json deleted file mode 100644 index 97a4087..0000000 --- a/utils/im/视频呼入.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "Engine:OnCallReceived", - "module": "RongCloud-Call-RCUniCall", - "data": { - "endTime": 0, - "users": [{ - "userId": "10051", - "enableCamera": false, - "mediaId": "420111350", - "mediaType": 1, - "userType": 0, - "enableMicrophone": false - }, { - "userId": "10047", - "enableCamera": false, - "mediaType": 1, - "userType": 0, - "enableMicrophone": false - }], - "inviter": { - "userId": "10051", - "enableCamera": false, - "mediaId": "420111350", - "mediaType": 1, - "userType": 0, - "enableMicrophone": false - }, - "caller": { - "userId": "10051", - "enableCamera": false, - "mediaId": "420111350", - "mediaType": 1, - "userType": 0, - "enableMicrophone": false - }, - "connectedTime": 0, - "extra": "", - "startTime": 0, - "mediaType": 1, - "callId": "c28cb9d8-6581-474c-bfa5-9872a4824b65", - "targetId": "10051", - "callType": 0, - "mine": { - "userId": "10047", - "enableCamera": false, - "mediaType": 1, - "userType": 0, - "enableMicrophone": false - } - } -} diff --git a/utils/im/语音呼入.json b/utils/im/语音呼入.json deleted file mode 100644 index 3c24ca0..0000000 --- a/utils/im/语音呼入.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "Engine:OnCallReceived", - "module": "RongCloud-Call-RCUniCall", - "data": { - "endTime": 0, - "users": [{ - "userId": "10051", - "enableCamera": false, - "mediaId": "420068630", - "mediaType": 0, - "userType": 0, - "enableMicrophone": false - }, { - "userId": "10047", - "enableCamera": true, - "mediaType": 0, - "userType": 0, - "enableMicrophone": false - }], - "inviter": { - "userId": "10051", - "enableCamera": false, - "mediaId": "420068630", - "mediaType": 0, - "userType": 0, - "enableMicrophone": false - }, - "caller": { - "userId": "10051", - "enableCamera": false, - "mediaId": "420068630", - "mediaType": 0, - "userType": 0, - "enableMicrophone": false - }, - "connectedTime": 0, - "extra": "", - "startTime": 0, - "mediaType": 0, - "callId": "1a1462b8-b63b-40a9-bf95-963e810ac49a", - "targetId": "10051", - "callType": 0, - "mine": { - "userId": "10047", - "enableCamera": true, - "mediaType": 0, - "userType": 0, - "enableMicrophone": false - } - } -}