Prechádzať zdrojové kódy

任务填报修复 3/11

zhangyun 3 rokov pred
rodič
commit
eae82aeaff
38 zmenil súbory, kde vykonal 935 pridanie a 776 odobranie
  1. 15 13
      MingGaoApp/App.vue
  2. 3 0
      MingGaoApp/manifest.json
  3. 10 0
      MingGaoApp/pages.json
  4. 10 1
      MingGaoApp/pages/index/harmfultask.vue
  5. 17 0
      MingGaoApp/pages/index/index.vue
  6. 17 0
      MingGaoApp/pages/insectpest/baselist.vue
  7. 17 0
      MingGaoApp/pages/insectpest/insectpest.vue
  8. 16 1
      MingGaoApp/pages/my/addcont.vue
  9. 17 0
      MingGaoApp/pages/my/index.vue
  10. 16 1
      MingGaoApp/pages/my/monitorlog.vue
  11. 13 0
      MingGaoApp/pages/my/monitorlogdata.vue
  12. 13 0
      MingGaoApp/pages/my/mtmonitdetails.vue
  13. 13 0
      MingGaoApp/pages/my/myinfo.vue
  14. 13 0
      MingGaoApp/pages/my/mymonit.vue
  15. 17 0
      MingGaoApp/pages/my/password.vue
  16. 16 1
      MingGaoApp/pages/my/version.vue
  17. 32 5
      MingGaoApp/pages/response/details.vue
  18. 16 6
      MingGaoApp/pages/response/index.vue
  19. 0 359
      MingGaoApp/pages/response/video - 副本 (2).nvue
  20. 283 122
      MingGaoApp/pages/response/video - 副本.nvue
  21. 77 70
      MingGaoApp/pages/response/video.nvue
  22. 17 0
      MingGaoApp/pages/supervise/index.vue
  23. 17 0
      MingGaoApp/pages/supervise/submitsupe.vue
  24. 17 0
      MingGaoApp/pages/supervise/supetask.vue
  25. 1 0
      MingGaoApp/unpackage/debug/.roid.ins
  26. BIN
      MingGaoApp/unpackage/debug/android_debug.apk
  27. 4 0
      MingGaoApp/unpackage/dist/build/app-plus/app-config-service.js
  28. 13 1
      MingGaoApp/unpackage/dist/build/app-plus/app-service.js
  29. 5 1
      MingGaoApp/unpackage/dist/build/app-plus/app-view.js
  30. 5 1
      MingGaoApp/unpackage/dist/build/app-plus/manifest.json
  31. 5 1
      MingGaoApp/unpackage/dist/build/app-plus/pages/response/video.js
  32. 9 1
      MingGaoApp/unpackage/dist/build/app-plus/view.umd.min.js
  33. 57 70
      MingGaoApp/unpackage/dist/dev/app-plus/app-service.js
  34. 61 35
      MingGaoApp/unpackage/dist/dev/app-plus/app-view.js
  35. 1 1
      MingGaoApp/unpackage/dist/dev/app-plus/manifest.json
  36. 80 84
      MingGaoApp/unpackage/dist/dev/app-plus/pages/response/video.js
  37. 9 1
      MingGaoApp/unpackage/dist/dev/app-plus/view.umd.min.js
  38. 3 1
      MingGaoApp/util/url.js

+ 15 - 13
MingGaoApp/App.vue

@@ -6,7 +6,9 @@
 			// 文本消息
 			socketTask: null,
 			// urlData: "ws://114.115.147.140:12345/api/api_gateway?method=control_center.real_time.im_message",
-			urlData: "ws://192.168.1.17:12345/api/api_gateway?method=control_center.real_time.im_message",
+			urlData: "wss://www.toreskj.com/api/api_gateway?method=control_center.real_time.im_message",
+			// urlData: "wss://yfznscd.com/api/api_gateway?method=control_center.real_time.im_message",
+			// urlData: "ws://192.168.1.17:12345/api/api_gateway?method=control_center.real_time.im_message",
 			is_open_socket: false, // 确保websocket是打开状态
 			list: [],
 			userId: null, // 用户ID
@@ -48,19 +50,11 @@
 		onShow: function() {
 			// App展示在前台
 			console.log('+++++++++++++++++++App Show-------------------------------------')
-			// this.close() // 先关闭
-			// if (this.globalData.socketTask == null && this.globalData.token !== '') {
-			// 	this.msgInit();
-			// } else if (this.globalData.socketTask !== null) {
-			// 	this.close() // 先关闭
-			// 	this.msgInit(); // 再进行请求
-			// }
-			// console.log(this.globalData.socketTask)
-			
-			// this.msgInit(); // 再进行请求
+			this.msgInit(); // 再进行请求
 		},
 		onHide: function() {
 			// App不再再展示在前台
+			// this.close(); // 关闭
 		},
 		methods: {
 			// 实时通信 - 初始化
@@ -124,6 +118,10 @@
 					} else if (val.action == 'recv_video') {
 						that.globalData.video = val.data
 						this.$store.state.video = val.data
+						setTimeout(() => {
+							console.log('跳转了')
+							this.$store.getters.watchData;
+						}, 1500)
 					}
 					
 					
@@ -136,14 +134,18 @@
 				this.globalData.socketTask.onClose((res) => {
 					console.log(res, '连接关闭');
 					clearInterval(this.globalData.timeoutObj);
-					// that.reconnect();
+					setTimeout(() => {
+						that.reconnect();
+					}, 5000)
 				})
 				
 				// 连接失败
 				that.globalData.socketTask.onError((res) => {
 					console.log(res, '连接错误');
 					clearInterval(this.globalData.timeoutObj);
-					// that.reconnect();
+					setTimeout(() => {
+						that.reconnect();
+					}, 5000)
 				})
 			},
 

+ 3 - 0
MingGaoApp/manifest.json

@@ -7,6 +7,9 @@
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
+        "compatible" : {
+            "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持  
+        },
         "usingComponents" : true,
         "nvueStyleCompiler" : "uni-app",
         "compilerVersion" : 3,

+ 10 - 0
MingGaoApp/pages.json

@@ -3,6 +3,16 @@
 		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+	// {
+	// 	"path": "pages/response/video",
+	// 	"style": {
+	// 		"navigationBarTitleText": "视频通话",
+	// 		"navigationBarBackgroundColor": "#ffffff",
+	// 		"enablePullDownRefresh": false,
+	// 		"navigationStyle": "custom"
+	// 	}
+	
+	// },
 		{
 			"path": "pages/start/start",
 			"style": {

+ 10 - 1
MingGaoApp/pages/index/harmfultask.vue

@@ -26,6 +26,10 @@
 				console.log(this.$store.state.kpsurlL)
 				return this.$store.state.kpsurlL
 			},
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
 		},
 		watch:{
 			boxclass(news){
@@ -36,7 +40,12 @@
 					this.tfclass = false
 				}
 				
-			}
+			},
+			videoData(news, old) {
+				uni.switchTab({
+					url: '../response/index'
+				})
+			},
 		},
 		methods: {
 			toinsect(item) {

+ 17 - 0
MingGaoApp/pages/index/index.vue

@@ -102,6 +102,23 @@
 				this.opencale()
 			}
 		},
