riku
2025-04-17 ec7f5ba1f7eb84507e1c8e7b6f66b1ecfbc22728
pages/inspection/ranking/index.js
@@ -10,13 +10,7 @@
Page({
  behaviors: [useLoading, useProblemChangeList, useStatistic, useSortOptions],
  data: {
    // summaryList: [],
    // sort: '',
    // sortBy: 'pro',
    // statistic: {
    //   proNum: 0,
    //   changeNum: 0,
    // },
    placeholder: '输入关键字搜索场景',
  },
  onLoad(options) {
@@ -51,43 +45,6 @@
    });
  },
  // fetchSceneProSummary(params, page) {
  //   const params = _getParamsArea(this.data);
  //   return fetchSceneProSummary({ area: params, page }).then(res => {
  //     if (res.success) {
  //       this.setData({
  //         summaryList: page == 1 ? res.data : this.data.summaryList.concat(res.data),
  //       });
  //     } else {
  //       this.setData({
  //         summaryList: [],
  //       });
  //     }
  //     return res.head;
  //   });
  // },
  // fetchProblems(params, page) {
  //   const params = _getParamsArea(this.data);
  //   return fetchProblemsStatistic(params).then(res => {
  //     let proNum = 0,
  //       changeNum = 0,
  //       changePer = 0;
  //     res.data.forEach(r => {
  //       proNum += r.count;
  //       changeNum += r.changeCount;
  //     });
  //     if (proNum > 0) {
  //       changePer = Math.round((changeNum / proNum) * 1000) / 10;
  //       changePer += '%';
  //     }
  //     this.setData({
  //       statistic: { proNum, changeNum, changePer },
  //     });
  //     return res.head;
  //   });
  // },
  onTimePickerConfirm(e) {
    const { timeValue } = e.detail;
    this.setData({
@@ -115,29 +72,24 @@
    this._startLoad();
  },
  onSortChange(e) {
    const { sorts } = e.detail;
    const { type } = e.currentTarget.dataset;
    this.setData({
      sort: sorts,
      sortBy: type,
      proSort: type == 'pro' ? sorts : 'default',
      changeSort: type == 'changePer' ? sorts : 'default',
    });
    this._startLoad();
  },
  // navToDetail(e) {
  //   const { index } = e.currentTarget.dataset;
  //   const summary = this.data.summaryList[index];
  //   wx.navigateTo({
  //     url: '/pages/inspection/detail/index',
  //     success: result => {
  //       result.eventChannel.emit('acceptInspectionDetailData', {
  //         scene: summary.scene,
  //         time: this.data.time,
  //       });
  //     },
  // onSortChange(e) {
  //   const { sorts } = e.detail;
  //   const { type } = e.currentTarget.dataset;
  //   this.setData({
  //     sort: sorts,
  //     sortBy: type,
  //     proSort: type == 'pro' ? sorts : 'default',
  //     changeSort: type == 'changePer' ? sorts : 'default',
  //   });
  //   this._startLoad();
  // },
  navToSearchPage() {
    wx.navigateTo({
      url: '/pages/inspection/ranking/search/index',
      success: result => {},
      fail: res => {},
      complete: res => {},
    });
  },
});