zx 3 years ago
parent 2f8f2dad36
commit 3025b28a1e

@ -40,6 +40,29 @@ App({
}
})
})
}
},
requestMessage: function (params) {
return new Promise((resolve, reject) => {
wx.request({
url: 'http://cloud.sws010.com/api/v7.ashx',
data: {
version: "1",
...params
},
method: 'get',
success: function (res) {
//接口实际返回的内容在res.data中
if (res.data.Code == 1) {
resolve(res.data.Msg);
} else {
reject(res.data)
}
},
fail: function (err) {
reject(err);
}
})
})
},
}
})

@ -24,7 +24,7 @@ export default function pictographicOption(dRegion=[],dValue=[]){
bottom:20,
height:186,
width:48,
left: 50,
left: 60,
},
series: [
{

@ -0,0 +1,117 @@
import histogram from "../../../../../components/option/columnarOption"
import brokenLine from "../../../../../components/option/stackingLineOption"
import singleLine from "../../../../../components/option/sgOption"
import pictographicOption from '../../../../../components/option/pictographicOption'
const app = getApp();
const dColor=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6']
Component({
data: {
showChart: true,
detailData: '',
ttTransform: singleLine([],[]),
hotTopicData1: pictographicOption([],[]),
hotTopicData2: pictographicOption([],[]),
transTopModal: histogram([],[],[],'#20CC62'),
top5ModalTrans: brokenLine([],[],[],[]),
},
methods: {
getData() {
app.globalData.requestMessage({
action: 'getBbsInsightAnalysis', //论坛洞察详情
token: 't%2BrswgjvzGM=',
sType: 'BbsBrand',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
iBBsType: 1,
}).then(res => {
this.setData({detailData: res})
});
app.globalData.request({
action: 'getBbsCountTime', //论坛传播态势
token: 't%2BrswgjvzGM=',
sType: 'BbsBrand',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
iBBsType: 1,
}).then(res => {
let dx = []; let dValue = [];
res.forEach(ele => {
dx.push(ele.Time); dValue.push(ele.value)
});
this.setData({ ttTransform: singleLine(dValue,dx) })
});
app.globalData.request({
action: 'getHotTopic0528', //全网热议话题方向
token: 't%2BrswgjvzGM=',
sType: 'BbsBrand',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
iBBsType: 1,
}).then(res => {
let dr = []; let dv = []; let total = 0;
res.forEach(ele => {
dr.push(ele.key);
dv.push(ele.value);
total = total + ele.value*1
})
let dr1 = []; let dr2 = []; let dv1 = []; let dv2 = [];
for(let i = 0;i<dr.length;i++) {
if(i % 2 == 0) {
dr1.push(dr[i]);
dv1.push((dv[i]/total*100))
} else {
dr2.push(dr[i]);
dv2.push((dv[i]/total*100))
}
}
this.setData({
hotTopicData1: pictographicOption(dr1,dv1),
hotTopicData2: pictographicOption(dr2,dv2),
})
});
app.globalData.request({
action: 'getCartypeTop10', //传播TOP车型
token: 't%2BrswgjvzGM=',
sType: 'BbsBrand',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
iBBsType: 1,
}).then(res => {
let dx = []; let dValue = [];
for(let key in res) {
dx.push(key);
dValue.push(res[key]*1);
}
this.setData({ transTopModal: histogram(dx,dValue,[],'#20CC62')})
});
app.globalData.request({
action: 'getBbsBrandTime', //TOP车型传播态势
token: 't%2BrswgjvzGM=',
sType: 'BbsBrand',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
iBBsType: 1,
}).then(res => {
let dx = []; let dName = [];
let dValue = [[],[],[],[],[]];
res.forEach(ele => {
dx.push(ele.Time)
for(let i=0;i<ele.Data.length;i++) {
dValue[i].push(ele.Data[i].value*1);
if(dName.indexOf(ele.Data[i].key) == -1) {
dName.push(ele.Data[i].key)
}
}
});
this.setData({
top5ModalTrans: brokenLine(dName,dValue,dColor,dx)
})
});
}
},
lifetimes: {
attached() {
this.getData()
}
}
})

@ -0,0 +1,6 @@
{
"usingComponents": {
"c-echars": "../../../../../components/c-echars/index"
},
"component": true
}

@ -0,0 +1,38 @@
<view class="tu-content">
<view class="tu-item">
<view class="tu-chart-title">论坛洞察详情</view>
<view class="tu-chart-item" style="padding: 16rpx 0rpx 0rpx 32rpx;width: 100%;height: auto;">
<!-- {{detailData}} -->
<rich-text nodes="{{detailData}}"></rich-text>
</view>
</view>
<view class="tu-item">
<view class="tu-chart-title">论坛传播态势</view>
<view class="tu-chart-item" style="width: 110%;">
<c-echars showChart="{{showChart}}" canvasId="ttTrans-canvas" chartId="ttTransLine" chartOption="{{ttTransform}}" height="100%"></c-echars>
</view>
</view>
<view class="tu-item">
<view class="tu-chart-title">全网热议话题方向</view>
<view class="tt-area-item">
<view class="tt-area-item-chart">
<c-echars showChart="{{showChart}}" canvasId="qht-canvas" chartId="qht" chartOption="{{hotTopicData1}}" height="100%"></c-echars>
</view>
<view class="tt-area-item-chart">
<c-echars showChart="{{showChart}}" canvasId="qht-canvas" chartId="qht" chartOption="{{hotTopicData2}}" height="100%"></c-echars>
</view>
</view>
</view>
<view class="tu-item">
<view class="tu-chart-title">传播TOP车型</view>
<view class="tu-chart-item">
<c-echars showChart="{{showChart}}" canvasId="tttopModal-canvas" chartId="tttopModal" chartOption="{{transTopModal}}" height="100%"></c-echars>
</view>
</view>
<view class="tu-item">
<view class="tu-chart-title">TOP5车型传播态势</view>
<view class="tu-chart-item">
<c-echars showChart="{{showChart}}" canvasId="tp5modal-canvas" chartId="tp5modal" chartOption="{{top5ModalTrans}}" height="100%"></c-echars>
</view>
</view>
</view>

@ -0,0 +1,60 @@
.tu-content {
background-color: #f9f9f9;
}
.tu-item {
width: 628rpx;
/* height: 90%; */
margin: 16rpx 0rpx 32rpx 32rpx;
padding: 16rpx 60rpx 8rpx 0rpx;
background-color: #ffffff;
border-radius: 8rpx;
}
.tu-chart-title {
font-size: 18px;
padding-left: 32rpx;
font-weight: 600;
color: #333333;
}
.tu-chart-subTitle {
font-size: 12px;
padding-left: 32rpx;
margin-top: 8rpx;
color: #999999;
}
.tu-chart-item {
width: 110%;
height: 350rpx;
}
.tu-rank-list {
width: 125%;
margin: 32rpx;
}
.ranking{
display: flex;
justify-content: space-between;
font-size: 12px;
font-weight: 400;
color: #999999;
}
.ranking-number{
display: flex;
justify-content: space-between;
font-size: 14px;
font-weight: 600;
}
.rank_num {
width: 53rpx;
height: 40rpx
}
/* 热议话题方向 */
.tt-area-item {
display: flex;
justify-content: space-around;
width: 656rpx;
height: 410rpx;
padding: 32rpx 0 0 24rpx;
}
.tt-area-item-chart{
width: 318rpx;
height: 410rpx;
}

@ -2,7 +2,8 @@
"usingComponents": {
"time-component":"/components/timecomponent/index",
"total-review":"./totalReview/index",
"weibo-insight":"./weiboInsight/index"
"weibo-insight":"./weiboInsight/index",
"tutor-insight":"./TutorInsight/index"
},
"navigationBarTitleText": "品牌洞察"
}

@ -39,5 +39,6 @@
</van-tabs>
<total-review wx:if="{{compShow && tabActive == 0}}"></total-review>
<weibo-insight wx:if="{{compShow && tabActive == 1}}"></weibo-insight>
<tutor-insight wx:if="{{compShow && tabActive == 2}}"></tutor-insight>
</view>
</view>

@ -6,6 +6,7 @@ import pictographicOption from '../../../../../components/option/pictographicOpt
const app = getApp();
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
showChart: true,
weiboData: {},
weiboAff: {},
@ -20,7 +21,12 @@ Component({
weiboRegionData: [],
//活跃用户地区
activeUserArea1: pictographicOption([],[]),
activeUserArea2: pictographicOption([],[])
activeUserArea2: pictographicOption([],[]),
//微博内容TOP声量
weiboTopVolumn: histogram([],[],[],'#20CC62'),
//车型热度
modalHotActive: 0,
modalHotData: [],
},
methods: {
getData() {
@ -126,6 +132,21 @@ Component({
activeUserArea2: pictographicOption(dr2,dv2),
})
});
app.globalData.request({
action: 'getDirectWeiBo0528', //微博内容TOP声量
token: 't%2BrswgjvzGM=',
sType: 'BrandWeiBo',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
}).then(res => {
let dx = []; let dValue = [];
res.forEach(ele => {
dx.push(ele.key);
dValue.push(ele.value*1);
});
this.setData({ weiboTopVolumn: histogram(dx,dValue,[],'#20CC62')})
});
this.getModalHot();
},
getUserChar() {
app.globalData.request({
@ -176,9 +197,79 @@ Component({
this.setData({ weiboRegionData: sexArr,weiboUserChart: circleOption(sexArr)})
});
},
getModalHot() {
if(this.data.modalHotActive == 0) {
app.globalData.request({
action: 'getCartypeWeiBo0528', //车型热度-热门
token: 't%2BrswgjvzGM=',
sType: 'BrandWeiBo',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
}).then(res => {
let arr = [];
for(let key in res) {
let obj = {name: key, value: res[key]};
arr.push(obj)
};
this.setData({modalHotData: arr})
});
} else if(this.data.modalHotActive == 1) {
app.globalData.request({
action: 'getTopCarseriesObj', //车型热度-热赞
token: 't%2BrswgjvzGM=',
sType: 'BrandWeiBo',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
iType: 1,
}).then(res => {
let arr = [];
res.forEach(ele => {
let obj = {name: ele.key, value: ele.value};
arr.push(obj)
})
this.setData({modalHotData: arr})
});
} else if(this.data.modalHotActive == 2) {
app.globalData.request({
action: 'getTopCarseriesObj', //车型热度-热议
token: 't%2BrswgjvzGM=',
sType: 'BrandWeiBo',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
iType: 2,
}).then(res => {
let arr = [];
res.forEach(ele => {
let obj = {name: ele.key, value: ele.value};
arr.push(obj)
})
this.setData({modalHotData: arr})
});
} else {
app.globalData.request({
action: 'getTopCarseriesObj', //车型热度-热转
token: 't%2BrswgjvzGM=',
sType: 'BrandWeiBo',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sBrand: wx.getStorageSync('sBrand') || '',
iType: 3,
}).then(res => {
let arr = [];
res.forEach(ele => {
let obj = {name: ele.key, value: ele.value};
arr.push(obj)
})
this.setData({modalHotData: arr})
});
}
},
changeActive(event) {
this.setData({weiboUserTabActibe: event.detail.index});
this.getUserChar()
},
changeModalHot(event) {
this.setData({modalHotActive: event.detail.index})
this.getModalHot()
}
},
lifetimes: {

@ -107,7 +107,7 @@
</view>
<view class="wb-item">
<view class="wb-chart-title">活跃用户地区</view>
<view class="area-item">
<view class="area-item" style="padding-left: 16rpx;">
<view class="area-item-chart">
<c-echars showChart="{{showChart}}" canvasId="aua-canvas" chartId="aua" chartOption="{{activeUserArea1}}" height="100%"></c-echars>
</view>
@ -115,6 +115,41 @@
<c-echars showChart="{{showChart}}" canvasId="aua-canvas" chartId="aua" chartOption="{{activeUserArea2}}" height="100%"></c-echars>
</view>
</view>
</view>
<view class="wb-item">
<view class="wb-chart-title">微博内容TOP声量</view>
<view class="wb-chart-item">
<c-echars showChart="{{showChart}}" canvasId="wbtopVolumn-canvas" chartId="wbtopVolumn" chartOption="{{weiboTopVolumn}}" height="100%"></c-echars>
</view>
</view>
<view class="wb-item">
<view class="wb-area-title">
<view style="width: 35%;">车型热度</view>
<view style="width: 65%;">
<van-tabs type="card" active="{{ modalHotActive }}" color="#BBBBBB" bind:change="changeModalHot">
<van-tab title="热门"></van-tab>
<van-tab title="热赞"></van-tab>
<van-tab title="热议"></van-tab>
<van-tab title="热转"></van-tab>
</van-tabs>
</view>
</view>
<view class="wb-rank-list">
<view class="ranking">
<view style="width: 33%;">排名</view>
<view style="width: 33%;">车型</view>
<view style="width: 33%;">传播量</view>
</view>
<view class="ranking-number" wx:for="{{modalHotData}}" wx:key="index" wx:if="{{index < 10}}" >
<view style="width: 33%;margin-top: 32rpx;color: #999999;">
<image class="rank_num" wx:if="{{index === 0}}" src="{{imageUrl}}/img_diyi.png"></image>
<image class="rank_num" wx:if="{{index === 1}}" src="{{imageUrl}}/img_dier.png"></image>
<image class="rank_num" wx:if="{{index === 2}}" src="{{imageUrl}}/img_disan.png"></image>
<view class="num" wx:if="{{index !== 0 &&index !== 1 &&index !== 2 }}">{{index >= 9 ? index + 1 : '0' + (index + 1)}}</view>
</view>
<view style="width: 33%;margin-top: 32rpx;color: #333333">{{item.name}}</view>
<view style="width: 33%;margin-top: 32rpx;color: #0084FF">{{item.value}}</view>
</view>
</view>
</view>
</view>

@ -5,7 +5,7 @@
width: 628rpx;
/* height: 90%; */
margin: 16rpx 0rpx 32rpx 32rpx;
padding: 16rpx 60rpx 16rpx 0rpx;
padding: 16rpx 60rpx 8rpx 0rpx;
background-color: #ffffff;
border-radius: 8rpx;
}
@ -82,4 +82,26 @@
.area-item-chart{
width: 358rpx;
height: 410rpx;
}
/* 车型热度排行 */
.wb-rank-list {
width: 125%;
margin: 32rpx;
}
.ranking{
display: flex;
justify-content: space-between;
font-size: 12px;
font-weight: 400;
color: #999999;
}
.ranking-number{
display: flex;
justify-content: space-between;
font-size: 14px;
font-weight: 600;
}
.rank_num {
width: 53rpx;
height: 40rpx;
}
Loading…
Cancel
Save