|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
const app = getApp()
|
|
|
|
|
import brokenLine from "../../../components/option/singleLineOption"
|
|
|
|
|
import histogram from "../../../components/option/columnarOption"
|
|
|
|
|
import {times} from "../../../components/option/text"
|
|
|
|
|
import moment from "moment"
|
|
|
|
|
let iPageIndex = 1 // 当前第几页,0代表第一页
|
|
|
|
|
let iPageSize =20 //每页显示多少数据
|
|
|
|
@ -116,6 +117,7 @@ Page({
|
|
|
|
|
sPriceType: this.data.sPriceType,
|
|
|
|
|
sEnergyType: this.data.sEnergyType
|
|
|
|
|
}
|
|
|
|
|
let length=0
|
|
|
|
|
//第一次加载数据
|
|
|
|
|
if (iPageIndex == 1) {
|
|
|
|
|
this.setData({
|
|
|
|
@ -124,9 +126,6 @@ Page({
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
app.globalData.request(obj,(database)=>{
|
|
|
|
|
this.setData({
|
|
|
|
|
// ranking1:database.Data,
|
|
|
|
|
})
|
|
|
|
|
}).then(res => {
|
|
|
|
|
const carName=[]
|
|
|
|
|
const carValue=[]
|
|
|
|
@ -139,10 +138,12 @@ Page({
|
|
|
|
|
carName.push(e.seriesname)
|
|
|
|
|
carValue.push(e.salescount)
|
|
|
|
|
})
|
|
|
|
|
// length=(carName.length/carName.length)*100
|
|
|
|
|
// console.log(carName.length)
|
|
|
|
|
this.setData({
|
|
|
|
|
ranking: list, //获取数据数组
|
|
|
|
|
loadMore: false,//把"上拉加载"的变量设为false,显示
|
|
|
|
|
brandOption:histogram(carName,carValue,'#0084FF',false)
|
|
|
|
|
brandOption:histogram(carName,carValue,'#0084FF',false,(20/list.length)*100)
|
|
|
|
|
});
|
|
|
|
|
if (res.length < iPageSize) {
|
|
|
|
|
this.setData({
|
|
|
|
@ -260,7 +261,7 @@ Page({
|
|
|
|
|
bindShowMsg(e) {
|
|
|
|
|
var id = e.currentTarget.id
|
|
|
|
|
if (id == 1) {
|
|
|
|
|
this.data.Stats1=2
|
|
|
|
|
this.data.Stats1=3
|
|
|
|
|
this.setData({
|
|
|
|
|
select1: !this.data.select1,
|
|
|
|
|
select2: false,
|
|
|
|
@ -270,7 +271,7 @@ Page({
|
|
|
|
|
font1:this.getFont(this.data.Stats1)
|
|
|
|
|
})
|
|
|
|
|
} else if (id == 2) {
|
|
|
|
|
this.data.Stats2=2
|
|
|
|
|
this.data.Stats2=3
|
|
|
|
|
this.setData({
|
|
|
|
|
select2: !this.data.select2,
|
|
|
|
|
select1: false,
|
|
|
|
@ -280,7 +281,7 @@ Page({
|
|
|
|
|
font2:this.getFont(this.data.Stats2)
|
|
|
|
|
})
|
|
|
|
|
} else if (id == 3) {
|
|
|
|
|
this.data.Stats3=2
|
|
|
|
|
this.data.Stats3=3
|
|
|
|
|
this.setData({
|
|
|
|
|
select3: !this.data.select3,
|
|
|
|
|
select2: false,
|
|
|
|
@ -290,7 +291,7 @@ Page({
|
|
|
|
|
font3:this.getFont(this.data.Stats3)
|
|
|
|
|
})
|
|
|
|
|
} else if (id == 4) {
|
|
|
|
|
this.data.Stats4=2
|
|
|
|
|
this.data.Stats4=3
|
|
|
|
|
this.setData({
|
|
|
|
|
select4: !this.data.select4,
|
|
|
|
|
select1: false,
|
|
|
|
@ -410,31 +411,7 @@ Page({
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//弹出框
|
|
|
|
|
times(val){
|
|
|
|
|
var month=val.substring(0,4) //获取年份
|
|
|
|
|
var bYear=val.substring(val.length-2,val.length-1)=="0"//是否为带零的月份
|
|
|
|
|
var year1=val.substring(val.length-1,val.length) //获取月份最后一个数
|
|
|
|
|
var year2=val.substring(val.length-2,val.length) //获取整个月份
|
|
|
|
|
var time,months,years
|
|
|
|
|
if(bYear){
|
|
|
|
|
if(parseInt(year1)<6){
|
|
|
|
|
months=parseInt(month-1)
|
|
|
|
|
if(parseInt(year1)<3){
|
|
|
|
|
years="0"+((12-(6-parseInt(year1)))+1)
|
|
|
|
|
}else{
|
|
|
|
|
years=(12-(6-parseInt(year1)))+1
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
months=month
|
|
|
|
|
years="0"+((parseInt(year1)-6)+1)
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
months=month
|
|
|
|
|
years="0"+(parseInt(year2)-6+1)
|
|
|
|
|
}
|
|
|
|
|
time=months+'-'+years
|
|
|
|
|
return time
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
popup(e) {
|
|
|
|
|
let duration = this.data.duration
|
|
|
|
|
let models = e.currentTarget.dataset.car
|
|
|
|
@ -442,7 +419,7 @@ Page({
|
|
|
|
|
action:"getCheZhuCarSeriesListHome",
|
|
|
|
|
sType:"Marketing",
|
|
|
|
|
sSeriesName:models,
|
|
|
|
|
sStartTime:this.times(this.data.date),
|
|
|
|
|
sStartTime:times(this.data.date),
|
|
|
|
|
sEndTime: this.data.date,
|
|
|
|
|
}).then(res => {
|
|
|
|
|
// console.log(res)
|
|
|
|
|