|
|
|
@ -5,67 +5,111 @@ Component({
|
|
|
|
|
data: {
|
|
|
|
|
imageUrl: getApp().globalData.imageUrl,
|
|
|
|
|
showChart: true,
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
lifetimes:{
|
|
|
|
|
attached(){
|
|
|
|
|
lifetimes: {
|
|
|
|
|
attached() {
|
|
|
|
|
this.getData()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getData(){
|
|
|
|
|
getData() {
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: '加载中',
|
|
|
|
|
icon: 'loading',
|
|
|
|
|
duration: 300000
|
|
|
|
|
duration: 50000
|
|
|
|
|
})
|
|
|
|
|
Promise.all([this.getTimeData(), this.getBrandData(), this.getModelData()]).then(() => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
wx.hideToast();
|
|
|
|
|
}, 500)
|
|
|
|
|
})
|
|
|
|
|
app.globalData.request({action: 'getCheZhuLatestTimeHome',sType:'Marketing'}).then(res => {
|
|
|
|
|
// wx.setStorageSync('newTime', res)
|
|
|
|
|
const newTime=res
|
|
|
|
|
},
|
|
|
|
|
// 获取时间
|
|
|
|
|
getTimeData() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getCheZhuLatestTimeHome',
|
|
|
|
|
sType: 'Marketing'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
wx.setStorageSync('newTime', res)
|
|
|
|
|
this.setData({
|
|
|
|
|
newTime
|
|
|
|
|
newTime: wx.getStorageSync('newTime')
|
|
|
|
|
})
|
|
|
|
|
resolve(true)
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
reject(false)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
app.globalData.request({action: 'getCheZhuCarBrandRankingHome',sType:'Marketing',
|
|
|
|
|
sTimeType:"4",
|
|
|
|
|
sStartTime:wx.getStorageSync('newTime'),
|
|
|
|
|
sEndTime:wx.getStorageSync('newTime')}).then(res => {
|
|
|
|
|
},
|
|
|
|
|
// 获取品牌的数据
|
|
|
|
|
getBrandData() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
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=[]
|
|
|
|
|
const carName = []
|
|
|
|
|
const carCount = []
|
|
|
|
|
res.forEach(e => {
|
|
|
|
|
carName.push(e.brand),
|
|
|
|
|
carCount.push(e.salescount)
|
|
|
|
|
});
|
|
|
|
|
this.setData({
|
|
|
|
|
brandOption:histogram(carName,carCount,'#0084FF'),
|
|
|
|
|
// modelOption:histogram()
|
|
|
|
|
brandOption: histogram(carName, carCount, '#0084FF'),
|
|
|
|
|
})
|
|
|
|
|
resolve(true)
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
reject(false)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
setTimeout(() =>{
|
|
|
|
|
wx.hideToast();
|
|
|
|
|
},500)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
priceSel(e){
|
|
|
|
|
getModelData() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
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'),
|
|
|
|
|
})
|
|
|
|
|
resolve(true)
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
reject(false)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
priceSel(e) {
|
|
|
|
|
this.setData({
|
|
|
|
|
intervalSel: e.currentTarget.dataset.index
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
Rankdetail(){
|
|
|
|
|
Rankdetail() {
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: "/pages/index/Salesranking/Salesranking"
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//品牌排行
|
|
|
|
|
ranking(){
|
|
|
|
|
|
|
|
|
|
ranking() {
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: "/pages/index/Salesranking/Salesranking?a="+this.newTime
|
|
|
|
|
url: "/pages/index/Salesranking/Salesranking"
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//车型排行
|
|
|
|
|
vehicletype(){
|
|
|
|
|
vehicletype() {
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: "/pages/index/Salesranking/Salesranking"
|
|
|
|
|
})
|
|
|
|
|