+		watch: {
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			sectionChange(e) {
 				this.current = e

+ 17 - 0
MingGaoApp/pages/insectpest/baselist.vue

@@ -51,6 +51,23 @@
 		onShow() {
 			this.gettaskinfo()
 		},
+		watch: {
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			async gettaskinfo() {
 				this.loading = true

+ 17 - 0
MingGaoApp/pages/insectpest/insectpest.vue

@@ -103,6 +103,23 @@
 			this.getselectworn()
 			this.getwornlist(this.baseinfo.id)
 		},
+		watch: {
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			async getwornlist(id) {
 				console.log(id)

+ 16 - 1
MingGaoApp/pages/my/addcont.vue

@@ -83,7 +83,22 @@
 				if(this.value1!=''){
 					this.texttf = false
 				}
-			}
+			},
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
 		},
 		methods: {
 			gainimg() { //添加图片

+ 17 - 0
MingGaoApp/pages/my/index.vue

@@ -42,6 +42,23 @@
 				ids:plus.runtime.version
 			}
 		},
+		watch: {
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			async getinfo() {
 				const res = await this.$myRequest({

+ 16 - 1
MingGaoApp/pages/my/monitorlog.vue

@@ -150,7 +150,22 @@
 						text: " ",
 					});
 				}
-			}
+			},
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
 		},
 		methods: {
 			sectionChange(e) {

+ 13 - 0
MingGaoApp/pages/my/monitorlogdata.vue

@@ -71,6 +71,19 @@
 				loading:false
 			}
 		},
