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.

91 lines
2.8 KiB

3 years ago
import histogram from "../../option/columnarOption"
3 years ago
const app = getApp()
3 years ago
Component({
data: {
3 years ago
imageUrl: getApp().globalData.imageUrl,
3 years ago
showChart: true,
3 years ago
3 years ago
},
3 years ago
lifetimes:{
attached(){
this.getData()
}
},
3 years ago
methods: {
3 years ago
getData(){
wx.showToast({
title: '加载中',
icon: 'loading',
3 years ago
duration: 30000
3 years ago
})
app.globalData.request({action: 'getCheZhuLatestTimeHome',sType:'Marketing'}).then(res => {
wx.setStorageSync('newTime', res)
this.setData({
newTime:wx.getStorageSync('newTime')
})
})
app.globalData.request({action: 'getCheZhuCarBrandRankingHome',sType:'Marketing',
sTimeType:"4",
sStartTime:wx.getStorageSync('newTime'),
3 years ago
sEndTime:wx.getStorageSync('newTime')}
).then(res => {
3 years ago
console.log(res)
const carName=[]
const carCount=[]
res.forEach(e => {
carName.push(e.brand),
carCount.push(e.salescount)
});
this.setData({
brandOption:histogram(carName,carCount,'#0084FF'),
})
})
3 years ago
app.globalData.request({action: 'getCheZhuCarSeriesRankingHome',sType:'Marketing',
sTimeType:"4",
sStartTime:wx.getStorageSync('newTime'),
sEndTime:wx.getStorageSync('newTime')}
).then(res => {
console.log(res)
const carName=[]
const carCount=[]
res.forEach(e => {
carName.push(e.seriesname),
carCount.push(e.salescount)
});
this.setData({
modelOption:histogram(carName,carCount,'#20CC62'),
})
})
3 years ago
setTimeout(() =>{
wx.hideToast();
3 years ago
},1000)
3 years ago
},
3 years ago
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
3 years ago
},
Rankdetail(){
wx.navigateTo({
3 years ago
url: "/pages/index/Salesranking/Salesranking"
3 years ago
})
3 years ago
},
//品牌排行
ranking(){
wx.navigateTo({
url: "/pages/index/Salesranking/Salesranking"
})
},
//车型排行
vehicletype(){
wx.navigateTo({
url: "/pages/index/Salesranking/Salesranking"
})
3 years ago
}
}
})