dev
xiaowen 3 years ago
parent af44720c60
commit b14e9d14a3

@ -1,91 +1,98 @@
import histogram from "../../option/columnarOption"
import histogram from "../../option/columnarOption"
const app = getApp()
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
imageUrl: getApp().globalData.imageUrl,
showChart: true,
},
lifetimes: {
attached() {
this.getData()
}
},
lifetimes:{
attached(){
this.getData()
}
},
methods: {
getData(){
getData() {
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 30000
})
app.globalData.request({action: 'getCheZhuLatestTimeHome',sType:'Marketing'}).then(res => {
})
app.globalData.request({
action: 'getCheZhuLatestTimeHome',
sType: 'Marketing'
}).then(res => {
wx.setStorageSync('newTime', res)
this.setData({
newTime:wx.getStorageSync('newTime')
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)
});
app.globalData.request({
action: 'getCheZhuCarBrandRankingHome',
sType: 'Marketing',
sTimeType: wx.getStorageSync('sTimeType') || 34,
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'),
brandOption: histogram(carName, carCount, '#0084FF'),
})
})
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)
});
app.globalData.request({
action: 'getCheZhuCarSeriesRankingHome',
sType: 'Marketing',
sTimeType: wx.getStorageSync('sTimeType') || 34,
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'),
modelOption: histogram(carName, carCount, '#20CC62'),
})
})
setTimeout(() =>{
setTimeout(() => {
wx.hideToast();
},1000)
},
priceSel(e){
}, 1000)
},
priceSel(e) {
this.setData({
intervalSel: e.currentTarget.dataset.index
})
},
Rankdetail(){
wx.navigateTo({
url: "/pages/index/Salesranking/Salesranking"
})
Rankdetail() {
wx.navigateTo({
url: "/pages/index/Salesranking/Salesranking"
})
},
//品牌排行
ranking(){
wx.navigateTo({
url: "/pages/index/Salesranking/Salesranking"
})
ranking() {
wx.navigateTo({
url: "/pages/index/Salesranking/Salesranking"
})
},
//车型排行
vehicletype(){
wx.navigateTo({
url: "/pages/index/Salesranking/Salesranking"
})
vehicletype() {
wx.navigateTo({
url: "/pages/index/Salesranking/Salesranking"
})
}
}
})
Loading…
Cancel
Save