|
|
|
@ -13,15 +13,11 @@ Page({
|
|
|
|
|
showChart:true,
|
|
|
|
|
// select: false,
|
|
|
|
|
grade_value1: "",
|
|
|
|
|
grade_name1: '按级别',
|
|
|
|
|
grade_name2: '按价格',
|
|
|
|
|
grade_name3: '按能源',
|
|
|
|
|
grade_name4: '列表展示',
|
|
|
|
|
grades4: ['列表展示', '图表展示'],
|
|
|
|
|
Stats1:1,
|
|
|
|
|
Stats2:2,
|
|
|
|
|
Stats3:3,
|
|
|
|
|
Stats4:4,
|
|
|
|
|
grade_value2: "",
|
|
|
|
|
grade_value3: "",
|
|
|
|
|
grade_value4: 0,
|
|
|
|
|
grades4: [{text:'列表展示',value:0},
|
|
|
|
|
{text:'图表展示',value:1}],
|
|
|
|
|
num:0,
|
|
|
|
|
num1:false,
|
|
|
|
|
//弹出框
|
|
|
|
@ -184,10 +180,10 @@ Page({
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getEnergy',
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let arr = [{name:"全部能源",value:""}]
|
|
|
|
|
let arr = [{text:"全部能源",value:""}]
|
|
|
|
|
res.forEach(ele => {
|
|
|
|
|
let obj = {
|
|
|
|
|
name: ele.value,
|
|
|
|
|
text: ele.value,
|
|
|
|
|
value: ele.key
|
|
|
|
|
}
|
|
|
|
|
arr.push(obj)
|
|
|
|
@ -200,10 +196,10 @@ Page({
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getPrice',
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let arr = [{name:"全部价格",value:""}]
|
|
|
|
|
let arr = [{text:"全部价格",value:""}]
|
|
|
|
|
res.forEach(ele => {
|
|
|
|
|
let obj = {
|
|
|
|
|
name: ele.value,
|
|
|
|
|
text: ele.value,
|
|
|
|
|
value: ele.key
|
|
|
|
|
}
|
|
|
|
|
arr.push(obj)
|
|
|
|
@ -238,71 +234,6 @@ Page({
|
|
|
|
|
this.data.builds = e.detail.val
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getBox(num){
|
|
|
|
|
switch(num){
|
|
|
|
|
case 1:
|
|
|
|
|
return "top-noselected";
|
|
|
|
|
case 2:
|
|
|
|
|
return "top-selected";
|
|
|
|
|
case 3:
|
|
|
|
|
return "top-selecteds"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getFont(num){
|
|
|
|
|
switch(num){
|
|
|
|
|
case 1:
|
|
|
|
|
return "notitle";
|
|
|
|
|
case 2:
|
|
|
|
|
return "title";
|
|
|
|
|
case 3:
|
|
|
|
|
return "titles"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//点击下拉
|
|
|
|
|
bindShowMsg(e) {
|
|
|
|
|
var id = e.currentTarget.id
|
|
|
|
|
if (id == 1) {
|
|
|
|
|
this.data.Stats1=3
|
|
|
|
|
this.setData({
|
|
|
|
|
select1: !this.data.select1,
|
|
|
|
|
select2: false,
|
|
|
|
|
select3: false,
|
|
|
|
|
select4: false,
|
|
|
|
|
box1:this.getBox(this.data.Stats1),
|
|
|
|
|
font1:this.getFont(this.data.Stats1)
|
|
|
|
|
})
|
|
|
|
|
} else if (id == 2) {
|
|
|
|
|
this.data.Stats2=3
|
|
|
|
|
this.setData({
|
|
|
|
|
select2: !this.data.select2,
|
|
|
|
|
select1: false,
|
|
|
|
|
select3: false,
|
|
|
|
|
select4: false,
|
|
|
|
|
box2:this.getBox(this.data.Stats2),
|
|
|
|
|
font2:this.getFont(this.data.Stats2)
|
|
|
|
|
})
|
|
|
|
|
} else if (id == 3) {
|
|
|
|
|
this.data.Stats3=3
|
|
|
|
|
this.setData({
|
|
|
|
|
select3: !this.data.select3,
|
|
|
|
|
select2: false,
|
|
|
|
|
select1: false,
|
|
|
|
|
select4: false,
|
|
|
|
|
box3:this.getBox(this.data.Stats3),
|
|
|
|
|
font3:this.getFont(this.data.Stats3)
|
|
|
|
|
})
|
|
|
|
|
} else if (id == 4) {
|
|
|
|
|
this.data.Stats4=3
|
|
|
|
|
this.setData({
|
|
|
|
|
select4: !this.data.select4,
|
|
|
|
|
select1: false,
|
|
|
|
|
select3: false,
|
|
|
|
|
select2: false,
|
|
|
|
|
box4:this.getBox(this.data.Stats4),
|
|
|
|
|
font4:this.getFont(this.data.Stats4)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 按级别
|
|
|
|
|
mySelect1(e) {
|
|
|
|
|
iPageIndex=1
|
|
|
|
@ -315,52 +246,33 @@ Page({
|
|
|
|
|
},
|
|
|
|
|
// 按价格
|
|
|
|
|
mySelect2(e) {
|
|
|
|
|
var name = e.currentTarget.dataset.name.name
|
|
|
|
|
var value = e.currentTarget.dataset.name.value
|
|
|
|
|
iPageIndex=1
|
|
|
|
|
iPageSize = 20
|
|
|
|
|
this.data.Stats2=3
|
|
|
|
|
this.setData({
|
|
|
|
|
ranking:[],
|
|
|
|
|
grade_name2: name,
|
|
|
|
|
select2: false,
|
|
|
|
|
sPriceType: value,
|
|
|
|
|
box2:this.getBox(this.data.Stats2),
|
|
|
|
|
font2:this.getFont(this.data.Stats2)
|
|
|
|
|
ranking:[],
|
|
|
|
|
sPriceType: e.detail,
|
|
|
|
|
})
|
|
|
|
|
this.getTrend()
|
|
|
|
|
},
|
|
|
|
|
// 按能源
|
|
|
|
|
mySelect3(e) {
|
|
|
|
|
var name = e.currentTarget.dataset.name.name
|
|
|
|
|
var value = e.currentTarget.dataset.name.value
|
|
|
|
|
iPageIndex=1
|
|
|
|
|
iPageSize = 20
|
|
|
|
|
this.data.Stats3=3
|
|
|
|
|
this.setData({
|
|
|
|
|
ranking:[],
|
|
|
|
|
grade_name3: name,
|
|
|
|
|
select3: false,
|
|
|
|
|
sEnergyType: value,
|
|
|
|
|
box3:this.getBox(this.data.Stats3),
|
|
|
|
|
font3:this.getFont(this.data.Stats3)
|
|
|
|
|
sEnergyType: e.detail,
|
|
|
|
|
})
|
|
|
|
|
this.getTrend()
|
|
|
|
|
},
|
|
|
|
|
// 列表展示
|
|
|
|
|
mySelect4(e) {
|
|
|
|
|
var name = e.currentTarget.dataset.name
|
|
|
|
|
this.data.Stats4=3
|
|
|
|
|
iPageIndex=1
|
|
|
|
|
iPageSize = 20
|
|
|
|
|
this.setData({
|
|
|
|
|
ranking:[],
|
|
|
|
|
grade_name4: name,
|
|
|
|
|
select4: false,
|
|
|
|
|
a: name != "列表展示",
|
|
|
|
|
box4:this.getBox(this.data.Stats4),
|
|
|
|
|
font4:this.getFont(this.data.Stats4)
|
|
|
|
|
a: e.detail != 0
|
|
|
|
|
})
|
|
|
|
|
this.getTrend()
|
|
|
|
|
},
|
|
|
|
|
// 全部
|
|
|
|
|
all(){
|
|
|
|
@ -369,9 +281,10 @@ Page({
|
|
|
|
|
this.data.num++
|
|
|
|
|
let dj=this.data.num%2==0
|
|
|
|
|
this.setData({
|
|
|
|
|
grade_name1: '全部级别',
|
|
|
|
|
grade_name2: '全部价格',
|
|
|
|
|
grade_name3: '全部能源',
|
|
|
|
|
ranking:[],
|
|
|
|
|
grade_value1: "",
|
|
|
|
|
grade_value2: "",
|
|
|
|
|
grade_value3: "",
|
|
|
|
|
sSpec: '',
|
|
|
|
|
sPriceType: '',
|
|
|
|
|
sEnergyType: '',
|
|
|
|
|