|
|
|
@ -14,6 +14,10 @@ Page({
|
|
|
|
|
grade_name3: '按能源',
|
|
|
|
|
grade_name4: '列表展示',
|
|
|
|
|
grades4: ['列表展示', '图表展示'],
|
|
|
|
|
Stats1:1,
|
|
|
|
|
Stats2:2,
|
|
|
|
|
Stats3:3,
|
|
|
|
|
Stats4:4,
|
|
|
|
|
//弹出框
|
|
|
|
|
show: false,
|
|
|
|
|
duration: 300,
|
|
|
|
@ -127,7 +131,7 @@ Page({
|
|
|
|
|
// brandOption:histogram(carName,carValue,'#0084FF',false)
|
|
|
|
|
})
|
|
|
|
|
}).then(res => {
|
|
|
|
|
console.log("这是数据",res)
|
|
|
|
|
// console.log("这是数据",res)
|
|
|
|
|
if (res && res.length > 0) {
|
|
|
|
|
iPageIndex++;
|
|
|
|
|
//把新请求到的数据添加到列表里
|
|
|
|
@ -159,8 +163,8 @@ Page({
|
|
|
|
|
},
|
|
|
|
|
//页面上拉触底事件的处理函数
|
|
|
|
|
onReachBottom:function() {
|
|
|
|
|
console.log("上拉触底事件")
|
|
|
|
|
console.log(iPageIndex)
|
|
|
|
|
// console.log("上拉触底事件")
|
|
|
|
|
// console.log(iPageIndex)
|
|
|
|
|
let that = this
|
|
|
|
|
if (!that.data.loadMore) {
|
|
|
|
|
that.setData({
|
|
|
|
@ -231,36 +235,68 @@ 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=2
|
|
|
|
|
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=2
|
|
|
|
|
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=2
|
|
|
|
|
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=2
|
|
|
|
|
this.setData({
|
|
|
|
|
select4: !this.data.select4,
|
|
|
|
|
select1: false,
|
|
|
|
|
select3: false,
|
|
|
|
|
select2: false,
|
|
|
|
|
box4:this.getBox(this.data.Stats4),
|
|
|
|
|
font4:this.getFont(this.data.Stats4)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -270,13 +306,14 @@ Page({
|
|
|
|
|
var value = e.currentTarget.dataset.name.value
|
|
|
|
|
iPageIndex=1
|
|
|
|
|
iPageSize = 20
|
|
|
|
|
var fonts=value!=""
|
|
|
|
|
this.data.Stats1=3
|
|
|
|
|
this.setData({
|
|
|
|
|
ranking:[],
|
|
|
|
|
grade_name1: name,
|
|
|
|
|
sSpec: value,
|
|
|
|
|
select1: false,
|
|
|
|
|
fontSize:fonts
|
|
|
|
|
box1:this.getBox(this.data.Stats1),
|
|
|
|
|
font1:this.getFont(this.data.Stats1)
|
|
|
|
|
})
|
|
|
|
|
this.getTrend()
|
|
|
|
|
},
|
|
|
|
@ -286,11 +323,14 @@ Page({
|
|
|
|
|
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
|
|
|
|
|
sPriceType: value,
|
|
|
|
|
box2:this.getBox(this.data.Stats2),
|
|
|
|
|
font2:this.getFont(this.data.Stats2)
|
|
|
|
|
})
|
|
|
|
|
this.getTrend()
|
|
|
|
|
},
|
|
|
|
@ -300,21 +340,27 @@ Page({
|
|
|
|
|
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
|
|
|
|
|
sEnergyType: value,
|
|
|
|
|
box3:this.getBox(this.data.Stats3),
|
|
|
|
|
font3:this.getFont(this.data.Stats3)
|
|
|
|
|
})
|
|
|
|
|
this.getTrend()
|
|
|
|
|
},
|
|
|
|
|
// 列表展示
|
|
|
|
|
mySelect4(e) {
|
|
|
|
|
var name = e.currentTarget.dataset.name
|
|
|
|
|
this.data.Stats4=3
|
|
|
|
|
this.setData({
|
|
|
|
|
grade_name4: name,
|
|
|
|
|
select4: false,
|
|
|
|
|
a: name != "列表展示"
|
|
|
|
|
a: name != "列表展示",
|
|
|
|
|
box4:this.getBox(this.data.Stats4),
|
|
|
|
|
font4:this.getFont(this.data.Stats4)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 全部
|
|
|
|
|