主题对比

dev
Esdese 3 years ago
parent 7d789b35a9
commit 95e4bb7e79

@ -30,6 +30,7 @@
"pages/varComm/pages/eventRatio/index",
"pages/varComm/pages/addEvent/index",
"pages/varComm/pages/carModelsRatio/index",
"pages/varComm/pages/theme/index",
"pages/brandCrisis/index",
"pages/detail/index",
"pages/brandCrisis/crisiSet/index",

@ -3,6 +3,7 @@
"c-echars": "../../components/c-echars/index",
"event-child":"./pages/event/index",
"brand-child":"./pages/brand/index",
"model-child":"./pages/carModels/index"
"model-child":"./pages/carModels/index",
"theme-child":"./pages/theme/index"
}
}

@ -4,6 +4,6 @@
<van-tab title="品牌对比"><brand-child wx:if="{{active===0}}"></brand-child></van-tab>
<van-tab title="车型对比"><model-child wx:if="{{active===1}}"></model-child></van-tab>
<van-tab title="事件对比"><event-child wx:if="{{active===2}}"></event-child></van-tab>
<van-tab title="主题对比">内容 4</van-tab>
<van-tab title="主题对比"><theme-child wx:if="{{active===3}}"></theme-child></van-tab>
</van-tabs>
</view>

@ -34,12 +34,12 @@
<van-tabs class="view-tabs" active="{{ tabActive }}" bind:change="changeTab" swipe-threshold="3" >
<van-tab title="概括" wx:key="0"></van-tab>
<van-tab title="微博对比" wx:key="1"></van-tab>
<van-tab title="尾翼对比" wx:key="3"></van-tab>
<van-tab title="尾翼对比" wx:key="2"></van-tab>
</van-tabs>
<view class="content_box" wx:if="{{sonCom}}">
<survey wx:if="{{tabActive==0}}"></survey>
<weibo wx:if="{{tabActive==1}}"></weibo>
<thetail wx:if="{{tabActive==3}}"></thetail>
<thetail wx:if="{{tabActive==2}}"></thetail>
</view>
</view>

