浏览代码

调整页面

wangxy 3 周之前
父节点
当前提交
fc370a7500
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10 3
      components/zhuapaiConfirm/zhuapai.vue

+ 10 - 3
components/zhuapaiConfirm/zhuapai.vue

@@ -73,6 +73,8 @@
 
 	const emits = defineEmits(['init', 'success', 'error', 'cancel', 'progress'])
 
+  let timer1 = null;
+
 	function noShowVideoBtn() {
 		showVideo.value = false
 	}
@@ -240,10 +242,10 @@
 	}
 
 	function onVideoSuccess() {
-		setTimeout(() => {
+/*		setTimeout(() => {
 			// 首次运行进行抓拍一次
 			handleZhua();
-		}, 3000);
+		}, 3000);*/
 	}
 
 	function onVideoError() {
@@ -280,7 +282,7 @@
 		isBuffer.value = true;
 		console.log('onProgress')
 		// buffer时间增大到3秒 过滤掉后续的onTimeupdate
-		setTimeout(() => {isBuffer.value = false}, 3000)
+    timer1 = setTimeout(() => {isBuffer.value = false}, 3000)
 		// 视频中途暂停被占用
 		stopTimer.value = setTimeout(() => {
 			emits('progress', false);
@@ -402,6 +404,11 @@
 
   onUnmounted(() => {
     stopFrameListener()
+
+    if (timer1) {
+      clearTimeout(timer1);
+      timer1 = null;
+    }
   })
 
 	defineExpose({