智慧保安互联网APP
liuyg
2021-08-12 a06244e5253b9457fe1b6b1c397cb2386cfa86d5
视频12
1 files modified
24 ■■■■ changed files
pages/videoCall/videoCall.nvue 24 ●●●● patch | view | raw | blame | history
pages/videoCall/videoCall.nvue
@@ -281,7 +281,7 @@
                            setTimeout(res => {
                                // uni.navigateBack();
                                // console.log(111)
                                that.join();
                                // that.join();
                                console.log('成功进入')
                            }, 2000)
                        }
@@ -295,6 +295,7 @@
                    // if (call && ) {
                    // }
                    // console.log(that,1111111111111)
                    if (data.type == 'close') {
                        
                        console.log('对方已挂断');
@@ -652,8 +653,9 @@
            // 离开清空
            async closeAll() {
                // 销毁实例
                uni.navigateBack();
                await RtcModule.leaveChannel((res) => {
                    uni.navigateBack();
                    // uni.navigateBack();
                })
                // await RtcModule.destroyRtc((res) => {});
                this.videoShow = false; //视频展示
@@ -704,9 +706,23 @@
        },
        destroyed() {
            console.log('this.closeAll();');
            this.closeAll();
            // console.log('this.closeAll();');
            // 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();
                }
            });
        }
    }