From f46786f11c5c08ead7501a82e5a71430ad69b782 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期日, 27 四月 2025 17:39:24 +0800 Subject: [PATCH] 修复线索问题定位错误问题 --- pages/cluetask/home/index.js | 35 +++++++++++++++++++++++++++-------- 1 files changed, 27 insertions(+), 8 deletions(-) diff --git a/pages/cluetask/home/index.js b/pages/cluetask/home/index.js index 7af513c..b148dff 100644 --- a/pages/cluetask/home/index.js +++ b/pages/cluetask/home/index.js @@ -1,9 +1,9 @@ +import dayjs from 'dayjs'; + import { useLoading } from '../../../behaviors/loading'; import { useOptions } from './options-proxy.js'; import { useStatistic } from './statistic-proxy.js'; import { useTasks } from './tasks-proxy.js'; - -import clueApi from '../../../services/clue/fetchClue'; const app = getApp(); @@ -18,7 +18,10 @@ onLoad(options) {}, onShow() { - this.getTabBar().init(); + if (this.getTabBar()) { + this.getTabBar().init(); + } + // this.refresh(); }, onPullDownRefresh() { @@ -38,14 +41,30 @@ optionsCount: 0, init() { this.optionsCount++; - if (this.optionsCount == 2) this._startLoad(); + this.refresh(); + }, + + refresh() { + if (this.optionsCount >= 2) this._startLoad(); }, _fetchData(page) { - return clueApi.fetchClueTask({}).then(res => { - this.setData({ clueTaskList: res.data }); - this.calClueCount(); - this.formatClueTask(); + const array = []; + array.push(this.searchClueTask(page)); + if (page == 1) { + array.push(this.fetchClueTaskSummary(page)); + } + return Promise.all(array).then(res => { + return res[0].head; }); }, + + _getOptions() { + const { location, time } = this.data; + return { + ...location, + startTime: dayjs(time).startOf('month').format('YYYY-MM-DD HH:mm:ss'), + endTime: dayjs(time).endOf('month').format('YYYY-MM-DD HH:mm:ss'), + }; + }, }); -- Gitblit v1.9.3