diff --git a/components/indexCom/barometerChild/index.js b/components/indexCom/barometerChild/index.js index 155850f..cee3f84 100644 --- a/components/indexCom/barometerChild/index.js +++ b/components/indexCom/barometerChild/index.js @@ -27,7 +27,8 @@ Component({ lifetimes: { attached() { app.globalData.request({action: 'getAffections0528',sType:'Home' ,sTimeType:34,}).then(res => { - let arr = [] + let arr = [] + res.forEach(ele => { let ol = { data:ele.Time diff --git a/components/indexCom/insightChild/index.js b/components/indexCom/insightChild/index.js index a6cde3e..f581b69 100644 --- a/components/indexCom/insightChild/index.js +++ b/components/indexCom/insightChild/index.js @@ -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 }) diff --git a/components/indexCom/soundChild/index.js b/components/indexCom/soundChild/index.js index cf567b5..625882c 100644 --- a/components/indexCom/soundChild/index.js +++ b/components/indexCom/soundChild/index.js @@ -31,15 +31,17 @@ Component({ app.globalData.request({action: 'getHomeBrandSourceType0528', sType: 'Home', sTimeType: 34, sQueryType: 2}).then(res => { const arr = [] res.forEach(ele => { - // ele.value.forEach(val =>{ - // let obj = { - // // dx:ele.key, - // ds:val.value, - // data:val.key - // } - // arr.push(obj) - // }) - + let ol = { + dx:ele.key + } + ele.value.forEach(val =>{ + let obj = { + ds:val.value, + data:val.key + } + arr.push(obj) + }) + arr.push(ol) }) this.setData({ brandOption: arr,