wylyl22 3 years ago
parent 9f99672df8
commit 5b7bf08360

@ -5,7 +5,7 @@ const data2= [600,700,800,900,1000,1200,1300,1400,1500,1600,1700,1900,2000,2100,
Component({
data: {
showChart: true,
brandOption: histogram(data,data2,'#0084FF',false)
brandOption: histogram(data,data2,[],'#0084FF',false)
,
},

@ -11,7 +11,6 @@ const dValue=[
[25, 167, 564, 256, 1009, 2000, 140]]
const dColor=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF']
const dx=['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00']
Component({
data: {
// totallist:totallist,

@ -1,39 +1,41 @@
const app = getApp();
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
bgImage: "background-image: url("+ getApp().globalData.imageUrl + "/sj_beijin.png)",
questes: [
{
tip: '比亚迪宋MAX紧凑型mpv你看了不...',
title: '72.45',
subtitle: '媒体测评',
},
{
tip: '今日上市长城SUV',
title: '72.45',
subtitle: '媒体测评',
},
{
tip: '子龙来也捷途X90子龙',
title: '72.45',
subtitle: '媒体测评',
},
{
tip: '全新一代蒙迪欧亮相',
title: '72.45',
subtitle: '媒体测评',
},
{
tip: '新款比亚迪汉DM-i即将上市',
title: '72.45',
subtitle: '媒体测评',
},
{
tip: '全新一代蒙迪欧亮相',
title: '72.45',
subtitle: '媒体测评',
}
],
questes:[],
// [
// {
// tip: '比亚迪宋MAX紧凑型mpv你看了不...',
// title: '72.45',
// subtitle: '媒体测评',
// },
// {
// tip: '今日上市长城SUV',
// title: '72.45',
// subtitle: '媒体测评',
// },
// {
// tip: '子龙来也捷途X90子龙',
// title: '72.45',
// subtitle: '媒体测评',
// },
// {
// tip: '全新一代蒙迪欧亮相',
// title: '72.45',
// subtitle: '媒体测评',
// },
// {
// tip: '新款比亚迪汉DM-i即将上市',
// title: '72.45',
// subtitle: '媒体测评',
// },
// {
// tip: '全新一代蒙迪欧亮相',
// title: '72.45',
// subtitle: '媒体测评',
// }
// ],
content:[
{
time: '2022-04-29 23:00:00',
@ -63,25 +65,29 @@ Component({
},
methods: {
bindtaps(){
wx.request({
url: 'http://cloud.sws010.com/api/v7.ashx',
method:"POST",
data:{
action:"getEventsListH",
sType: 'Home',
sTimeType: 3,
sQuDao: 1,
iTimeType:1
},
success:(res)=>{
console.log(res.Data)
}
lifetimes: {
attached() {
app.globalData.request({action: 'getEventsListH', sType: 'Home', sTimeType: 3}).then(res => {
const arr = []
res.forEach(ele => {
let obj = {
title: ele.events_title,
num: ele.events_influence,
brand:ele.events_brand
}
arr.push(obj)
})
this.setData({
// countYear: data.count_year,
// count6month: data.count_6month,
// countAll: data.count_all,
questes: arr
})
})
},
},
methods: {
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index

@ -5,13 +5,13 @@
<view class="event_title" bindtap="bindtaps">热点事件</view>
<view class="event_content" wx:for="{{questes}}" wx:if="{{index < 5}}" wx:key="index" data-quest='{{item}}'>
<view class="event_text">
<view class="text_title">{{item.tip}}
<view class="text_title">{{item.title}}
</view>
<view class="text_num">{{item.title}}
<view class="text_num">{{item.num}}
</view>
</view>
<view class="event_text">
<view class="text_pinpai">关联品牌:{{item.subtitle}}
<view class="text_pinpai">关联品牌:{{item.brand}}
</view>
<view class="text_pinpai">影响力
</view>

@ -1,4 +1,5 @@
const app = getApp();
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
@ -31,34 +32,32 @@ Component({
ranking:[]
},
lifetimes: {
// console.log('111',this.data.media),
attached() {
app.globalData.request({action: 'getWebsiteHome0528', sType: 'Home',sTimeType: 34,}).then(res => {
const data = res;
const ranking = data.ranking || [];
app.globalData.request({action: 'getWebsiteHome0528', sType: 'Home', sTimeType: 34}).then(res => {
const arr = []
arr.push({
volume: 250799,
media: '抖音',
})
ranking.forEach(ele => {
let obj = {
media: ele.value,
volume: ele.key,
}
arr.push(obj)
})
let a=res
// a.forEach(ele => {
// let obj = {
// title: key,
// num: this.data[key],
// }
// arr.push(obj)
// })
this.setData({
ranking: arr
// countYear: data.count_year,
// count6month: data.count_6month,
// countAll: data.count_all,
ranking: a
})
})
},
},
onLoad(){
console.log('121',this.data.arr)
},
methods: {
a(){
console.log()
},
}
})

@ -2,7 +2,7 @@
<!-- 时间组件 -->
<time-component></time-component>
<view class="list_event">
<view class="event_title">传播重点媒体排行</view>
<view class="event_title" bindtap="a">传播重点媒体排行</view>
<view class="ranking">
<view class="title">排名</view>
<view class="title">媒体</view>

@ -1,198 +1,14 @@
import histogram from "../../option/columnarOption"
const data1=['大众速腾', '激励帝豪', '吉利星越', '奥迪A4', '奥迪Q5']
const data2=[1400, 2000, 1500, 1800, 1490, 900, 310]
const data3=['尾翼互动量']
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
showChart: true,
brandOption: {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
confine: true
},
legend: {
x:'15',
icon: 'rectangle',//data图标样式
itemWidth: 10,//data图标大小
itemHeight: 10,
textStyle: {
fontSize: 9
},
data: ['尾翼互动量'],
},
//图表位置
grid: {
left: 20,
right: 20,
bottom: 15,
top: 40,
containLabel: true
},
yAxis: [
{
type: 'value',
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false //去除轴线
},
axisLabel: {
color: '#999999',//y轴文本颜色
textStyle: {
fontSize : 9
}
},
splitLine: { //分割线
// lineStyle:{
// // color:"#2d3436"
// }
show: true,
lineStyle: {
type: 'dashed',
color: '#E8E8E8',
}
}
}
],
xAxis: [
{
type: 'category',
data: ['长安', '大众', '丰田', '吉利', '哈佛'],
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false, //去除轴线
},
axisLabel: {
color: '#999999',//x轴文本颜色
textStyle: {
fontSize : 9
}
}
}
],
series:
{
barWidth : 24,
type: 'bar',
data: [1400, 2000, 1500, 1800, 1490, 900, 310],
stack:"Search Engine",
emphasis: {//折线图的高亮状态。
focus: "series",//聚焦当前高亮的数据所在的系列的所有图形。
},
itemStyle: {
normal:{
color: '#00AAFF',
lineStyle: {
color: '#00AAFF'
}
}
}
},
},
modelOption: {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
confine: true
},
legend: {
x:'15',
icon: 'rectangle',//data图标样式
itemWidth: 10,//data图标大小
itemHeight: 10,
textStyle: {
fontSize: 9
},
data: ['尾翼互动量'],
},
//图表位置
grid: {
left: 20,
right: 20,
bottom: 15,
top: 40,
containLabel: true
},
yAxis: [
{
type: 'value',
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false //去除轴线
},
axisLabel: {
color: '#999999',//y轴文本颜色
textStyle: {
fontSize : 9
}
},
splitLine: { //分割线
// lineStyle:{
// // color:"#2d3436"
// }
show: true,
lineStyle: {
type: 'dashed',
color: '#E8E8E8',
}
}
}
],
xAxis: [
{
type: 'category',
data: ['大众速腾', '激励帝豪', '吉利星越', '奥迪A4', '奥迪Q5'],
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false, //去除轴线
},
axisLabel: {
color: '#999999',//x轴文本颜色
textStyle: {
fontSize : 9
}
}
}
],
series:
{
barWidth : 24,
type: 'bar',
data: [1400, 2000, 1500, 1800, 1490, 900, 310],
stack:"Search Engine",
emphasis: {//折线图的高亮状态。
focus: "series",//聚焦当前高亮的数据所在的系列的所有图形。
},
itemStyle: {
normal:{
color: '#20CC62',
lineStyle: {
color: '#20CC62'
}
}
}
},
},
brandOption: histogram(data1,data2,data3,'#0084FF'),
modelOption: histogram(data1,data2,data3,'#20CC62'),
},
onShow() {
this.getTabBar().init();

@ -1,3 +1,5 @@
const app = getApp();
import sHistogram from "../../option/sColumnarOption"
const dx=['长安','大众','丰田','吉利','哈佛']
const ds=[
@ -22,7 +24,7 @@ Component({
this.getTabBar().init();
},
methods: {
priceSel(e){
this.setData({

@ -1,6 +1,6 @@
// 柱状
export default function histogram(dx=[],ds=[],data=[],color1='', direction=true) {
// direction true为垂直 fales为水平
// 柱状
export default function histogram(dx=[],ds=[],data=[],color1='',direction=true) {
// direction true为垂直 false为水平
return {
tooltip: {
trigger: 'axis',
@ -27,34 +27,7 @@ export default function histogram(dx=[],ds=[],data=[],color1='', direction=true)
top: 20,
containLabel: true
},
yAxis:direction?[
{
type: 'value',
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false //去除轴线
},
axisLabel: {
color: '#999999',//y轴文本颜色
textStyle: {
fontSize : 9
}
},
splitLine: { //分割线
// lineStyle:{
// // color:"#2d3436"
// }
show: true,
lineStyle: {
type: 'dashed',
color: '#E8E8E8',
}
}
}
]:[
xAxis: direction?[
{
type: 'category',
data: dx,
@ -72,26 +45,34 @@ export default function histogram(dx=[],ds=[],data=[],color1='', direction=true)
}
}
],
xAxis: direction?[
]:[
{
type: 'category',
data: dx,
type: 'value',
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false, //去除轴线
show:false //去除轴线
},
axisLabel: {
color: '#999999',//x轴文本颜色
color: '#999999',//y轴文本颜色
textStyle: {
fontSize : 9
}
},
splitLine: { //分割线
// lineStyle:{
// // color:"#2d3436"
// }
show: true,
lineStyle: {
type: 'dashed',
color: '#E8E8E8',
}
}
}
]:[
],
yAxis:direction?[
{
type: 'value',
axisTick:{
@ -118,17 +99,25 @@ export default function histogram(dx=[],ds=[],data=[],color1='', direction=true)
}
}
}
]:[
{
type: 'category',
data: dx,
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false, //去除轴线
},
axisLabel: {
color: '#999999',//x轴文本颜色
textStyle: {
fontSize : 9
}
}
}
],
series:columar(data,ds,color1)
}
}
function columar(data=[],ds=[],color1=''){
// MS判断多条数据还是单条数据 true为单条false为多条
let list=[]
for (let i = 0; i < 1; i++) {
list.push({
series:{
type: 'bar',
data: ds,
stack:"Search Engine",
@ -138,16 +127,27 @@ function columar(data=[],ds=[],color1=''){
itemStyle: {
normal:{
color: color1,
lineStyle: {
color: color1
}
// lineStyle: {
// color: color1
// }
}
}
})
}
return list
}
}
// function columar(data=[],ds=[],color1=''){
// // MS判断多条数据还是单条数据 true为单条false为多条
// let list=[]
// for (let i = 0; i < 1; i++) {
// list.push({
// })
// }
// return list
// }

@ -1,4 +1,4 @@
// 柱状
// 多条柱状
export default function sHistogram(dx=[],ds=[],data=[],color2=[]) {
// MS判断多条数据还是单条数据 true为单条false为多条
return {

@ -0,0 +1,72 @@
// 折线
export default function brokenLine(dName=[],dValue=[] ,dColor=[],dx=[]){
return{
grid:{
left:30,
top:25,
height:146,
width:323
},
yAxis: [
{
type: 'value',
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false //去除轴线
},
axisLabel: {
color: '#999999',//y轴文本颜色
textStyle: {
fontSize : 9
}
},
splitLine: { //分割线
// lineStyle:{
// // color:"#2d3436"
// }
show: true,
lineStyle: {
type: 'dashed',
color: '#E8E8E8',
}
}
}
],
xAxis: [
{
type: 'category',
data: dx,
axisTick:{
show:false //去除刻度线
},
axisLine:{
show:false, //去除轴线
},
axisLabel: {
color: '#999999',//x轴文本颜色
textStyle: {
fontSize : 9
}
}
}
],
series:{
type: 'line',
symbol:'none', //去圆点
data: dValue,
itemStyle: {
normal:{
color: '#0084FF',
lineStyle: {
color: '#0084FF'
}
}
}}
}
}

@ -18,7 +18,6 @@ Page({
value:0,
// 时间
priceOpt: ['2022年5月','2022年4月','2022年3月',
'2022年2月','2022年1月','2021年12月',
'2021年11月','2021年10月','2021年9月',
'2021年8月','2021年7月','2021年6月',

@ -3,11 +3,11 @@
<van-tabs bind:change="onChange">
<van-tab title="品牌">
<view>
<view class="list_event" wx:if="{{item.value1===1}}">
<view class="list_event">
<view class="text">销量排行榜</view>
<chart-display></chart-display>
</view>
<view class="list_event" wx:else>
<view class="list_event" >
<view class="text">销量排行榜</view>
<view class="ranking">
<view class="title">排名</view>

@ -49,6 +49,13 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/index/Rankdetail/Rankdetail",
"query": "",
"launchMode": "default",
"scene": null
}
]
}

Loading…
Cancel
Save