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.

58 lines
1.8 KiB

3 years ago
import histogram from "../option/columnarOption"
3 years ago
const app = getApp()
3 years ago
Component({
data: {
showChart: true,
3 years ago
sSpec:'',
sPriceType:'',
sEnergyType:''
3 years ago
},
3 years ago
// onShow() {
// this.getTabBar().init();
// },
lifetimes:{
attached(){
this.getTrend()
}
3 years ago
},
methods: {
3 years ago
getTrend(){
3 years ago
let sStartTime =wx.getStorageSync('newTime') || '';
let sEndTime = wx.getStorageSync('newTime') || '';
3 years ago
app.globalData.request({
action: 'getCheZhuCarSeriesRankingHome',
sType:'Marketing',
3 years ago
sStartTime: sStartTime,
sEndTime:sEndTime,
3 years ago
iPageIndex: "iPageIndex",
iPageSize: "iPageSize",
3 years ago
// sSpec:this.data. ,
sPriceType:wx.getStorageSync('sPriceType') || '',
sEnergyType:wx.getStorageSync('sEnergyType') || ''
3 years ago
}).then(res => {
let carName = []
let carValue=[]
3 years ago
let carName1 = []
let carValue1=[]
3 years ago
res.forEach(e =>{
carName.push(e.seriesname),
carValue.push(e.salescount)
})
3 years ago
let a=0
for(let i=carName.length; i>0;i--){
a++
carName1.push(carName[i-1])
carValue1.push(carValue[i-1])
}
3 years ago
this.setData({
3 years ago
brandOption: histogram(carName1,carValue1,'#0084FF',false)
3 years ago
})
})},
3 years ago
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
}
}
})