You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.8 KiB
70 lines
1.8 KiB
Page({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
conditionList: [
|
|
{ title: '最近1个月', id: '1', select: true },
|
|
{ title: '最近3个月', id: '2', select: false },
|
|
{ title: '最近半年', id: '3', select: false },
|
|
{ title: '最近一年', id: '4', select: false }
|
|
],
|
|
choosedCondition: {
|
|
title: '最近1个月',
|
|
id: '1'
|
|
},
|
|
conditionVisible: false,
|
|
pageId: 'team',//team issueJoin
|
|
selectTab: 'tab1',
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
if (this.data.pageId == 'issueJoin') {
|
|
this.selectComponent("#guideAndResults").getList(this.data); //党员议事参与页面
|
|
} else {//党员社团页面
|
|
console.log(this.data.selectTab)
|
|
if (this.data.selectTab == 'tab1'){
|
|
this.selectComponent("#guideAndResults").getList(this.data);
|
|
}
|
|
}
|
|
},
|
|
// 显示条件下拉框
|
|
showCondition() {
|
|
this.setData({
|
|
conditionVisible: !this.data.conditionVisible
|
|
})
|
|
},
|
|
// 改变查询项
|
|
onChnageCondition(e: AnyObject) {
|
|
const list = this.data.conditionList
|
|
list.forEach(item => {
|
|
if (item.id === e.currentTarget.dataset.id) {
|
|
item.select = true
|
|
this.setData({
|
|
'choosedCondition.title': item.title,
|
|
'choosedCondition.id': item.id
|
|
})
|
|
} else {
|
|
item.select = false
|
|
}
|
|
})
|
|
this.setData({
|
|
conditionList: list
|
|
})
|
|
},
|
|
// tab 切换
|
|
onTabChange(e: AnyObject) {
|
|
this.setData({
|
|
selectTab: e.currentTarget.dataset.tab,
|
|
})
|
|
|
|
if (this.selectComponent("#guideAndResults")) {
|
|
this.selectComponent("#guideAndResults").getList(this.data);
|
|
}
|
|
// if (this.selectComponent("#partyMasses")) {
|
|
// this.selectComponent("#partyMasses").getList(this.data);
|
|
// }
|
|
}
|
|
})
|