+		watch: {
+			videoData(news, old) {
+				uni.switchTab({
+					url: '../response/index'
+				})
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			async getdatalist(id) {
 				this.loading = true

+ 13 - 0
MingGaoApp/pages/my/mtmonitdetails.vue

@@ -19,6 +19,19 @@
 				istask:3,
 			}
 		},
+		watch: {
+			videoData(news, old) {
+				uni.switchTab({
+					url: '../response/index'
+				})
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			toinsect(item){
 				uni.navigateTo({

+ 13 - 0
MingGaoApp/pages/my/myinfo.vue

@@ -77,6 +77,19 @@
 				content: "确定要退出当前账号吗?"
 			}
 		},
+		watch: {
+			videoData(news, old) {
+				uni.switchTab({
+					url: '../response/index'
+				})
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			async getinfo() {
 				const res = await this.$myRequest({

+ 13 - 0
MingGaoApp/pages/my/mymonit.vue

@@ -37,6 +37,19 @@
 				loading:false
 			}
 		},
+		watch: {
+			videoData(news, old) {
+				uni.switchTab({
+					url: '../response/index'
+				})
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			async asyncgetmonitlist() {
 				this.loading = true

+ 17 - 0
MingGaoApp/pages/my/password.vue

@@ -61,6 +61,23 @@
 				passload:false
 			}
 		},
+		watch: {
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			submit() {
 				this.$refs.uForm.validate().then(res => {

+ 16 - 1
MingGaoApp/pages/my/version.vue

@@ -54,7 +54,22 @@
 						}
 					})
 				}
-			}
+			},
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
 		},
 		onNavigationBarButtonTap(e) {
 			uni.$u.toast('更新中请勿操作')

+ 32 - 5
MingGaoApp/pages/response/details.vue

@@ -13,14 +13,14 @@
 						</view>
 						<view class="list_triangle"></view>
 						<view class="list_img">
-							<image src="../../static/image/7.png" mode=""></image>
+							<view style="color: #fff; text-align: center; line-height: 90rpx; font-size: 40rpx;">我</view>
 						</view>
 					</view>
 
 					<!-- you -->
 					<view class="list_msgBox2" v-if="item.is_right == false">
 						<view class="list_img">
-							<image src="../../static/image/6.png" mode=""></image>
+							<view style="color: #fff; text-align: center; line-height: 90rpx; font-size: 40rpx;">{{ tltName.slice(0, 1) }}</view>
 						</view>
 						<view class="list_triangle"></view>
 						<view class="list_msgText">
@@ -81,6 +81,15 @@
 				// });
 
 			},
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
 
 			listData(news, old) {
 				console.log('有变化了啊-------------', news)
@@ -95,7 +104,11 @@
 				this.$forceUpdate()
 				console.log(this.msg_list, '新数组啊啊-------------')
 
-			}
+			},
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
 
 		},
 		computed: {
@@ -223,9 +236,16 @@
 					}
 
 					.list_img {
-						image {
+						// image {
+						// 	width: 96rpx;
+						// 	height: 96rpx;
+						// }
+						view {
 							width: 96rpx;
 							height: 96rpx;
+							border-radius: 20rpx;
+							background-image: linear-gradient(#a7fbc6, #60fba5);
+							margin: 0 10rpx 0 0;
 						}
 					}
 				}
@@ -236,9 +256,16 @@
 					justify-content: flex-start;
 
 					.list_img {
-						image {
+						// image {
+						// 	width: 96rpx;
+						// 	height: 96rpx;
+						// }
+						view {
 							width: 96rpx;
 							height: 96rpx;
+							border-radius: 20rpx;
+							background-image: linear-gradient(#addbff, #5cacff);
+							margin: 0 0 0 10rpx;
 						}
 					}
 

+ 16 - 6
MingGaoApp/pages/response/index.vue

@@ -6,7 +6,8 @@
 					<u-badge numberType="overflow" shape="circle" :type="type" max="99" :value="item.unread">
 					</u-badge>
 					<!-- <image :src="item.img" mode=""></image> -->
-					<image src="https://cdn.uviewui.com/uview/album/1.jpg" mode=""></image>
+					<!-- <image src="https://cdn.uviewui.com/uview/album/1.jpg" mode=""></image> -->
+					<view style="color: #fff; text-align: center; line-height: 100rpx; font-size: 40rpx;">{{ item.real_name.slice(0,1) }}</view>
 				</view>
 				<view class="response_right">
 					<view class="response_right_title">
@@ -25,7 +26,7 @@
 		</view>
 
 		<view class="" style="padding: 20% 0 0 0;" v-else>
-			<image style="margin: 0 0 0 65rpx;" src="../../static/image/13.png" mode=""></image>
+			<image style="margin: 0 0 0 85rpx; width: 600rpx; height: 400rpx;" src="../../static/image/13.png" mode=""></image>
 			<view style="text-align: center; color: #83ccfd; font-size: 20px; line-height: 20rpx;">暂无数据</view>
 		</view>
 
@@ -45,8 +46,8 @@
 					<view class="topUpImg">
 						<image src="https://cdn.uviewui.com/uview/album/1.jpg" mode=""></image>
 					</view>
-					<view class="topUpTxt">
-						<text>嚣张</text>
+					<view class="topUpTxt" v-if="videoObj !== null">
+						<text>{{ videoObj.real_name }}</text>
 						<text>邀请你进行视频通话..</text>
 					</view>
 				</view>
@@ -126,7 +127,9 @@
 				console.log(news)
 				if (news) {
 					this.videoObj = news
-					this.show = true
+					setTimeout(() => {
+						this.show = true
+					}, 3500)
 				}
 			},
 
@@ -195,6 +198,7 @@
 			// 弹出框
 			open() {
 				console.log('open');
+				console.log(this.videoObj, '这是传来的数据')
 				uni.navigateTo({
 					url: '/pages/response/video?videoObj=' + JSON.stringify(this.videoObj)
 				})
@@ -286,10 +290,16 @@
 
 				// 左
 				.response_left {
-					image {
+					// image {
+					// 	width: 110rpx;
+					// 	height: 110rpx;
+					// 	border-radius: 20rpx;
+					// }
+					view {
 						width: 110rpx;
 						height: 110rpx;
 						border-radius: 20rpx;
+						background-image: linear-gradient(#addbff, #5cacff);
 					}
 				}
 

+ 0 - 359
MingGaoApp/pages/response/video - 副本 (2).nvue

@@ -1,359 +0,0 @@
-<template>
-	<view class="video_box" :style="'height:' +  phoneHeight + 'px'">
-		<!-- 本地预览视图 -->
-		<view class="video_me" :style="'height:' +  phoneHeight + 'px'">
-			<zego-local-view v-if="videoShow" :viewMode="publisherViewModeIndex"
-				style="width: 100%; flex: 1; border: 1px solid #0000; z-index: 20">
-			</zego-local-view>
-		</view>
-
-		<!-- 服务器传来的预览图 -->
-		<!-- <view class="video_you" @click="changeShow"> -->
-		<view class="video_you">
-			<zego-remote-view :streamID="serveViewModeIndex" :viewMode="viewModeA"
-				style="height: 403.84rpx; flex: 1;">
-			</zego-remote-view>
-		</view>
-
-		<view class="video_btn">
-			<view class="video_imgList">
-				<view class="video_imgList1">
-					<view class="video_view" @click="turn">
-						<image class="video_view_img" src="../../static/image/9.png" mode=""></image>
-					</view>
-					<text class="video_view_txt">翻转镜头</text>
-				</view>
-				<view class="video_imgList2">
-					<view class="video_view">
-						<image class="video_view_img" src="../../static/image/8.png" mode=""></image>
-					</view>
-					<text class="video_view_txt">切换语音通话</text>
-				</view>
-			</view>
-
-			<!-- 	<u-button type="error" class="offBtn" @click="offVideo()"  size="mini" text="关闭">
-			</u-button> -->
-			<image @click="offVideo()" style="width: 50px; height: 50px; margin: 0 0 0 330rpx;"
-				src="../../static/image/10.png" mode=""></image>
-		</view>
-
-		<!-- 消息提醒 -->
-		<u-toast ref="uToast"></u-toast>
-	</view>
-</template>
-
-<script>
-	import permision from "@/zego-express-video-uniapp/permission.js";
-	import ZegoExpressEngine from '@/zego-express-video-uniapp/lib/ZegoExpressEngine';
-	import {
-		ZegoScenario,
-		ZegoRoomState,
-		ZegoUpdateType,
-		// ZegoViewMode
-	} from '@/zego-express-video-uniapp/lib/ZegoExpressDefines'
-	import {
-		AppID,
-		AppSign
-	} from '@/zego-express-video-uniapp/KeyCenter.js'
-	import ZegoLocalView from '@/zego-express-video-uniapp/zego-view/ZegoLocalView';
-	import ZegoRemoteView from '@/zego-express-video-uniapp/zego-view/ZegoRemoteView';
-	export default {
-		data() {
-			return {
-				phoneHeight: '', // 获取当前的屏幕高度
-
-				// 即构
-				publisherViewModeIndex: 0, // 本地预览图
-				viewModeA: 0, // 服务器预览图
-				serveViewModeIndex: "", // 服务器拉流预览图
-				engine: undefined,
-				videoObj: null,
-				userid: "Uni" + Math.floor(Math.random() * 1000000).toString(),
-				isPublishingStream: false,
-				shotShow: false, // 翻转镜头
-				videoShow: true, // 切换视频显示
-			}
-		},
-		components: {
-			ZegoLocalView: ZegoLocalView,
-			ZegoRemoteView: ZegoRemoteView
-		},
-
-		methods: {
-			// 即构 - 视频通话 初始化
-			async setup() {
-				var that = this
-				// 创建引擎
-				let profile = {
-					appID: AppID,
-					appSign: AppSign,
-					scenario: ZegoScenario.General
-				}
-				this.engine = await ZegoExpressEngine.createEngineWithProfile(profile);
-				this.engine.useFrontCamera(this.shotShow); // 设置前后摄像头
-				// console.log(this.engine)
-				this.addListeners();
-				// console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' + that.videoObj.room_id)
-				this.engine.loginRoom(that.videoObj.room_id, {
-					userID: that.videoObj.room_id,
-					userName: that.videoObj.room_id
-				}, {
-					isUserStatusNotify: true
-				});
-			},
-
-			// 即构 - 翻转镜头
-			turn() {
-				this.shotShow = !this.shotShow
-				this.engine.useFrontCamera(this.shotShow)
-			},
-
-			// 切换视频显示
-			changeShow() {
-				this.videoShow = !this.videoShow
-				// this.onPublish()
-				this.engine.startPreview();
-				this.engine.startPublishingStream(this.videoObj.room_id);
-				this.publishBtnName = "Stop Publishing";
-				console.log(this.videoShow)
-			},
-
-			// 即构 - 视频通话 监听房间
-			addListeners() {
-				// 房间状态变化通知
-				this.engine.on("roomStateUpdate", (roomID, state, errorCode, extendedData) => {
-					// console.log('房间状态变化')
-					if (state == "CONNECTED") {
-						// 与房间连接成功,只有当房间状态是连接成功时,才能进行推流、拉流等操作。
-						// 接下来的“预览并推流”的代码写在这里
-						console.log("房间连接成功");
-					}
-					if (state == "DISCONNECTED") {
-						// 与房间断开了连接
-						console.log("与房间断开连接");
-					}
-
-					if (state == "CONNECTING") {
-						// 与房间尝试连接中
-						console.log("与房间尝试连接中");
-					}
-				});
-
-				// 房间用户变化通知
-				this.engine.on("roomUserUpdate", (roomID, updateType, userList) => {
-					// console.log('房间用户变化通知')
-					// console.log(updateType)
-					// console.log(userList)
-					// if (updateType == "ADD") {
-					// 	console.log('hsdjshadjh')
-					// } else if (updateType == 1 ) {
-					// 	console.log('几十块的教科书')
-					// 	this.offVideo()
-					// }
-					// console.log(updateType + '------------------------')
-					// console.log(userList)
-					// console.log("有其他用户进出房间");
-
-					if (updateType == "1") {
-						// 有其他用户退出房间
-						this.offVideo()
-					}
-				});
-
-				// 房间内其他用户推的流变化通知
-				this.engine.on("roomStreamUpdate", (roomID, updateType, streamList) => {
-					if (updateType == "0") {
-						// 流新增,开始拉流
-						this.tensile(streamList[0].streamID)
-					} else if (updateType == "1") {
-						// 流删除,停止拉流
-						this.notTensile(streamList[0].streamID);
-					}
-				});
-
-				// 房间内在线用户数量回调
-				// this.engine.on("roomOnlineUserCountUpdate", (roomID, count) => {
-				// 	// console.log(roomID)	
-				// 	console.log(count)
-				// 	console.log('>?>>>>>>>>>>>>>>>>>>>>>>>在线用户有变化')
-				// });
-
-				// 拉流质量回调
-				this.engine.on("playerQualityUpdate", (streamID, quality) => {
-					console.log('拉流质量回调')
-				});
-
-				// 拉流后的事件回调
-				this.engine.on("playerStateUpdate", (streamID, state, errorCode, extendedData) => {
-					console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' + '拉流后的事件触发了')
-				})
-			},
-
-			// 拉流 
-			tensile(roomId) {
-				console.log('拉流进入了啊')
-				console.log(roomId)
-				this.serveViewModeIndex = roomId
-				console.log(this.serveViewModeIndex)
-				this.engine.startPlayingStream(roomId);
-			},
-
-			// 停止拉流
-			notTensile(roomId) {
-				console.log(roomId)
-				this.serveViewModeIndex = roomId
-				console.log(this.serveViewModeIndex)
-				this.engine.stopPlayingStream(roomId)
-			},
-
-			// 推流 - 展示视图 - 本地视频流
-			onPublish() {
-				// 设置视频配置
-				// ZegoExpressEngine.instance().setVideoConfig(this.videoObj.room_id);
-
-				if (this.isPublishingStream) {
-					// 停止推流
-					this.engine.stopPreview();
-					this.engine.stopPublishingStream();
-					this.publishBtnName = "Start Publishing";
-				} else {
-					// 开始推流
-					this.engine.startPreview();
-					this.engine.startPublishingStream(this.videoObj.room_id);
-					this.publishBtnName = "Stop Publishing";
-				}
-				this.isPublishingStream = !this.isPublishingStream;
-			},
-
-			// 挂断退出
-			offVideo() {
-				console.log('进入了啊')
-				this.engine.logoutRoom(this.videoObj.room_id)
-				this.$refs.uToast.show({
-					type: 'default',
-					message: '结束视频通话!',
-				})
-				setTimeout(() => {
-					uni.navigateBack({
-						delta: 1
-					})
-				}, 1500)
-				// uni.redirectTo({
-				// 	url: "/pages/response/index"
-				// })
-
-			},
-		},
-
-		async onLoad(optinos) {
-			var that = this
-			that.videoObj = JSON.parse(optinos.videoObj)
-			// console.log(that.videoObj)
-			// 即构 - 视频通话
-			// 获取系统信息同步接口
-			if (uni.getSystemInfoSync().platform === 'android') {
-				await permision.requestAndroidPermission('android.permission.RECORD_AUDIO');
-				await permision.requestAndroidPermission('android.permission.CAMERA');
-			}
-			await this.setup()
-			this.onPublish(); // 推流
-			uni.getSystemInfo({ //异步获取。
-				success(res) {
-					// that.phoneHeight = res.windowHeight - 13; //窗口高度
-					that.phoneHeight = res.windowHeight; //窗口高度
-				}
-			});
-		},
-
-		// 监听页面返回
-		onBackPress() {
-			console.log('返回了!')
-		},
-	}
-</script>
-
-<style lang="scss">
-	.video_box {
-		background: #000;
-
-		.video_you {
-			border: 1px solid;
-			background: #fff;
-			width: 150px;
-			height: 200px;
-			position: absolute;
-			right: 10px;
-			top: 10px;
-			overflow: hidden;
-		}
-
-		.video_me {
-			z-index: 100;
-			background: #000;
-			position: relative;
-			right: 0;
-			top: 0;
-		}
-
-		.video_btn {
-			position: absolute;
-			bottom: 35rpx;
-			left: 0;
-			width: 750rpx;
-
-			.video_imgList {
-				display: flex;
-				flex-direction: row;
-				justify-content: space-around;
-
-				// 翻转
-				.video_imgList1 {
-					.video_view {
-						background: rgba(0, 0, 0, .5);
-						border-radius: 50px;
-						width: 50px;
-						height: 50px;
-						margin: 0 auto;
-
-						.video_view_img {
-							height: 25px;
-							width: 25px;
-							margin: 24rpx 0 0 25rpx;
-						}
-					}
-
-					.video_view_txt {
-						color: #fff;
-						font-size: 14px;
-						line-height: 30px;
-						text-align: center;
-					}
-				}
-
-				// 语音通话
-				.video_imgList2 {
-					.video_view {
-						background: rgba(0, 0, 0, .5);
-						border-radius: 50px;
-						width: 50px;
-						height: 50px;
-						margin: 0 0 0 30rpx;
-
-						.video_view_img {
-							height: 25px;
-							width: 25px;
-							margin: 24rpx 0 0 25rpx;
-						}
-					}
-
-					.video_view_txt {
-						color: #fff;
-						font-size: 14px;
-						line-height: 30px;
-						text-align: center;
-					}
-				}
-			}
-		}
-	}
-</style>

+ 283 - 122
MingGaoApp/pages/response/video - 副本.nvue

@@ -1,41 +1,48 @@
 <template>
 	<view class="video_box" :style="'height:' +  phoneHeight + 'px'">
 		<!-- 本地预览视图 -->
-		<view class="video_me">
-			<zego-local-view :viewMode="publisherViewModeIndex"
-				style="width: 100%; flex: 1; border: 1px solid #0000; z-index: 20">
+		<view class="video_me" v-show="allUserViewObjectList.length > 0">
+			<zego-local-view v-show="videoShow" :viewMode="publisherViewModeIndex"
+				style="width: 600px; height: 400px; flex: 1; margin: 0 auto;">
 			</zego-local-view>
 		</view>
 
 		<!-- 服务器传来的预览图 -->
-		<view class="video_you">
-			<zego-remote-view :viewMode="publisherViewModeIndex"
-				style="height: 403.84rpx;flex: 1; border: 1px solid #0000;">
+		<view class="video_you" v-for="(item, index) in allUserViewObjectList" :key="item.streamID">
+		<!-- <view class="video_you"> -->
+			<zego-remote-view v-if="item.streamID" :streamID="item.streamID" :viewMode="item.viewMode"
+				style="width: 600px; height: 400px; flex: 1;">
 			</zego-remote-view>
 		</view>
 
 		<view class="video_btn">
 			<view class="video_imgList">
 				<view class="video_imgList1">
-					<view class="video_view">
-						<image src="../../static/image/9.png" mode=""></image>
+					<view class="video_view" @click="turn">
+						<image class="video_view_img" src="../../static/image/9.png" mode=""></image>
 					</view>
-					<view class="">翻转镜头</view>
+					<text class="video_view_txt">翻转镜头</text>
 				</view>
-				<view class="video_imgList2">
-					<view class="video_view">
-						<image src="../../static/image/8.png" mode=""></image>
+				<view class="video_imgList2" v-if="CameraShow">
+					<view class="video_view" @click="closeCamera">
+						<image class="video_view_img" src="../../static/image/11.png" mode=""></image>
 					</view>
-					<view class="">切换语音通话</view>
+					<text class="video_view_txt" style="margin: 0 0 0 30rpx;">静音</text>
+				</view>
+
+				<view class="video_imgList2" v-else>
+					<view class="video_view" @click="openCamera">
+						<image class="video_view_img" src="../../static/image/12.png" mode=""></image>
+					</view>
+					<text class="video_view_txt" style="margin: 0 0 0 30rpx;">开启</text>
 				</view>
 			</view>
 
-			<u-button type="error" @click="offVideo()" style="margin: 0 auto; border-radius: 50px; width: 50px; height: 50px;" size="mini" text="关闭">
-			</u-button>
+			<image @click="offVideo()" style="width: 50px; height: 50px; margin: 0 0 0 330rpx;"
+				src="../../static/image/10.png" mode=""></image>
 		</view>
-		
+
 		<!-- 消息提醒 -->
-		<!-- <u-toast ref="uToast" type="typeVide" :message="videoMsg"></u-toast> -->
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
@@ -59,24 +66,42 @@
 		data() {
 			return {
 				phoneHeight: '', // 获取当前的屏幕高度
-				
+
 				// 即构
 				publisherViewModeIndex: 0, // 本地预览图
+				viewModeA: 0, // 服务器预览图
+				serveViewModeIndex: "", // 服务器拉流预览图
 				engine: undefined,
 				videoObj: null,
 				userid: "Uni" + Math.floor(Math.random() * 1000000).toString(),
 				isPublishingStream: false,
-				
-				// 消息提醒
-				// typeVide: '',
-				// videoMsg: "",
+				shotShow: false, // 翻转镜头
+				videoShow: false, // 切换视频显示
+
+				allStreamList: [],
+				allUserViewObjectList: [],
+
+				CameraShow: true, // 镜头开启关闭
 			}
 		},
 		components: {
 			ZegoLocalView: ZegoLocalView,
 			ZegoRemoteView: ZegoRemoteView
 		},
-		
+
+		watch: {
+			allUserViewObjectList(val) {
+				if (val.length > 0) {
+					val.forEach((item) => {
+						if (item.streamID) {
+							this.tensile(item)
+							return true
+						}
+					})
+				}
+			}
+		},
+
 		methods: {
 			// 即构 - 视频通话 初始化
 			async setup() {
@@ -88,7 +113,7 @@
 					scenario: ZegoScenario.General
 				}
 				this.engine = await ZegoExpressEngine.createEngineWithProfile(profile);
-				this.engine.useFrontCamera(false); // 设置前后摄像头
+				this.engine.useFrontCamera(this.shotShow); // 设置前后摄像头
 				// console.log(this.engine)
 				this.addListeners();
 				// console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' + that.videoObj.room_id)
@@ -99,89 +124,227 @@
 					isUserStatusNotify: true
 				});
 			},
-			
+
+			// 即构 - 翻转镜头
+			turn() {
+				this.shotShow = !this.shotShow
+				this.engine.useFrontCamera(this.shotShow)
+			},
+
+			// 即构 - 关闭镜头 - 停止拉流 、推流
+			closeCamera() {
+				console.log('关闭摄像头')
+				this.allStreamList.forEach((item) => {
+					// this.notTensile(item.streamID); // 停止拉流
+					item.muteAudio = !item.muteAudio;
+					this.engine.mutePlayStreamAudio(item.streamID, item.muteAudio);
+				})
+				// // 停止推流
+				// this.engine.stopPreview();
+				// this.engine.stopPublishingStream();
+				this.CameraShow = false
+			},
+			// 即构 - 开启镜头 - 开启拉流、推流
+			openCamera() {
+				console.log('开启摄像头')
+				this.allStreamList.forEach((item) => {
+					// this.engine.startPlayingStream(item.streamID); // 开始拉流
+					item.muteAudio = !item.muteAudio;
+					this.engine.mutePlayStreamAudio(item.streamID, item.muteAudio);
+				})
+				// // 开始推流
+				// this.engine.startPreview();
+				// this.engine.startPublishingStream(this.videoObj.room_id);
+				this.CameraShow = true
+			},
+
+			// 切换视频显示
+			changeShow() {
+				this.videoShow = !this.videoShow
+				// this.onPublish()
+				this.engine.startPreview();
+				this.engine.startPublishingStream(this.videoObj.room_id);
+				this.publishBtnName = "Stop Publishing";
+				console.log(this.videoShow)
+			},
+
 			// 即构 - 视频通话 监听房间
 			addListeners() {
+				console.log('开始监听房间了啊')
+				// console.log(this.allStreamList, '------------------')
+
 				// 房间状态变化通知
 				this.engine.on("roomStateUpdate", (roomID, state, errorCode, extendedData) => {
-					console.log('房间状态变化')
+					// console.log('房间状态变化')
+					if (state == "CONNECTED") {
+						// 与房间连接成功,只有当房间状态是连接成功时,才能进行推流、拉流等操作。
+						// 接下来的“预览并推流”的代码写在这里
+						console.log("房间连接成功");
+					}
+					if (state == "DISCONNECTED") {
+						// 与房间断开了连接
+						console.log("与房间断开连接");
+					}
+
+					if (state == "CONNECTING") {
+						// 与房间尝试连接中
+						console.log("与房间尝试连接中");
+					}
 				});
-			
+
 				// 房间用户变化通知
 				this.engine.on("roomUserUpdate", (roomID, updateType, userList) => {
-					console.log('房间用户变化通知')
 					console.log(updateType)
 					console.log(userList)
+					console.log("有其他用户进出房间");
+					if (updateType == ZegoUpdateType.Add) {
+						console.log('进入了啊AAAAAAAAAA')
+						for (let user of userList) {
+							for (let stream of this.allStreamList) {
+								if (user.userID == stream.user.userID) {
+									user.streamID = stream.streamID;
+								}
+							}
+							this.allUserViewObjectList.push(user);
+						}
+					} else if (updateType == ZegoUpdateType.Delete) {
+						this.allUserViewObjectList = this.allUserViewObjectList.filter((object) => {
+							for (let user of userList) {
+								if (user.userID == object.userID) {
+									return false;
+								}
+							}
+							return true;
+						});
+					}
+
+					if (updateType == "1") {
+						// 有其他用户退出房间
+						this.offVideo()
+					}
 				});
-			
+
 				// 房间内其他用户推的流变化通知
 				this.engine.on("roomStreamUpdate", (roomID, updateType, streamList) => {
-					console.log('房间内其他用户推的流变化通知')
-				});
-			
-				// 房间内在线用户数量回调
-				this.engine.on("roomOnlineUserCountUpdate", (roomID, count) => {
-					console.log(roomID)	
-					console.log(count)
-					console.log('>?>>>>>>>>>>>>>>>>>>>>>>>在线用户有变化')
+					// if (updateType == "0") {
+					// 	// 流新增,开始拉流
+					// 	this.tensile(streamList[0].streamID)
+					// } else if (updateType == "1") {
+					// 	// 流删除,停止拉流
+					// 	this.notTensile(streamList[0].streamID);
+					// }
+					console.log('进入了啊BBBBBBBBBBBBBBBBBBBBBBB')
+					console.log('---------updateType-----------', updateType)
+					console.log('---------streamList-----------', streamList)
+					console.log('---------ZegoUpdateType-----------', ZegoUpdateType)
+					console.log('---------ZegoUpdateType.Add-----------', ZegoUpdateType.Add)
+					console.log('---------ZegoUpdateType.Delete-----------', ZegoUpdateType.Delete)
+					console.log('---------allUserViewObjectList-----------', this.allUserViewObjectList)
+
+					if (updateType == ZegoUpdateType.Add) {
+						for (let object of this.allUserViewObjectList) {
+							for (let stream of streamList) {
+								if (object.userID == stream.user.userID) {
+									object.streamID = stream.streamID;
+								}
+							}
+						}
+						this.allStreamList = this.allStreamList.concat(streamList);
+						console.log(this.allStreamList, '-------------')
+					} else if (updateType == ZegoUpdateType.Delete) {
+						for (let object of this.allUserViewObjectList) {
+							for (let stream of streamList) {
+								if (object.streamID == stream.streamID) {
+									object.streamID = undefined;
+								}
+							}
+						}
+						this.allStreamList = this.allStreamList.filter((object) => {
+							for (let stream of streamList) {
+								if (object.streamID == stream.streamID) {
+									return false;
+								}
+							}
+							return true;
+						});
+					}
 				});
-			
+
 				// 拉流质量回调
 				this.engine.on("playerQualityUpdate", (streamID, quality) => {
 					console.log('拉流质量回调')
 				});
-			
-				// 推流质量回调
-				this.engine.on("publisherQualityUpdate", (streamID, quality) => {
-					console.log('推流质量回调')
-				});
-			
-				// 采集视频大小变更回调
-				this.engine.on("publisherVideoSizeChanged", (width, height, channel) => {
-					console.log('采集视频大小变更回调')
-				});
-			
-				// 拉流分辨率变更通知
-				this.engine.on("playerVideoSizeChanged", (streamID, width, height) => {
-					console.log('拉流分辨率变更通知')
-				});
+
+				// 拉流后的事件回调
+				this.engine.on("playerStateUpdate", (streamID, state, errorCode, extendedData) => {
+					console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' + '拉流后的事件触发了')
+				})
+			},
+
+			tensile(item) {
+				console.log(this.allStreamList)
+				console.log(item)
+				console.log(this.allUserViewObjectList)
+				this.engine.startPlayingStream(item.streamID)
 			},
-			
+
+			// 停止拉流
+			notTensile(roomId) {
+				this.serveViewModeIndex = roomId
+				this.engine.stopPlayingStream(roomId)
+			},
+
 			// 推流 - 展示视图 - 本地视频流
 			onPublish() {
-				// 设置视频配置
-				ZegoExpressEngine.instance().setVideoConfig(this.videoObj.room_id);
-				
 				if (this.isPublishingStream) {
+					// 停止推流
 					this.engine.stopPreview();
 					this.engine.stopPublishingStream();
-					this.publishBtnName = "Start Publishing";
 				} else {
+					console.log('开始推流了啊', this.isPublishingStream)
+					// 开始推流
 					this.engine.startPreview();
 					this.engine.startPublishingStream(this.videoObj.room_id);
-					this.publishBtnName = "Stop Publishing";
+					this.videoShow = true
 				}
 				this.isPublishingStream = !this.isPublishingStream;
 			},
-		
+
 			// 挂断退出
-			offVideo() {
-				this.engine.logoutRoom(this.videoObj.room_id)
-				this.$refs.uToast.show({
+			async offVideo() {
+				console.log('进入了啊')
+				var that = this
+				that.engine.logoutRoom(that.videoObj.room_id); // 退出房间
+				that.$refs.uToast.show({
 					type: 'default',
 					message: '结束视频通话!',
-					url: '/pages/response/index',
 				})
-				// uni.navigateTo({
+				setTimeout(() => {
+					that.videoShow = true
+					that.allStreamList = [];
+					that.allUserViewObjectList = [];
+					uni.navigateBack({
+						delta: 1
+					})
+				}, 1500)
+				// uni.redirectTo({
 				// 	url: "/pages/response/index"
 				// })
+
+			},
+
+
+			// 删除this.engine对象, 删除即构
+			async destroyEngine() {
+				this.engine = undefined;
+				ZegoExpressEngine.destroyEngine();
 			},
 		},
 
 		async onLoad(optinos) {
 			var that = this
-			// that.videoObj = JSON.parse(optinos.videoObj)
-			// console.log(that.videoObj)
+			that.videoObj = JSON.parse(optinos.videoObj)
+			console.log(that.videoObj)
 			// 即构 - 视频通话
 			// 获取系统信息同步接口
 			if (uni.getSystemInfoSync().platform === 'android') {
@@ -197,112 +360,110 @@
 				}
 			});
 		},
-		
+		async onShow() {
+			// await this.setup();
+		},
+
 		// 监听页面返回
 		onBackPress() {
 			console.log('返回了!')
+			this.offVideo(); // 挂断退出
+			this.destroyEngine(); // 删除this.engine对象,删除即构
+		},
+
+		// 页面卸载 - 生命周期
+		onUnload() {
+			this.destroyEngine();
+			console.log('onUnload');
 		},
 	}
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss">
 	.video_box {
-		// height: 1667px;
-		// border: 1px solid red;
-		// 视频通话
-		.video_you {
-			background: #fff;
-			position: relative;
-			// border: 1px solid #000;
-			width: 400px;
-			height: 840px;
-			overflow: hidden;
-		}
+		background: #000;
+		width: 1200rpx;
+		position: relative;
 
+		// .video_you {
 		.video_me {
-			// border: 1px solid #000;
+			// background: #f00;
+			width: 600px;
+			height: 400px;
+			position: absolute;
+			right: 100rpx;
+			top: 400px;
+			flex: 1;
+			// overflow: hidden;
+			// z-index: 210;
+		}
+
+		.video_you {
 			// z-index: 100;
-			background: #fff;
-			// width: 200rpx;
-			// height: 300rpx;
-			width: 200px;
-			height: 300px;
+			// background: #ff0;
+			width: 600px;
+			height: 400px;
 			position: absolute;
-			right: 10px;
-			top: 10px;
+			right: 100rpx;
+			top: 0;
 		}
 
 		.video_btn {
-			border: 1px solid #fff;
 			position: absolute;
 			bottom: 35rpx;
 			left: 0;
-			// width: 100%;
-			width: 400px;
+			width: 750rpx;
 
 			.video_imgList {
-				// display: flex;
-				// justify-content: space-evenly;
-				/* #ifndef APP-NVUE */
 				display: flex;
 				flex-direction: row;
-				justify-content: space-evenly;
-				//建议:在用到该属性或者你觉得可以不加时不管水平还是垂直,均最好加上,方便后期编译到不同平台减少后期修改布局样式造成的差异
-
+				justify-content: space-around;
 
+				// 翻转
 				.video_imgList1 {
-
-					// border: 1px solid;
-					// background: rgba(0, 0, 0, .5);
 					.video_view {
 						background: rgba(0, 0, 0, .5);
-						border: 1px solid;
 						border-radius: 50px;
 						width: 50px;
 						height: 50px;
 						margin: 0 auto;
 
-						image {
-							// width: 50rpx;
-							// height: 50rpx;
-							height: 30px;
-							width: 30px;
+						.video_view_img {
+							height: 25px;
+							width: 25px;
 							margin: 24rpx 0 0 25rpx;
 						}
 					}
 
-					view {
-						line-height: 30px;
+					.video_view_txt {
 						color: #fff;
-						font-size: 20rpx;
+						font-size: 14px;
+						line-height: 30px;
+						text-align: center;
 					}
 				}
 
+				// 语音通话
 				.video_imgList2 {
-
-					// border: 1px solid;
-					// background: rgba(0, 0, 0, .5);
 					.video_view {
-						border: 1px solid;
 						background: rgba(0, 0, 0, .5);
-						margin: 0 auto;
 						border-radius: 50px;
 						width: 50px;
 						height: 50px;
+						margin: 0 0 0 30rpx;
 
-						image {
-							// width: 50rpx;
-							// height: 50rpx;
-							width: 50px;
-							height: 50px;
+						.video_view_img {
+							height: 25px;
+							width: 25px;
 							margin: 24rpx 0 0 25rpx;
 						}
 					}
 
-					view {
-						line-height: 30px;
+					.video_view_txt {
 						color: #fff;
-						font-size: 20rpx;
+						font-size: 14px;
+						line-height: 30px;
+						text-align: center;
 					}
 				}
 			}

+ 77 - 70
MingGaoApp/pages/response/video.nvue

@@ -1,27 +1,19 @@
 <template>
 	<view class="video_box" :style="'height:' +  phoneHeight + 'px'">
 		<!-- 本地预览视图 -->
-		<view class="video_me" v-if="allUserViewObjectList.length > 0" v-for="(item, index) in allUserViewObjectList" :key="item.userID" :style="'height:' +  phoneHeight + 'px'">
-			<!-- <zego-local-view v-if="videoShow" :viewMode="publisherViewModeIndex"
-				style="width: 100%; flex: 1; border: 1px solid #0000; z-index: 20">
-			</zego-local-view> -->
-			
-			<!-- 服务器拉流的视图 -->
-			<zego-remote-view v-if="item.streamID" :streamID="item.streamID" :viewMode="item.viewMode"
-				style="width: 100%; flex: 1; border: 1px solid #0000; z-index: 20">
-			</zego-remote-view>
+		<view class="video_me" v-show="allUserViewObjectList.length > 0">
+		<!-- <view class="video_me" v-if="videoShow"> -->
+			<zego-local-view :viewMode="publisherViewModeIndex"
+				style="width: 150px; height: 200px; flex: 1; position: fixed; right: 0; top: 65px;">
+			</zego-local-view>
 		</view>
 
 		<!-- 服务器传来的预览图 -->
-		<view class="video_you" v-if="allUserViewObjectList.length > 0">
-			<!-- <zego-remote-view v-if="item.streamID" :streamID="item.streamID" :viewMode="item.viewMode"
-				style="height: 403.84rpx; flex: 1;">
-			</zego-remote-view> -->
-			
-			<!-- 本地视图 -->
-			<zego-local-view v-if="videoShow" :viewMode="publisherViewModeIndex"
-				style="height: 403.84rpx; flex: 1; z-index: 200">
-			</zego-local-view>
+		<view class="video_you" v-for="(item, index) in allUserViewObjectList" :key="item.streamID">
+		<!-- <view class="video_you"> -->
+			<zego-remote-view v-if="item.streamID" :streamID="item.streamID" :viewMode="item.viewMode"
+				style="width: 620px; height: 600px; flex: 1;">
+			</zego-remote-view>
 		</view>
 
 		<view class="video_btn">
@@ -32,13 +24,14 @@
 					</view>
 					<text class="video_view_txt">翻转镜头</text>
 				</view>
+				
 				<view class="video_imgList2" v-if="CameraShow">
 					<view class="video_view" @click="closeCamera">
 						<image class="video_view_img" src="../../static/image/11.png" mode=""></image>
 					</view>
 					<text class="video_view_txt" style="margin: 0 0 0 30rpx;">静音</text>
 				</view>
-				
+
 				<view class="video_imgList2" v-else>
 					<view class="video_view" @click="openCamera">
 						<image class="video_view_img" src="../../static/image/12.png" mode=""></image>
@@ -86,10 +79,10 @@
 				isPublishingStream: false,
 				shotShow: false, // 翻转镜头
 				videoShow: false, // 切换视频显示
-				
+
 				allStreamList: [],
 				allUserViewObjectList: [],
-				
+
 				CameraShow: true, // 镜头开启关闭
 			}
 		},
@@ -97,9 +90,10 @@
 			ZegoLocalView: ZegoLocalView,
 			ZegoRemoteView: ZegoRemoteView
 		},
-		
+
 		watch: {
 			allUserViewObjectList(val) {
+				var that = this
 				if (val.length > 0) {
 					val.forEach((item) => {
 						if (item.streamID) {
@@ -107,10 +101,11 @@
 							return true
 						}
 					})
+					
 				}
 			}
 		},
-		
+
 		methods: {
 			// 即构 - 视频通话 初始化
 			async setup() {
@@ -139,18 +134,15 @@
 				this.shotShow = !this.shotShow
 				this.engine.useFrontCamera(this.shotShow)
 			},
-			
+
 			// 即构 - 关闭镜头 - 停止拉流 、推流
 			closeCamera() {
-				console.log('关闭摄像头')
 				this.allStreamList.forEach((item) => {
 					// this.notTensile(item.streamID); // 停止拉流
 					item.muteAudio = !item.muteAudio;
 					this.engine.mutePlayStreamAudio(item.streamID, item.muteAudio);
 				})
 				// // 停止推流
-				// this.engine.stopPreview();
-				// this.engine.stopPublishingStream();
 				this.CameraShow = false
 			},
 			// 即构 - 开启镜头 - 开启拉流、推流
@@ -179,6 +171,10 @@
 
 			// 即构 - 视频通话 监听房间
 			addListeners() {
+				console.log('开始监听房间了啊')
+				var that = this
+				// console.log(this.allStreamList, '------------------')
+
 				// 房间状态变化通知
 				this.engine.on("roomStateUpdate", (roomID, state, errorCode, extendedData) => {
 					// console.log('房间状态变化')
@@ -204,6 +200,7 @@
 					console.log(userList)
 					console.log("有其他用户进出房间");
 					if (updateType == ZegoUpdateType.Add) {
+						console.log('进入了啊AAAAAAAAAA')
 						for (let user of userList) {
 							for (let stream of this.allStreamList) {
 								if (user.userID == stream.user.userID) {
@@ -238,14 +235,14 @@
 					// 	// 流删除,停止拉流
 					// 	this.notTensile(streamList[0].streamID);
 					// }
-					
+					console.log('进入了啊BBBBBBBBBBBBBBBBBBBBBBB')
 					console.log('---------updateType-----------', updateType)
 					console.log('---------streamList-----------', streamList)
 					console.log('---------ZegoUpdateType-----------', ZegoUpdateType)
 					console.log('---------ZegoUpdateType.Add-----------', ZegoUpdateType.Add)
 					console.log('---------ZegoUpdateType.Delete-----------', ZegoUpdateType.Delete)
 					console.log('---------allUserViewObjectList-----------', this.allUserViewObjectList)
-					
+
 					if (updateType == ZegoUpdateType.Add) {
 						for (let object of this.allUserViewObjectList) {
 							for (let stream of streamList) {
@@ -255,6 +252,7 @@
 							}
 						}
 						this.allStreamList = this.allStreamList.concat(streamList);
+						console.log(this.allStreamList, '-------------')
 					} else if (updateType == ZegoUpdateType.Delete) {
 						for (let object of this.allUserViewObjectList) {
 							for (let stream of streamList) {
@@ -274,16 +272,15 @@
 					}
 				});
 
-				// 房间内在线用户数量回调
-				// this.engine.on("roomOnlineUserCountUpdate", (roomID, count) => {
-				// 	// console.log(roomID)	
-				// 	console.log(count)
-				// 	console.log('>?>>>>>>>>>>>>>>>>>>>>>>>在线用户有变化')
-				// });
-
 				// 拉流质量回调
 				this.engine.on("playerQualityUpdate", (streamID, quality) => {
 					console.log('拉流质量回调')
+					// if (this.videoShow == false) {
+					// 	setTimeout(() => {
+					// 		that.videoShow = true
+					// 		console.log(that.videoShow, '要打开推流的视频窗口了啊')
+					// 	}, 3500)
+					// }
 				});
 
 				// 拉流后的事件回调
@@ -292,15 +289,6 @@
 				})
 			},
 
-			// 拉流 
-			// tensile(roomId) {
-			// 	console.log('拉流进入了啊')
-			// 	console.log(roomId)
-			// 	this.serveViewModeIndex = roomId
-			// 	console.log(this.serveViewModeIndex)
-			// 	this.engine.startPlayingStream(roomId);
-			// },
-			
 			tensile(item) {
 				console.log(this.allStreamList)
 				console.log(item)
@@ -310,17 +298,12 @@
 
 			// 停止拉流
 			notTensile(roomId) {
-				// console.log(roomId)
 				this.serveViewModeIndex = roomId
-				// console.log(this.serveViewModeIndex)
 				this.engine.stopPlayingStream(roomId)
 			},
 
 			// 推流 - 展示视图 - 本地视频流
 			onPublish() {
-				// 设置视频配置
-				// ZegoExpressEngine.instance().setVideoConfig(this.videoObj.room_id);
-
 				if (this.isPublishingStream) {
 					// 停止推流
 					this.engine.stopPreview();
@@ -330,20 +313,24 @@
 					// 开始推流
 					this.engine.startPreview();
 					this.engine.startPublishingStream(this.videoObj.room_id);
-					this.videoShow = true
+					// this.videoShow = true
 				}
 				this.isPublishingStream = !this.isPublishingStream;
 			},
 
 			// 挂断退出
-			offVideo() {
+			async offVideo() {
 				console.log('进入了啊')
-				this.engine.logoutRoom(this.videoObj.room_id)
-				this.$refs.uToast.show({
+				var that = this
+				that.engine.logoutRoom(that.videoObj.room_id); // 退出房间
+				that.$refs.uToast.show({
 					type: 'default',
 					message: '结束视频通话!',
 				})
 				setTimeout(() => {
+					that.videoShow = true
+					that.allStreamList = [];
+					that.allUserViewObjectList = [];
 					uni.navigateBack({
 						delta: 1
 					})
@@ -353,14 +340,21 @@
 				// })
 
 			},
+
+
+			// 删除this.engine对象, 删除即构
+			async destroyEngine() {
+				this.engine = undefined;
+				ZegoExpressEngine.destroyEngine();
+			},
 		},
 
 		async onLoad(optinos) {
 			var that = this
 			that.videoObj = JSON.parse(optinos.videoObj)
-			// console.log(that.videoObj)
-			// 即构 - 视频通话
-			// 获取系统信息同步接口
+			// // console.log(that.videoObj)
+			// // 即构 - 视频通话
+			// // 获取系统信息同步接口
 			if (uni.getSystemInfoSync().platform === 'android') {
 				await permision.requestAndroidPermission('android.permission.RECORD_AUDIO');
 				await permision.requestAndroidPermission('android.permission.CAMERA');
@@ -374,10 +368,21 @@
 				}
 			});
 		},
+		async onShow() {
+			await this.setup();
+		},
 
 		// 监听页面返回
 		onBackPress() {
 			console.log('返回了!')
+			this.offVideo(); // 挂断退出
+			this.destroyEngine(); // 删除this.engine对象,删除即构
+		},
+
+		// 页面卸载 - 生命周期
+		onUnload() {
+			this.destroyEngine();
+			console.log('onUnload');
 		},
 	}
 </script>
@@ -385,28 +390,30 @@
 <style lang="scss">
 	.video_box {
 		background: #000;
+		width: 1200rpx;
+		position: relative;
 
-		.video_you {
-			border: 1px solid;
-			background: #fff;
+		// .video_you {
+		.video_me {
+			background: #000;
 			width: 150px;
 			height: 200px;
-			position: absolute;
-			right: 10px;
-			top: 10px;
-			overflow: hidden;
+			position: fixed;
+			right: 0;
+			top: 65px;
 		}
 
-		.video_me {
-			z-index: 100;
-			background: #000;
-			position: relative;
+		.video_you {
+			background: #ff0;
+			width: 620px;
+			height: 600px;
+			position: absolute;
 			right: 0;
-			top: 0;
+			bottom: 0;
 		}
 
 		.video_btn {
-			position: absolute;
+			position: fixed;
 			bottom: 35rpx;
 			left: 0;
 			width: 750rpx;

+ 17 - 0
MingGaoApp/pages/supervise/index.vue

@@ -65,6 +65,23 @@
 				uni.stopPullDownRefresh()
 			}, 1000)
 		},
+		watch: {
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			async gettaskdata() {
 				this.loading = true

+ 17 - 0
MingGaoApp/pages/supervise/submitsupe.vue

@@ -70,6 +70,23 @@
 		onLoad(option) {
 			this.supervise.task_id = option.id
 		},
+		watch: {
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			groupChange() {
 

+ 17 - 0
MingGaoApp/pages/supervise/supetask.vue

@@ -20,6 +20,23 @@
 				taskid:''
 			}
 		},
+		watch: {
+			videoData(news, old) {
+				console.log('触发了2222222222222222222222')
+				console.log(news)
+				uni.switchTab({
+					url: '../response/index'
+				})
+				// if (news) {
+				// }
+			},
+		},
+		computed: {
+			// 视频消息
+			videoData() {
+				return this.$store.state.video
+			},
+		},
 		methods: {
 			tosubm(){
 				uni.navigateTo({

+ 1 - 0
MingGaoApp/unpackage/debug/.roid.ins

@@ -0,0 +1 @@
+installed

BIN
MingGaoApp/unpackage/debug/android_debug.apk


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4 - 0
MingGaoApp/unpackage/dist/build/app-plus/app-config-service.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 13 - 1
MingGaoApp/unpackage/dist/build/app-plus/app-service.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 5 - 1
MingGaoApp/unpackage/dist/build/app-plus/app-view.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 5 - 1
MingGaoApp/unpackage/dist/build/app-plus/manifest.json


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 5 - 1
MingGaoApp/unpackage/dist/build/app-plus/pages/response/video.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 9 - 1
MingGaoApp/unpackage/dist/build/app-plus/view.umd.min.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 57 - 70
MingGaoApp/unpackage/dist/dev/app-plus/app-service.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 61 - 35
MingGaoApp/unpackage/dist/dev/app-plus/app-view.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
MingGaoApp/unpackage/dist/dev/app-plus/manifest.json


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 80 - 84
MingGaoApp/unpackage/dist/dev/app-plus/pages/response/video.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 9 - 1
MingGaoApp/unpackage/dist/dev/app-plus/view.umd.min.js


+ 3 - 1
MingGaoApp/util/url.js

@@ -1,6 +1,8 @@
 export default{
 	// baseUrl:"http://114.115.147.140:12345"
-	baseUrl:"http://192.168.1.17:12345"
+	// baseUrl:"https://yfznscd.com"
+	baseUrl:"https://www.toreskj.com"
+	// baseUrl:"http://192.168.1.17:12345"
 	// baseUrl:"http://192.168.1.77:12345"
 	// baseUrl:"https://www.toreskj.com"
 }