You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
5.7 KiB
140 lines
5.7 KiB
import histogram from "../../../../../components/option/singleColumnarOption"
|
|
import singleLine from "../../../../../components/option/sgOption"
|
|
import pieOption from '../../../../../components/option/pieOption'
|
|
const app = getApp();
|
|
const dColor=['#FF4852','#FF6E25','#FFBF00']
|
|
Component({
|
|
data: {
|
|
showChart: true,
|
|
detailData: '',
|
|
taTransform: singleLine([],[]),
|
|
keyMediaData: histogram([],[],[],'#20CC62'),
|
|
weiyiTotal: pieOption(dColor,[]),
|
|
weiyiTotalData: [],
|
|
wyDataList: [],
|
|
//热门词云
|
|
wordCloudActive: 0,
|
|
wordCloudData: [],
|
|
},
|
|
methods: {
|
|
getData() {
|
|
app.globalData.request({
|
|
action: 'getWeiYiInsightAnalysis', //尾翼洞察详情
|
|
token: 't%2BrswgjvzGM=',
|
|
sType: 'BrandWeiYi',
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
sStartTime: wx.getStorageSync('sStartTime') || '',
|
|
sEndTime: wx.getStorageSync('sEndTime') || '',
|
|
sBrand: wx.getStorageSync('sBrand') || ''
|
|
}, (res) => {this.setData({detailData: res.Msg})}).then(() => {});
|
|
app.globalData.request({
|
|
action: 'getWeiYiVolumeTime', //尾翼洞察详情
|
|
token: 't%2BrswgjvzGM=',
|
|
sType: 'BrandWeiYi',
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
sStartTime: wx.getStorageSync('sStartTime') || '',
|
|
sEndTime: wx.getStorageSync('sEndTime') || '',
|
|
sBrand: wx.getStorageSync('sBrand') || ''
|
|
}).then(res => {
|
|
let dx = []; let dValue = [];
|
|
res.forEach(ele => {
|
|
dx.push(ele.Time); dValue.push(ele.value)
|
|
});
|
|
this.setData({ taTransform: singleLine(dValue,dx) })
|
|
});
|
|
app.globalData.request({
|
|
action: 'getWebsite', //重点媒体
|
|
token: 't%2BrswgjvzGM=',
|
|
sType: 'BrandWeiYi',
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
sStartTime: wx.getStorageSync('sStartTime') || '',
|
|
sEndTime: wx.getStorageSync('sEndTime') || '',
|
|
sBrand: wx.getStorageSync('sBrand') || ''
|
|
}).then(res => {
|
|
let dx = []; let dValue = [];
|
|
for(let key in res) {
|
|
dx.push(key);
|
|
dValue.push(res[key]*1);
|
|
}
|
|
this.setData({ keyMediaData: histogram(dx,dValue,[],'#20CC62')})
|
|
});
|
|
app.globalData.request({
|
|
action: 'getAffections', //尾翼整体调性
|
|
token: 't%2BrswgjvzGM=',
|
|
sType: 'BrandWeiYi',
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
sStartTime: wx.getStorageSync('sStartTime') || '',
|
|
sEndTime: wx.getStorageSync('sEndTime') || '',
|
|
sBrand: wx.getStorageSync('sBrand') || ''
|
|
}).then(res => {
|
|
let total = res.正面 * 1 + res.中性 * 1 + res.负面 * 1;
|
|
let arr = [];
|
|
for(let key in res) {
|
|
let obj = {name: key, value: res[key], percent: (res[key]/total*100).toFixed(0)};
|
|
arr.push(obj)
|
|
};
|
|
this.setData({ weiyiTotal: pieOption(dColor,arr), weiyiTotalData: arr})
|
|
});
|
|
this.getWordCloud();
|
|
app.globalData.request({
|
|
action: 'getList0528', //尾翼信息列表
|
|
token: 't%2BrswgjvzGM=',
|
|
sType: 'BrandWeiYi',
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
sStartTime: wx.getStorageSync('sStartTime') || '',
|
|
sEndTime: wx.getStorageSync('sEndTime') || '',
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
iPageIndex: 1,
|
|
iPageSize: 10
|
|
}).then(res => {
|
|
this.setData({wyDataList: res})
|
|
});
|
|
},
|
|
getWordCloud() {
|
|
app.globalData.request({
|
|
action: this.data.wordCloudActive == 0?'getPositive':'getNegative', //正面词云 负面词云
|
|
token: 't%2BrswgjvzGM=',
|
|
sType: 'BrandWeiYi',
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
sStartTime: wx.getStorageSync('sStartTime') || '',
|
|
sEndTime: wx.getStorageSync('sEndTime') || '',
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
}).then(res => {
|
|
let arr1 = [];
|
|
let skey = {
|
|
34: 50,
|
|
3: 416,
|
|
20: 1500,
|
|
23: 250
|
|
};
|
|
Object.keys(res).forEach(key => {
|
|
let o = [key, res[key] / skey[wx.getStorageSync('sTimeType')]]
|
|
arr1.push(o)
|
|
});
|
|
const resArr = arr1.slice(0,50);
|
|
this.setData({wordCloudData: resArr})
|
|
});
|
|
},
|
|
toEventDetail(value) {
|
|
let id = value.currentTarget.dataset.id;
|
|
wx.setStorageSync('sRele', id);
|
|
wx.navigateTo({
|
|
url: "/pages/insight/pages/eventInsight/index" + '?id=' + id
|
|
})
|
|
},
|
|
toTailDataList() {
|
|
wx.navigateTo({
|
|
url: '/pages/insight/pages/brandInsight/tailDataList/index',
|
|
})
|
|
},
|
|
changeWordCloud(event) {
|
|
this.setData({wordCloudActive: event.detail.index});
|
|
this.getWordCloud()
|
|
}
|
|
},
|
|
lifetimes: {
|
|
attached() {
|
|
this.getData()
|
|
}
|
|
}
|
|
}) |