From a06244e5253b9457fe1b6b1c397cb2386cfa86d5 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 12 Aug 2021 20:28:55 +0800
Subject: [PATCH] 视频12

---
 pages/videoCall/videoCall.nvue |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/pages/videoCall/videoCall.nvue b/pages/videoCall/videoCall.nvue
index acfbbc6..7f6e6cd 100644
--- a/pages/videoCall/videoCall.nvue
+++ b/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();
+				}
+			});
 		}
 
 	}

--
Gitblit v1.9.3