|
|
|
@ -1,46 +1,62 @@
|
|
|
|
|
// const { default: brandOption } = require("../../option/brandOption");
|
|
|
|
|
const app = getApp();
|
|
|
|
|
import histogram from "../../option/columnarOption"
|
|
|
|
|
// const data1=['大众速腾', '激励帝豪', '吉利星越', '奥迪A4', '奥迪Q5']
|
|
|
|
|
// const data2=[1400, 2000, 1500, 1800, 1490, 900, 310]
|
|
|
|
|
const data1=[]
|
|
|
|
|
const data2=[]
|
|
|
|
|
const data3=['尾翼互动量']
|
|
|
|
|
Component({
|
|
|
|
|
data: {
|
|
|
|
|
showChart: true,
|
|
|
|
|
data1:[],
|
|
|
|
|
data2:[],
|
|
|
|
|
brandOption: histogram(data1,data2,data3,'#0084FF'),
|
|
|
|
|
modelOption: histogram(data1,data2,data3,'#20CC62'),
|
|
|
|
|
// brandOption: histogram(data1,data2,'#0084FF'),
|
|
|
|
|
// modelOption: histogram(data1,data2,'#20CC62'),
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onShow() {
|
|
|
|
|
this.getTabBar().init();
|
|
|
|
|
},
|
|
|
|
|
lifetimes: {
|
|
|
|
|
attached() {
|
|
|
|
|
app.globalData.request({action: 'getEventsListH', sType: 'Home', sTimeType: 3}).then(res => {
|
|
|
|
|
const brand = []
|
|
|
|
|
const value=[]
|
|
|
|
|
let sTimeType = wx.getStorageSync("sTimeType") || 34;
|
|
|
|
|
let sStartTime = wx.getStorageSync("sStartTime") || '';
|
|
|
|
|
let sEndTime = wx.getStorageSync("sEndTime") || '';
|
|
|
|
|
this.getData(sTimeType, sStartTime, sEndTime);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
changeTime(e){
|
|
|
|
|
let sTimeType = e.detail.sTimeType;
|
|
|
|
|
let sStartTime = e.detail.sStartTime;
|
|
|
|
|
let sEndTime = e.detail.sEndTime;
|
|
|
|
|
this.getData(sTimeType, sStartTime, sEndTime);
|
|
|
|
|
},
|
|
|
|
|
getData(sTimeType, sStartTime, sEndTime) {
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: '加载中',
|
|
|
|
|
icon: 'loading',
|
|
|
|
|
duration: 300000
|
|
|
|
|
})
|
|
|
|
|
app.globalData.request( {
|
|
|
|
|
action: 'getWeiYiCountHome0528',
|
|
|
|
|
sType: 'Home',
|
|
|
|
|
sQueryType:1,
|
|
|
|
|
sTimeType: sTimeType,
|
|
|
|
|
sStartTime: sStartTime,
|
|
|
|
|
sEndTime: sEndTime,
|
|
|
|
|
}).then(res => {
|
|
|
|
|
const arr = []
|
|
|
|
|
const arr1=[]
|
|
|
|
|
res.forEach(ele => {
|
|
|
|
|
|
|
|
|
|
brand.push(ele.key)
|
|
|
|
|
value.push(ele.value)
|
|
|
|
|
arr.push(ele.key);
|
|
|
|
|
arr1.push(ele.value)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.setData({
|
|
|
|
|
// countYear: data.count_year,
|
|
|
|
|
// count6month: data.count_6month,
|
|
|
|
|
// countAll: data.count_all,
|
|
|
|
|
data1:brand,
|
|
|
|
|
data2:value
|
|
|
|
|
brandOption: histogram(arr,arr1,"#0084FF")
|
|
|
|
|
})
|
|
|
|
|
setTimeout(() =>{
|
|
|
|
|
wx.hideToast();
|
|
|
|
|
},500)
|
|
|
|
|
console.log('333',arr)
|
|
|
|
|
console.log('333',arr1)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
priceSel(e){
|
|
|
|
|
|
|
|
|
|
this.setData({
|
|
|
|
|
intervalSel: e.currentTarget.dataset.index
|
|
|
|
|
})
|
|
|
|
|