wangxy 3 hete
szülő
commit
3ad7abf14f
1 módosított fájl, 24 hozzáadás és 2 törlés
  1. 24 2
      pages/client/Kaoshi/exam.vue

+ 24 - 2
pages/client/Kaoshi/exam.vue

@@ -145,6 +145,26 @@
 		init: qiepingInit
 	} = useQiePing();
 
+  function debounce(func, wait) {
+    let timeout;
+    return function (...args) {
+      const context = this;
+      clearTimeout(timeout);
+      timeout = setTimeout(() => {
+        func.apply(context, args);
+      }, wait);
+    };
+  }
+  const handleBack = debounce(() => {
+    console.log('back')
+    const pages = getCurrentPages();
+    if (pages.length > 1) {
+      uni.navigateBack()
+    } else {
+      history.back();
+    }
+  },1000)
+
 	onLoad((option) => {
 		data.ksId = option.ksId;
 		data.zhuapai = option.zhuapai;
@@ -507,14 +527,16 @@
 
 	}
 
-  function handleBack () {
+
+
+  /*function handleBack () {
     const pages = getCurrentPages();
     if (pages.length > 1) {
       uni.navigateBack()
     } else {
       history.back();
     }
-  }
+  }*/
 
 	function showAnswerCard() {
 		popupRef.value.open('top')