榆山数据端小程序
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.
 
 

108 lines
3.1 KiB

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)
}
})