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 | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/base/behaviors/b_loadingStatus.js b/base/behaviors/b_loadingStatus.js
index 086f1da..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({
--
Gitblit v1.9.3