wangxy před 1 týdnem
rodič
revize
9c3899e4b0

+ 3 - 2
pages/admin/Hetong/Hetong.vue

@@ -81,7 +81,8 @@
 
   const  handleQM = throttleAdvanced((img) => {
     uni.showToast({
-      title: "签名提交中..."
+      title: "签名提交中...",
+      mask: true,
     })
 
     httpApi.getHetongQianming({
@@ -99,7 +100,7 @@
         })
       }
     })
-  }, 5000)
+  })
 
 	function getBase64(img) {
 		if (!img) {

+ 3 - 1
pages/admin/Hetong/HetongInfo.vue

@@ -67,7 +67,8 @@ function goUpPage() {
 
 const  handleQM = throttleAdvanced((img) => {
   uni.showToast({
-    title: "签名提交中..."
+    title: "签名提交中...",
+    mask: true,
   })
 
   httpApi.getHetongQianming({
@@ -94,6 +95,7 @@ function getBase64(img) {
 		})
 		return;
 	}
+  console.log(22222)
   handleQM(img)
 
 }

+ 6 - 2
pages/admin/Hetong/HetongList.vue

@@ -45,10 +45,11 @@ const data = reactive({
 	
 onLoad((options) => {
 		data.from = options.from;
+		
 	})
 
 onShow(() => {
-	getMore()
+  refreshData()
 })
 
 function onRefresh() {
@@ -68,9 +69,12 @@ function refreshData() {
 	data.state = 'loading';
 	data.page++;
 	opt.page = data.page;
+	
+	    console.log('列表',opt)
+	
 	getHetongList(opt).then(res => {
 
-    console.log('列表',res.data)
+
 
 		data.list = data.list.concat(res.data.data);
 		data.loading = false;

+ 11 - 8
utils/common.js

@@ -171,16 +171,19 @@ export function jsonp2(url, params, callbackName = 'jsonp_callback') {
 }
 
 
-export function throttleAdvanced(fn, delay) {
+export function throttleAdvanced(func, delay = 5000) {
     let lastExecTime = 0; // 记录上次成功执行的时间戳
-    return function(...args) { // 使用剩余参数接收所有传入参数
-        const now = Date.now(); // 获取当前时间戳
-        // 如果当前时间减去上次执行时间大于等于设定的延迟,则执行函数
-        if (now - lastExecTime >= delay) {
-            // 使用 apply 确保函数内部的 this 指向正确,并传递参数
-            fn.apply(this, args);
+
+    return function(...args) {
+        const currentTime = Date.now(); // 获取当前时间戳
+
+        // 如果当前时间距离上次执行时间已经超过了设定的延迟时间
+        if (currentTime - lastExecTime >= delay) {
+            // 使用 apply 确保函数上下文和参数正确传递
+            console.log(11111)
+            func.apply(this, args);
             // 更新最后一次执行的时间戳为当前时间
-            lastExecTime = now;
+            lastExecTime = currentTime;
         }
         // 如果时间间隔未到,则什么都不做,忽略此次调用
     };