From 0dbef463f6ddafa9ea4bf22f65ae0344026409bf Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Fri, 15 Jul 2022 16:58:58 +0800 Subject: [PATCH] wyl --- components/indexCom/dataChild/index.js | 1 + components/indexCom/soundChild/index.js | 100 ++++++++++++---------- components/indexCom/soundChild/index.wxml | 2 +- components/option/sColumnarOption.js | 9 +- 4 files changed, 65 insertions(+), 47 deletions(-) diff --git a/components/indexCom/dataChild/index.js b/components/indexCom/dataChild/index.js index c6e3778..e69ae13 100644 --- a/components/indexCom/dataChild/index.js +++ b/components/indexCom/dataChild/index.js @@ -81,6 +81,7 @@ Component({ }) }) + console.log("这是数据",time) // console.log("这是数据"+lValue) // console.log("这是数据"+lName) diff --git a/components/indexCom/soundChild/index.js b/components/indexCom/soundChild/index.js index 7307429..b57b596 100644 --- a/components/indexCom/soundChild/index.js +++ b/components/indexCom/soundChild/index.js @@ -1,26 +1,9 @@ const app = getApp(); - import sHistogram from "../../option/sColumnarOption" -// const dx=['长安','大众','丰田','吉利','哈佛'] -const dx = [] -const ds=[] - // [1400, 2400, 1000, 2800, 1000, 400, 1200], - // [100, 2000, 1500, 1800, 1490, 900, 310], - // [1400, 200, 150, 1340, 1600, 1900, 1310], - // [6545, 3456, 1500, 4500, 1700, 1900, 3100], - // [3123, 2313, 313, 4355, 1490, 2900, 2310], - // [1400, 5434, 1544, 533, 1454, 1900, 3310], - // [1400, 5434, 1544, 533, 1454, 1900, 3310],] -// const data=['微博','其他','短视频','微信','APP','论坛','新闻'] -const data = [] -const color2=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF'] - +const color2=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF','#7257FF'] Component({ data: { showChart: true, - brandOption:sHistogram(dx,ds,data,color2), - modelOption: sHistogram(dx,ds,data,color2) - }, onShow() { this.getTabBar().init(); @@ -28,44 +11,71 @@ Component({ }, lifetimes: { attached() { - app.globalData.request({action: 'getHomeBrandSourceType0528', sType: 'Home', sTimeType: 34, sQueryType: 2}).then(res => { + 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: 'getHomeBrandSourceType0528', sType: 'Home', sTimeType: sTimeType, sStartTime: sStartTime,sEndTime: sEndTime,sQueryType: 1}).then(res => { + const arr = [] + const arr1=[[],[],[],[],[],[],[],[]] + const arr2=[] + res.forEach(ele => { + arr.push(ele.key) + ele.value.forEach(e=>{ + arr2.push(e.key) + }) + for(let i=0;i { const arr = [] - const arr1=[] + const arr1=[[],[],[],[],[],[],[],[]] const arr2=[] - const arr3=[] - const arr4=[] res.forEach(ele => { - // let ol = { - // dx:ele.key - // } - arr.push(ele.key) - ele.value.forEach(val =>{ - arr1.push(val.value) - arr2.push(val.key) - }) - // arr.push(ol) + arr.push(ele.key) + ele.value.forEach(e=>{ + arr2.push(e.key) + }) + for(let i=0;i{ + wx.hideToast(); + },500) }) }, - }, - - methods: { priceSel(e){ this.setData({ intervalSel: e.currentTarget.dataset.index }) - }, + }, + } }) \ No newline at end of file diff --git a/components/indexCom/soundChild/index.wxml b/components/indexCom/soundChild/index.wxml index a8d16f4..e2d7c1a 100644 --- a/components/indexCom/soundChild/index.wxml +++ b/components/indexCom/soundChild/index.wxml @@ -1,6 +1,6 @@ - + 品牌传播声量 diff --git a/components/option/sColumnarOption.js b/components/option/sColumnarOption.js index 4c7862c..8b75753 100644 --- a/components/option/sColumnarOption.js +++ b/components/option/sColumnarOption.js @@ -28,6 +28,13 @@ export default function sHistogram(dx=[],ds=[],data=[],color2=[]) { top: 40, containLabel: true }, + dataZoom: [{ //添加X轴滚动条 + type: 'inside', + show: false, + start: 50, + end: 10, + handleSize: 5 + }], yAxis: [ { type: 'value', @@ -40,7 +47,7 @@ export default function sHistogram(dx=[],ds=[],data=[],color2=[]) { axisLabel: { color: '#999999',//y轴文本颜色 textStyle: { - fontSize : 9 + fontSize : 8 } }, splitLine: { //分割线