dev
liuyongli 3 years ago
commit b00d9bf7a1

@ -64,27 +64,6 @@ Component({
sEndTime:sEndTime
}
app.globalData.request(obj).then(res=>{
// const dt=[]
// const time=[]
// const lValue=[]
// const lName=[]
// res.forEach(e=>{
// // dt.push(e)
// time.push(e.Time)
// e.Data.forEach(ee=>{
// let l={
// ts:e.Time,
// value:ee.value,
// key:ee.key
// }
// lValue.push(l)
// time.push(
// lName.push(ee.value,ee.key)
// )
// })
// })
let arr = []
let bar = [[],[],[],[],[],[],[]]
res.forEach(ele => {
@ -96,8 +75,8 @@ Component({
this.setData({
dataOption:brokenLine(dName,bar,dColor,arr),
})
})
})
},
// 入库数据量

@ -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 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)
ele.value.forEach(e=>{
arr2.push(e.key)
})
for(let i=0;i<ele.value.length;i++){
arr1[i].push(ele.value[i].value)
}
})
// arr.push(ol)
this.setData({
brandOption:sHistogram(arr,arr1,arr2,color2),
})
// for (let index = 0; index < 7; index++) {
// arr3.push(arr2[index])
// }
for (let index = 0; index < 7; index++) {
arr3.push(arr2[index])
})
app.globalData.request({action: 'getHomeBrandSourceType0528', sType: 'Home', sTimeType: sTimeType, sStartTime: sStartTime,sEndTime: sEndTime, sQueryType: 2}).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<ele.value.length;i++){
arr1[i].push(ele.value[i].value)
}
})
this.setData({
brandOption:sHistogram(arr,arr1,arr3,color2),
modelOption:sHistogram(arr,arr1,arr2,color2),
})
console.log('111',arr)
console.log('111',arr1)
console.log('111',arr3)
setTimeout(() =>{
wx.hideToast();
},500)
})
},
},
methods: {
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
},
}
})

@ -1,6 +1,6 @@
<view>
<!-- 时间组件 -->
<time-component></time-component>
<time-component bindchange="changeTime"></time-component>
<view class="brand">
<view class="text">品牌传播声量</view>
<view class="brand_tu">

@ -14,7 +14,7 @@ export default function histogram(dx=[],ds=[],color1='',direction=true) {
show: false,
start: 50,
end: 10,
handleSize: 5
handleSize: 10
}],
// legend: {
// x:'15',

@ -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: { //分割线

Loading…
Cancel
Save