|
|
@@ -23,7 +23,8 @@ export default {
|
|
|
...mapState(['userInfo']),
|
|
|
},
|
|
|
mounted() {
|
|
|
- window.chatLogin = this.chatLogin;
|
|
|
+ window.chatLogin = this.chatLogin;
|
|
|
+ window.sendMessage=this.sendMessage;
|
|
|
},
|
|
|
methods: {
|
|
|
chatLogin(userID, userSig) {
|
|
|
@@ -95,15 +96,11 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
this.tim.on(TIM.EVENT.GROUP_LIST_UPDATED, (event)=>{
|
|
|
// 收到群组列表更新通知,可通过遍历 event.data 获取群组列表数据并渲染到页面
|
|
|
// event.name - TIM.EVENT.GROUP_LIST_UPDATED
|
|
|
// event.data - 存储 Group 对象的数组 - [Group]
|
|
|
- if (window.ReactNativeWebView) {
|
|
|
- window.ReactNativeWebView.postMessage(
|
|
|
- JSON.stringify(event.data)
|
|
|
- );
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
@@ -126,11 +123,6 @@ export default {
|
|
|
// event.name - TIM.EVENT.ERROR
|
|
|
// event.data.code - 错误码
|
|
|
// event.data.message - 错误信息
|
|
|
- if (window.ReactNativeWebView) {
|
|
|
- window.ReactNativeWebView.postMessage(
|
|
|
- JSON.stringify(event)
|
|
|
- );
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|