diff --git a/weapp/package/polling/polling.js b/weapp/package/polling/polling.js index aa4d6c9..c1459de 100644 --- a/weapp/package/polling/polling.js +++ b/weapp/package/polling/polling.js @@ -235,14 +235,26 @@ Page({ */ onPullDownRefresh() { let that = this; - that.setData({ - dataList: [], - page: 0, //当前页 - count: '', //总条数 - }) - that.getPatrolPlan() - // 手动控制回弹 - wx.stopPullDownRefresh(); + if (that.data.currentTab == '0') { + that.setData({ + dataList: [], + page: 0, //当前页 + count: '', //总条数 + }) + that.getPatrolPlan() + // 手动控制回弹 + wx.stopPullDownRefresh(); + } else if (that.data.currentTab == '1') { + that.setData({ + recordDataList: [], + ResIndex: 0, //巡检结果 + startTime: "开始日期", //开始日期 + endTime: "结束日期", //结束日期 + }) + that.getPatrolRecord() + // 手动控制回弹 + wx.stopPullDownRefresh(); + } }, /** @@ -264,16 +276,6 @@ Page({ page: page, //更新当前页数 }) _that.getPatrolPlan() - } else if (_that.data.currentTab == '1') { - _that.setData({ - recordDataList: [], - ResIndex: 0, //巡检结果 - startTime: "开始日期", //开始日期 - endTime: "结束日期", //结束日期 - }) - _that.getPatrolRecord() - // 手动控制回弹 - wx.stopPullDownRefresh(); } },