| | |
| | | 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() |
| | | setTimeout(() => { this.setData({loading: false}) }, 20000); |
| | | 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({ |