import { getVoiceDynamicTop10 } from '../../../../api/partyInteract' Page({ data: { conditionList: [ { title: '最近一个月', id: '1', select: true }, { title: '最近三个月', id: '2', select: false }, { title: '最近六个月', id: '3', select: false }, { title: '最近一年', id: '4', select: false } ], choosedCondition: { title: '最近一个月', id: '1' }, conditionVisible: false, /***下面的下拉框开始 ***/ conditionListBottom: [ { title: '按照人数', id: '1', select: true }, { title: '按照人次', id: '2', select: false }, ], choosedConditionBottom: { title: '按照人数', id: '1' }, conditionVisibleBottom: false, /***下面的下拉框结束 ***/ order: '2', orderType: 'Desc', }, onLoad: function () { this.getVoiceDynamicTop10() }, /********************下面的下拉框start ***********************************/ 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 }) }, showConditionBottom() { this.setData({ conditionVisibleBottom: !this.data.conditionVisibleBottom }) }, onChnageConditionBottom(e: AnyObject) { const list = this.data.conditionListBottom list.forEach(item => { if (item.id === e.currentTarget.dataset.id) { item.select = true this.setData({ 'choosedConditionBottom.title': item.title, 'choosedConditionBottom.id': item.id }) } else { item.select = false } }) this.setData({ conditionListBottom: list }) }, /********************下面的下拉框end ***********************************/ // 正序倒序切换 changeOrder() { if (this.data.orderType === 'Desc') { this.setData({ orderType: 'Asc' }) } else if (this.data.orderType === 'Asc') { this.setData({ orderType: 'Desc' }) } }, /********************Top10 ************************************/ async getVoiceDynamicTop10(){ let obj = { DeptId:'', someMonthsType:'1', orderType:"Desc", orderStyle:'1' } let res:any = await getVoiceDynamicTop10(obj) console.log(res) } })