Commit 58704443 by luyt

fix:处理分页逻辑

1 parent fdd555d7
...@@ -533,7 +533,8 @@ Page({ ...@@ -533,7 +533,8 @@ Page({
item.selectIndex = 2 item.selectIndex = 2
}) })
this.setData({ this.setData({
typeList typeList,
clueParams:{}
}) })
//重置数据 //重置数据
this.clearclueData() this.clearclueData()
...@@ -544,25 +545,8 @@ Page({ ...@@ -544,25 +545,8 @@ Page({
let { typeList } = this.data let { typeList } = this.data
let index = e.currentTarget.dataset.index let index = e.currentTarget.dataset.index
// console.log('index: ', index);
// let itemList = []
// let params = {
// clueSource: '',
// hasPhone: '',
// starTag: ''
// }
// console.log('index: ', index)
// 重置筛选 // 重置筛选
if (index == 3) { if (index == 3) {
// typeList.forEach(item => {
// item.selectIndex = 2
// })
// this.setData({
// typeList
// })
// //重置数据
// this.clearclueData()
// return this.getPageApi()
return this.resetCluelist() return this.resetCluelist()
} }
...@@ -582,10 +566,7 @@ Page({ ...@@ -582,10 +566,7 @@ Page({
let params = typeList.reduce((obj, item, index) => { let params = typeList.reduce((obj, item, index) => {
console.log(' item: ', item) console.log(' item: ', item)
if (item['key']) { if (item['key']) {
// selectIndex = index == 2 ? selectIndex + 1 : selectIndex
// console.log('selectIndex: ', selectIndex);
let itemIndx = item.selectIndex let itemIndx = item.selectIndex
// console.log('itemIndx: ', itemIndx);
// key: 'clueSource' // key: 'clueSource'
if (item['key'] == 'clueSource') { if (item['key'] == 'clueSource') {
// itemIndx += 1 // itemIndx += 1
...@@ -597,24 +578,6 @@ Page({ ...@@ -597,24 +578,6 @@ Page({
return obj return obj
}, {}) }, {})
console.log(params) console.log(params)
// let num
// if (index == 2) {
// num = res.tapIndex + 1
// } else {
// num = res.tapIndex
// }
// switch (index) {
// case 0:
// params.hasPhone = num
// break
// case 1:
// params.starTag = num
// break
// case 2:
// params.clueSource = num
// break
// }
// 清空数据 // 清空数据
_this.setData({ typeList ,clueParams:params}) _this.setData({ typeList ,clueParams:params})
_this.getPageApi(params) _this.getPageApi(params)
...@@ -782,8 +745,9 @@ Page({ ...@@ -782,8 +745,9 @@ Page({
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
// console.log('onPullDownRefresh: '); // console.log('onPullDownRefresh: ');
// let {clueParams} = this.data let {clueParams} = this.data
this.resetCluelist() this.getClueInit(clueParams)
// this.resetCluelist()
// this.onLoad() // this.onLoad()
wx.pro.showToast({ wx.pro.showToast({
title: '刷新成功', title: '刷新成功',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!