|
|
|
@ -1,19 +1,52 @@
|
|
|
|
|
import histogram from "../../option/columnarOption"
|
|
|
|
|
const data1=['大众速腾', '激励帝豪', '吉利星越', '奥迪A4', '奥迪Q5']
|
|
|
|
|
const data2=[1400, 2000, 1500, 1800, 1490, 900, 310]
|
|
|
|
|
const data3=['尾翼互动量']
|
|
|
|
|
|
|
|
|
|
const app = getApp()
|
|
|
|
|
Component({
|
|
|
|
|
data: {
|
|
|
|
|
imageUrl: getApp().globalData.imageUrl,
|
|
|
|
|
showChart: true,
|
|
|
|
|
brandOption: histogram(data1,data2,data3,'#0084FF'),
|
|
|
|
|
modelOption: histogram(data1,data2,data3,'#20CC62'),
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
this.getTabBar().init();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
lifetimes:{
|
|
|
|
|
attached(){
|
|
|
|
|
this.getData()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getData(){
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: '加载中',
|
|
|
|
|
icon: 'loading',
|
|
|
|
|
duration: 300000
|
|
|
|
|
})
|
|
|
|
|
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'),
|
|
|
|
|
sEndTime:wx.getStorageSync('newTime')}).then(res => {
|
|
|
|
|
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'),
|
|
|
|
|
// modelOption:histogram()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
setTimeout(() =>{
|
|
|
|
|
wx.hideToast();
|
|
|
|
|
},500)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
priceSel(e){
|
|
|
|
|
this.setData({
|
|
|
|
|
intervalSel: e.currentTarget.dataset.index
|
|
|
|
|