wangxy 3 týždňov pred
rodič
commit
816b3dd86d
1 zmenil súbory, kde vykonal 6 pridanie a 1 odobranie
  1. 6 1
      components/zhuapaiConfirm/zhuapai.vue

+ 6 - 1
components/zhuapaiConfirm/zhuapai.vue

@@ -84,6 +84,7 @@
 	const emits = defineEmits(['init', 'success', 'error', 'cancel', 'progress'])
 
 	let timer1 = null;
+	let timer2 = null;
 
 	function noShowVideoBtn() {
 		showVideo.value = false
@@ -148,7 +149,7 @@
 				startCamera()
 				// 设定计时器
 				console.log('抓拍设定', zhuapai.value)
-				setInterval(() => {
+				timer2 = setInterval(() => {
 					handleZhua()
 				}, zhuapai.value * 60 * 1000)
 			})
@@ -431,6 +432,10 @@
 			clearTimeout(stopTimer.value);
 			stopTimer.value = null;
 		}
+		if (timer2) {
+			clearTimeout(timer2);
+			timer2 = null;
+		}
 	})
 
 	defineExpose({