@ -1,51 +1,35 @@
import brokenLines from "../../../../../components/option/stackingLineOption"
import histogram from "../../../../../components/option/singleColumnarOption"
import stack from "../../../../../components/option/stackedBarChart"
import multipleColumn from "../../../../../components/option/multipleColumn"
import sHistogram from "../../../../../components/option/sColumnarOption"
const app = getApp()
const dColor = ['#FF4852', '#FF6E25', '#FFBF00', '#20CC62', '#00D6D6', '#00AAFF', '#7257FF']
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
showChart: true,
transformOption: brokenLines([], [], [], []),
transformOption2: brokenLines([], [], [], []),
brandOption: histogram([], [], [], '#0084FF'),
brandOption2: histogram([], [], [], '#20cc62'),
brandOption3: multipleColumn([], [], []),
brandOption4: sHistogram(),
brandOption5: multipleColumn([], [], []),
stackOption: stack([], [], ['#00aaff', '#20cc62', '#ff4852']),
boxArr: new Array(6),
topActive: 0, //品牌传播
brandTop: [],
brandTopData: [],
cloudActive: 0, //词云
positiveWord: [],
negativeWord: [], //负面
brandTopData: []
},
lifetimes: {
attached() {
console.log(123345);
let brandRatioTime = wx.getStorageSync('brandRatioTime')
let sBrand = wx.getStorageSync('sBrand')
let eventData = wx.getStorageSync('eventData')
this.setData({
boxArr: wx.getStorageSync('modelsData')
boxArr: eventData
})
let SeriesName = []
let sRele = []
this.data.boxArr.forEach((ele) => {
if (ele) SeriesName.push(ele.name)
if (ele) sRele.push(ele.events_id)
})
//品牌传播TOP媒体
// 品牌传播TOP媒体
app.globalData.request({
action: 'getSourceTopCount0528C',
token: wx.getStorageSync('token'),
sType: 'BrandWeiYi',
...brandRatioTime,
iContrastType: '2',
iSize:'10',
sBrand:sBrand.join(','),
sSeriesName: SeriesName.join(',')
iContrastType: '3',
sRele:sRele.join(',')
}).then(res => {
this.setData({
brandTop: [res[0], res[1]],
@ -57,12 +41,9 @@ Component({
action: 'getCountTime0528C',
token: wx.getStorageSync('token'),
sType: 'BrandWeiYi',
iContrastType: '2',
...brandRatioTime,
sBrand:sBrand.join(','),
sSeriesName: SeriesName.join(',')
iContrastType: '3',
sRele:sRele.join(',')
}).then(res => {
console.log(res);
let dDate = []
let dVal = new Array(res[0].value.length).fill([])
dVal = dVal.map(ele => {
@ -78,28 +59,10 @@ Component({
}
this.setData({
salesDate: res.Time,
transformOption2: brokenLines(SeriesName, dVal, dColor, dDate),
transformOption2: brokenLines(['事件一','事件二'], dVal, ['#1282e6','#30c86e'], dDate),
})
})
},
},
methods: {
//品牌传播top媒体
changeModalHot(event) {
let obj = {
0: [this.data.brandTopData[0] || {}, this.data.brandTopData[1] || {}],
1: [this.data.brandTopData[2] || {}, this.data.brandTopData[3] || {}],
2: [this.data.brandTopData[4] || {}, this.data.brandTopData[5] || {}]
}
let index = event.detail.index
this.setData({
topActive: index,
brandTop: obj[index]
})
},
changeModalHot2(event) {
},
}
})

@ -8,21 +8,13 @@
<view class="top_box">
<view class="top-title">
<view style="width: 45%;">尾翼TOP媒体</view>
<view style="width:50%;margin-right: 32rpx;">
<van-tabs type="card" active="{{ topActive }}" color="#BBBBBB" bind:change="changeModalHot">
<van-tab title="组一"></van-tab>
<van-tab title="组二" wx:if="{{brandTopData.length>2}}"></van-tab>
<van-tab title="组三" wx:if="{{brandTopData.length>4}}"></van-tab>
</van-tabs>
</view>
</view>
<view style="font-size:32rpx;margin-left:30rpx;">{{brandTop[0].key}}</view>
<view style="font-size:32rpx;margin-left:30rpx;">事件一</view>
<view class="rank_list">
<view class="ranking">
<view style=" display: inline-block;">排名</view>
<view style=" display: inline-block;margin-left: 172rpx;">车型</view>
<view style=" display: inline-block;margin-left: 272rpx;">传播量</view>
<view style=" display: inline-block;margin-left: 250rpx;">传播量</view>
</view>
<view class="ranking_cell" wx:for="{{brandTop[0].value}}" wx:for-item="item" wx:if="{{index>=0 && index<=4}}" wx:key="V">
<view wx:if="{{index==0}}">
@ -40,12 +32,12 @@
</view>
</view>
<view class="henxian"></view>
<view style="font-size:32rpx;margin-left:30rpx;">{{brandTop[1].key}}</view>
<view style="font-size:32rpx;margin-left:30rpx;">事件二</view>
<view class="rank_list">
<view class="ranking" wx:if="{{brandTop[1].key}}">
<view style=" display: inline-block;">排名</view>
<view style=" display: inline-block;margin-left: 172rpx;">车型</view>
<view style=" display: inline-block;margin-left: 272rpx;">传播量</view>
<view style=" display: inline-block;margin-left: 250rpx;">传播量</view>
</view>
<view class="ranking_cell" wx:for="{{brandTop[1].value}}" wx:for-item="item" wx:if="{{index>=0 && index<=4}}" wx:key="S">
<view wx:if="{{index==0}}">

@ -0,0 +1,12 @@
var method = {
stringify: function (val) {
return JSON.stringify(val)
},
getStorage:function(val){
return wx.getStorageSync(val)
}
}
module.exports = {
stringify: method.stringify,
getStorage:method.getStorage
}

@ -0,0 +1,80 @@
import Dialog from '../../../../miniprogram_npm/@vant/weapp/dialog/dialog';
const app = getApp()
Component({
data: {
eventList: [],
result: [],
boxArr:new Array(6).fill(undefined),
show:false,
},
methods: {
startCp(){
wx.setStorageSync('eventData', this.data.boxArr)
wx.navigateTo({
url: `/pages/varComm/pages/eventRatio/index`,
})
},
onClose(){
this.setData({
show:false
})
},
add(){
wx.navigateTo({
url: 'pages/addEvent/index',
})
},
del(e){
let index = e.currentTarget.dataset.index
let result = [...this.data.result]
let boxArr = []
result.splice(index,1)
for(let i of result){
boxArr.push(JSON.parse(i))
}
boxArr.length = 6
this.setData({
result:result,
boxArr:boxArr
})
},
onChange(event) {
const {
detail
} = event
console.log(detail);
if(detail.length>6){
console.log("至多六个");
return
}
let boxArr = []
for(let i of detail){
let obj = JSON.parse(i)
boxArr.push(obj)
}
boxArr.length = 6
this.setData({
result: detail,
boxArr:boxArr
})
},
},
lifetimes: {
attached() {
console.log(132345);
app.globalData.request({
action: 'getEventList',
token: wx.getStorageSync('token'),
sType: 'HotLibraryC',
iPageIndex: 1,
iPageSize: 4,
sTimeType: 20
}).then(res => {
this.setData({
eventList: res
})
})
},
},
})

@ -0,0 +1,5 @@
{
"usingComponents": {},
"component": true
}

@ -0,0 +1,72 @@
<wxs src="./filter.wxs" module="filter"></wxs>
<view class="box">
<!-- <scroll-view scroll-x="true" style=" white-space: nowrap; display: flex"> -->
<view class="add">
<view wx:for="{{boxArr}}" wx:key="{{item.events_id}}" style="margin-left: 32rpx;width: 280rpx;">
<view class="add_box" bindtap="add" wx:if="{{item == undefined }}" data-index="{{index}}">
<view class="heng"></view>
<view class="shu"></view>
<view class="event">添加主题一</view>
</view>
<view class="del_box" wx:else>
<view class="del_top">
<view style="display:inline-block;margin-left:26rpx;">
<van-icon name="sort" size="12px" color="white" />
<text style="font-size: 24rpx; color: rgba(255, 255, 255, 1);">切换</text>
</view>
<view style="display:inline-block;margin-left:32rpx;color: rgba(255, 255, 255, 1);">|</view>
<view style="display:inline-block;margin-left:36rpx;" bindtap="del" data-index="{{index}}">
<van-icon name="cross" size="12px" color="white" />
<view style="margin-left: 2rpx; display: inline-block;"></view>
<text style="font-size: 24rpx; color: rgba(255, 255, 255, 1);">删除</text>
</view>
</view>
<view class="del_title">
{{item.events_title}}
</view>
<view class="del_foot">
<text>主题</text>
</view>
</view>
</view>
</view>
<!-- </scroll-view> -->
<button class="btns" bindtap='startCp'>开始对比</button>
<view class="event_recom">
<van-checkbox-group value="{{ result }}" bind:change="onChange">
<text style="font-size: 40rpx;font-weight: bolder;">主题推荐</text>
<view class="event_card" wx:for="{{eventList}}" wx:key="idxa">
<view class="card_head">
<van-checkbox name="{{filter.stringify(item)}}" shape="square" class="van-checkbox"></van-checkbox>
<view style="display: inline-block; font-size: 24rpx;color: rgba(153, 153, 153, 1);margin-left:16rpx;">
{{item.maxSourcetime}}
</view>
<view class="tag"> {{item.events_type}}</view>
</view>
<view class="card_title">
<text>{{item.events_title}}</text>
</view>
<view class="card_label" style="margin-top: 32rpx;">
<text style="color: rgba(153, 153, 153, 1);">文章篇数(条)</text>
<text>{{item.events_count}}</text>
</view>
<view class="card_label" style="margin-top: 24rpx;">
<text style="color: rgba(153, 153, 153, 1);">相关品牌</text>
<text>{{item.events_brand}}</text>
</view>
<view class="card_label" style="margin-top: 24rpx;">
<text style="color: rgba(153, 153, 153, 1);">相关车型</text>
<text>{{item.events_series}}</text>
</view>
<view class="card_label" style="margin-top: 24rpx;">
<text style="color: rgba(153, 153, 153, 1);">传播周期(条)</text>
<text>{{item.events_influence}}</text>
</view>
</view>
</van-checkbox-group>
</view>
<van-popup show="{{ show }}" position="bottom" custom-style="height: 70%;" bind:close="onClose" />
</view>

@ -0,0 +1,168 @@
/* pages/varComm/pages/event/index.wxss */
page {
background-color: #f9f9f9;
}
.box {
/* height:400rpx; */
background: #006bff;
padding-top: 16rpx;
}
.add {
height: 222rpx;
/* background-color: pink; */
/* width: 100%; */
display: flex;
overflow: hidden;
overflow-x: auto;
white-space:nowrap;
}
.del_box{
height: 218rpx;
width: 280rpx;
background-color: #339cff;
border-radius: 8rpx;
border: 2rpx solid #85c3ff;
}
.del_title{
overflow:hidden;
text-overflow: ellipsis;
display:-webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient: vertical;
width:232rpx;margin-left: 24rpx;font-size: 28rpx;color: rgba(255, 255, 255, 1);height: 72rpx;
margin-top: 20rpx;
}
.del_foot{
width:280rpx;
margin-left: 24rpx;
margin-top: 16rpx;
color:rgba(255, 255, 255, 0.6000);
font-size: 24rpx;
display: flex;
justify-content: space-between;
}
.del_top{
height:62rpx ;
width: 100%;
/* background: pink; */
border-bottom: 1rpx solid;
line-height:62rpx ;
border-image: linear-gradient(to right, rgba(245, 245, 245, 0), rgba(238, 238, 238, 1), rgba(232, 232, 232, 0))1;
}
.add_box {
height: 218rpx;
width: 280rpx;
background-color: #339cff;
border-radius: 8rpx;
border: 2rpx solid #85c3ff;
}
.heng {
height: 8rpx;
width: 72rpx;
background: white;
border-radius: 6rpx;
position: relative;
left: 104rpx;
top: 82rpx
}
.shu {
width: 8rpx;
height: 72rpx;
background: white;
border-radius: 6rpx;
position: relative;
left: 136rpx;
top: 45rpx
}
.event {
display: inline-block;
color: white;
font-size: 28rpx;
margin-left: 70rpx;
margin-top: 60rpx;
}
.btns {
margin-top: 32rpx;
width: 686rpx;
height: 88rpx;
font-weight: bold;
line-height: 88rpx;
color: rgba(0, 132, 255, 1);
font-size: 28rpx;
}
.event_recom {
margin-top: 32rpx;
min-height: 1000rpx;
background-color: #f9f9f9;
border-top-left-radius: 24rpx;
border-top-right-radius: 24rpx;
padding-top: 32rpx;
padding-left: 32rpx;
}
.event_card {
width: 686rpx;
height: 350rpx;
background-color: white;
margin-top: 32rpx;
padding-top: 36rpx;
}
.card_head {
margin-left: 32rpx;
}
checkbox .wx-checkbox-input {
height: 32rpx;
width: 32rpx;
}
.tag {
display: inline-block;
background: #f0f8ff;
color: rgba(0, 132, 255, 1);
width: 128rpx;
height: 40rpx;
font-size: 24rpx;
text-align: center;
line-height: 40rpx;
margin-left: 210rpx;
}
.card_title{
overflow:hidden;
text-overflow: ellipsis;
display:-webkit-box;
-webkit-line-clamp:1;
-webkit-box-orient: vertical;
margin-left: 32rpx;
margin-top: 24rpx;
font-size: 32rpx;
font-weight: bolder;
}
.card_label{
width: 622rpx;
margin-left: 32rpx;
display: flex;
font-size: 28rpx;
height: 24rpx;
justify-content:space-between;
}
.van-checkbox__icon {
margin-left: 32rpx ;
font-size: 32rpx !important;
}
.van-image{
margin-left: 48rpx;
margin-top: 6rpx;
}
.card_head .van-checkbox{
display: inline-block !important;
}
Loading…
Cancel
Save