智慧保安互联网APP
liuyg
2021-08-12 9c4def893d6a3d873d593321293e0fff975acca3
视频14
5 files modified
51 ■■■■ changed files
pages.json 2 ●●● patch | view | raw | blame | history
pages/groupChat/groupChat.vue 2 ●●● patch | view | raw | blame | history
pages/videoCall/videoCall.nvue 32 ●●●● patch | view | raw | blame | history
store/actions.js 1 ●●●● patch | view | raw | blame | history
store/mutations.js 14 ●●●●● patch | view | raw | blame | history
pages.json
@@ -436,7 +436,7 @@
                "pagePath": "pages/groupChat/groupChat",
                "iconPath": "static/images/tabbar/demo.png",
                "selectedIconPath": "static/images/tabbar/demo_selected.png",
                "text": "好友"
                "text": "聊天"
            },
            {
                "pagePath": "pages/manage/manage",
pages/groupChat/groupChat.vue
@@ -72,7 +72,7 @@
                        name: '群组'
                    },
                    {
                        name: '通讯录'
                        name: '好友'
                    }
                ],
                swiperHeight: 0,
pages/videoCall/videoCall.nvue
@@ -301,6 +301,7 @@
                        console.log('对方已挂断');
                        // RtcModule.leaveChannel((res) => {});
                        that.closeAll();
                        uni.navigateBack();
                    }
                });
@@ -653,7 +654,7 @@
            // 离开清空
            async closeAll() {
                // 销毁实例
                uni.navigateBack();
                // uni.navigateBack();
                await RtcModule.leaveChannel((res) => {
                    // uni.navigateBack();
                })
@@ -710,18 +711,31 @@
            // this.closeAll();
            var that = this;
            uni.hideLoading();
            // uni.onSocketMessage(function(res) {
            //     console.log(res.data);
            //     var data = JSON.parse(res.data)
            //     // if (call && ) {
            //     // }
            //     if (data.type == 'close') {
            //         console.log('对方已挂断');
            //         // RtcModule.leaveChannel((res) => {});
            //         that.closeAll();
            //     }
            // });
            uni.onSocketMessage(function(res) {
                console.log(res.data);
                var data = JSON.parse(res.data)
                // if (call && ) {
                // }
                if (data.type == 'close') {
                    console.log('对方已挂断');
                    // RtcModule.leaveChannel((res) => {});
                    that.closeAll();
                if (data.type == 'video') {
                    // this.receiveVideo('Receiver', );
                    console.log('进入接受 跳转', data.type)
                    uni.navigateTo({
                        url: '../videoCall/videoCall?state=Receiver&type=' + data.type + '&room=' + data
                            .roomId + '&name=' + data.name + '&faqiid=' + data.faqiid
                    });
                }
                // console.log('收到服务器内容:' + res.data);
            });
        }
store/actions.js
@@ -102,6 +102,7 @@
        // }, 2000)
    }
}
export default actions
store/mutations.js
@@ -92,6 +92,20 @@
        WxStorage.set("accounts", data.accounts);
        WxStorage.set("pass", data.pass);
    },
    // useWebSocket(state){
    //     uni.onSocketMessage(function(res) {
    //         console.log(res.data);
    //         var data  = JSON.parse(res.data)
    //         if (data.type == 'video') {
    //             // this.receiveVideo('Receiver', );
    //             console.log('进入接受 跳转',data.type)
    //             uni.navigateTo({
    //                 url: '../videoCall/videoCall?state=Receiver&type=' + data.type +'&room=' + data.roomId + '&name=' + data.name + '&faqiid=' + data.faqiid
    //             });
    //         }
    //         // console.log('收到服务器内容:' + res.data);
    //     });
    // }
    loginReset(state) { //重置
        state.loging = false;
        state.message.useName = '过客 ';