| | |
| | | /** |
| | | * 数据加载监听 |
| | | * 数据加载状态监听 |
| | | * @see './b_loadingToast.js' 和 '../../component/loadingstatus' |
| | | */ |
| | | module.exports = Behavior({ |
| | | data: { |
| | | cPage: 1, |
| | | tPage: 1, |
| | | perPage: 10, |
| | | totalCount: 0, |
| | | loading: false, |
| | | needLoadMore: false |
| | |
| | | if (loading) { |
| | | this._loadStart() |
| | | this._loading() |
| | | setTimeout(() => { this.setData({loading: false}) }, 20000); |
| | | } else { |
| | | this._loadComplete() |
| | | } |
| | |
| | | }, |
| | | methods: { |
| | | _onReachBottom() { |
| | | console.log('_onReachBottom'); |
| | | // console.log('_onReachBottom'); |
| | | let {cPage, tPage, loading} = this.data |
| | | if (!loading && cPage < tPage) { |
| | | if (typeof this.loadmore === 'function') { |
| | |
| | | if (typeof this.loadComplete === 'function') { |
| | | this.loadComplete() |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }) |