From eb7366f400867d3f401fe60f06d848d6d1448457 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 17 十月 2022 17:41:56 +0800
Subject: [PATCH] 2022.10.17

---
 base/behaviors/b_loadingStatus.js |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/base/behaviors/b_loadingStatus.js b/base/behaviors/b_loadingStatus.js
index d96ae21..ec08a60 100644
--- a/base/behaviors/b_loadingStatus.js
+++ b/base/behaviors/b_loadingStatus.js
@@ -1,5 +1,6 @@
 /**
- * 鏁版嵁鍔犺浇鐩戝惉
+ * 鏁版嵁鍔犺浇鐘舵�佺洃鍚�
+ * @see './b_loadingToast.js' 鍜� '../../component/loadingstatus'
  */
 module.exports = Behavior({
   data: {
@@ -8,16 +9,29 @@
     perPage: 10,
     totalCount: 0,
     loading: false,
-    needLoadMore: false
+    needLoadMore: false,
+    timeout: false
   },
+  timeoutId: '',
+  lastLoading: false,
   observers: {
     'loading': function (loading) {
+      if (this.lastLoading == loading) return
       if (loading) {
+        clearTimeout(this.timeoutId)
         this._loadStart()
         this._loading()
+        this.timeoutId = setTimeout(() => { 
+          this.setData({
+            loading: false,
+            timeout: true
+          })
+        }, 10000);
       } else {
+        clearTimeout(this.timeoutId)
         this._loadComplete()
       }
+      this.lastLoading = loading
     },
     'cPage, tPage': function (cPage, tPage) {
       this.setData({
@@ -32,7 +46,7 @@
   },
   methods: {
     _onReachBottom() {
-      console.log('_onReachBottom');
+      // console.log('_onReachBottom');
       let {cPage, tPage, loading} = this.data
       if (!loading && cPage < tPage) {
         if (typeof this.loadmore === 'function') {

--
Gitblit v1.9.3