diff --git a/app.js b/app.js index f5e989e..cbec044 100644 --- a/app.js +++ b/app.js @@ -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); + } + }) + }) + }, } }) \ No newline at end of file diff --git a/components/option/pictographicOption.js b/components/option/pictographicOption.js index 9aedc4c..09a952d 100644 --- a/components/option/pictographicOption.js +++ b/components/option/pictographicOption.js @@ -24,7 +24,7 @@ export default function pictographicOption(dRegion=[],dValue=[]){ bottom:20, height:186, width:48, - left: 50, + left: 60, }, series: [ { diff --git a/pages/insight/pages/brandInsight/TutorInsight/index.js b/pages/insight/pages/brandInsight/TutorInsight/index.js new file mode 100644 index 0000000..5c744c9 --- /dev/null +++ b/pages/insight/pages/brandInsight/TutorInsight/index.js @@ -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 { + 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 + + 论坛洞察详情 + + + + + + + 论坛传播态势 + + + + + + 全网热议话题方向 + + + + + + + + + + + 传播TOP车型 + + + + + + TOP5车型传播态势 + + + + + \ No newline at end of file diff --git a/pages/insight/pages/brandInsight/TutorInsight/index.wxss b/pages/insight/pages/brandInsight/TutorInsight/index.wxss new file mode 100644 index 0000000..3a11a1e --- /dev/null +++ b/pages/insight/pages/brandInsight/TutorInsight/index.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/insight/pages/brandInsight/index.json b/pages/insight/pages/brandInsight/index.json index df98799..6f85a07 100644 --- a/pages/insight/pages/brandInsight/index.json +++ b/pages/insight/pages/brandInsight/index.json @@ -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": "品牌洞察" } \ No newline at end of file diff --git a/pages/insight/pages/brandInsight/index.wxml b/pages/insight/pages/brandInsight/index.wxml index 03f7105..ba8a1b9 100644 --- a/pages/insight/pages/brandInsight/index.wxml +++ b/pages/insight/pages/brandInsight/index.wxml @@ -39,5 +39,6 @@ + \ No newline at end of file diff --git a/pages/insight/pages/brandInsight/weiboInsight/index.js b/pages/insight/pages/brandInsight/weiboInsight/index.js index ccae758..13614f2 100644 --- a/pages/insight/pages/brandInsight/weiboInsight/index.js +++ b/pages/insight/pages/brandInsight/weiboInsight/index.js @@ -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: { diff --git a/pages/insight/pages/brandInsight/weiboInsight/index.wxml b/pages/insight/pages/brandInsight/weiboInsight/index.wxml index 7695376..4a044aa 100644 --- a/pages/insight/pages/brandInsight/weiboInsight/index.wxml +++ b/pages/insight/pages/brandInsight/weiboInsight/index.wxml @@ -107,7 +107,7 @@ 活跃用户地区 - + @@ -115,6 +115,41 @@ - + + + 微博内容TOP声量 + + + + + + + 车型热度 + + + + + + + + + + + + 排名 + 车型 + 传播量 + + + + + + + {{index >= 9 ? index + 1 : '0' + (index + 1)}} + + {{item.name}} + {{item.value}} + + \ No newline at end of file diff --git a/pages/insight/pages/brandInsight/weiboInsight/index.wxss b/pages/insight/pages/brandInsight/weiboInsight/index.wxss index 7b5a718..831cc7b 100644 --- a/pages/insight/pages/brandInsight/weiboInsight/index.wxss +++ b/pages/insight/pages/brandInsight/weiboInsight/index.wxss @@ -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; } \ No newline at end of file