Commit 58704443 by luyt

fix:处理分页逻辑

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