import { useLoading } from '../../../behaviors/loading'; import { useOptions } from './options-proxy.js'; import { useStatistic } from './statistic-proxy.js'; import { useTasks } from './tasks-proxy.js'; import { fetchClueTask } from '../../../services/clue/fetchClue'; const app = getApp(); Page({ behaviors: [useLoading, useOptions, useStatistic, useTasks], data: { userInfo: app.globalData.userInfo, clueTaskList: [], }, onLoad(options) {}, onShow() { if (this.getTabBar()) { this.getTabBar().init(); } this.refresh(); }, onPullDownRefresh() { this._startLoad(); }, onReachBottom() { this._loadMore(); }, /** * 初始加载 * 当所有筛选条件都获取到初始值后,执行一次初始化加载 * 包括区域、时间两个选项,全部获取初始值后,执行加载 * @see options-proxy.js */ optionsCount: 0, init() { this.optionsCount++; this.refresh(); }, refresh() { this._startLoad(); }, _fetchData(page) { return fetchClueTask({}).then(res => { this.setData({ clueTaskList: res.data }); this.calClueCount(); this.formatClueTask(); }); }, });