riku
2025-04-25 b515fae43490ab20977d559e19d4e5f63a4fd96d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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();
    });
  },
});