Преглед изворни кода

孙一石 增加 售后订单状态

sys5923812@126.com пре 4 дана
родитељ
комит
4914b36c66
1 измењених фајлова са 16 додато и 1 уклоњено
  1. 16 1
      src/utils/timeout_utils.js

+ 16 - 1
src/utils/timeout_utils.js

@@ -5,5 +5,20 @@ let time1 = null;
 let time2 = null;
 
 function checktime() {
-
+  let currentTime = new Date();
+  if(time1 == null){
+    time1 = currentTime
+    return true
+  }
+  if(time2 != null){
+    time1 = time2
+  }
+  time2 = currentTime
+  let mu = time2-time1;
+  if(mu < 2000){
+    alert("请务连续点击")
+    return false
+  }
+  return true
 }
+