|
|
|
@ -1,142 +1,152 @@
|
|
|
|
|
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 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']
|
|
|
|
|
const dColor = ['#FF4852', '#FF6E25', '#FFBF00', '#20CC62', '#00D6D6', '#00AAFF', '#7257FF']
|
|
|
|
|
Component({
|
|
|
|
|
data:{
|
|
|
|
|
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:[],//负面
|
|
|
|
|
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: [], //负面
|
|
|
|
|
},
|
|
|
|
|
lifetimes:{
|
|
|
|
|
lifetimes: {
|
|
|
|
|
attached() {
|
|
|
|
|
let brandRatioTime = wx.getStorageSync('brandRatioTime')
|
|
|
|
|
this.setData({
|
|
|
|
|
boxArr:wx.getStorageSync('brandData')
|
|
|
|
|
})
|
|
|
|
|
let sBrand = []
|
|
|
|
|
this.data.boxArr.forEach((ele)=>{
|
|
|
|
|
if(ele) sBrand.push(ele.brandname)
|
|
|
|
|
})
|
|
|
|
|
boxArr: wx.getStorageSync('brandData')
|
|
|
|
|
})
|
|
|
|
|
let sBrand = []
|
|
|
|
|
this.data.boxArr.forEach((ele) => {
|
|
|
|
|
if (ele) sBrand.push(ele.brandname)
|
|
|
|
|
})
|
|
|
|
|
//信息量趋势数据
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getCountTime0528C',
|
|
|
|
|
sType:'BrandOverview',
|
|
|
|
|
sType: 'BrandOverview',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sTimeType:'34',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
...brandRatioTime,
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dtime = []
|
|
|
|
|
let dVal = []
|
|
|
|
|
let dataObj = {}
|
|
|
|
|
for(let i of res){
|
|
|
|
|
for (let i of res) {
|
|
|
|
|
dtime.push(i.key)
|
|
|
|
|
for(let j of i.value){
|
|
|
|
|
let obj = {key:j.key,value:j.value}
|
|
|
|
|
if (!dataObj.hasOwnProperty(j.key)){
|
|
|
|
|
for (let j of i.value) {
|
|
|
|
|
let obj = {
|
|
|
|
|
key: j.key,
|
|
|
|
|
value: j.value
|
|
|
|
|
}
|
|
|
|
|
if (!dataObj.hasOwnProperty(j.key)) {
|
|
|
|
|
dataObj[j.key] = []
|
|
|
|
|
}
|
|
|
|
|
dataObj[j.key].push(obj)
|
|
|
|
|
}
|
|
|
|
|
dataObj[j.key].push(obj)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Object.keys(dataObj).forEach(ele=>{
|
|
|
|
|
Object.keys(dataObj).forEach(ele => {
|
|
|
|
|
dVal.push(dataObj[ele])
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.setData({
|
|
|
|
|
transformOption: brokenLines(sBrand,dVal,dColor,dtime),
|
|
|
|
|
transformOption: brokenLines(sBrand, dVal, dColor, dtime),
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//整体信息量
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getContrastCount0528C',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sType:'BrandOverview',
|
|
|
|
|
sTimeType:'34',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
sType: 'BrandOverview',
|
|
|
|
|
...brandRatioTime,
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dx = []
|
|
|
|
|
let dy = []
|
|
|
|
|
for(let i of res){
|
|
|
|
|
for (let i of res) {
|
|
|
|
|
dx.push(i.key)
|
|
|
|
|
dy.push(i.value)
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
brandOption: histogram(dx,dy,[],'#0084FF'),
|
|
|
|
|
brandOption: histogram(dx, dy, [], '#0084FF'),
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//整体互动人数
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getInteractCount0528C',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sType:'BrandOverview',
|
|
|
|
|
sTimeType:'34',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
sType: 'BrandOverview',
|
|
|
|
|
...brandRatioTime,
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dx = []
|
|
|
|
|
let dy = []
|
|
|
|
|
for(let i of res){
|
|
|
|
|
for (let i of res) {
|
|
|
|
|
dx.push(i.key)
|
|
|
|
|
dy.push(i.value)
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
brandOption2: histogram(dx,dy,[],'#20cc62'),
|
|
|
|
|
brandOption2: histogram(dx, dy, [], '#20cc62'),
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//品牌条形对比
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getAffectionsC',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sType:'BrandOverview',
|
|
|
|
|
sTimeType:'34',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
sType: 'BrandOverview',
|
|
|
|
|
...brandRatioTime,
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let yMsg = []
|
|
|
|
|
let data = [[],[],[]]
|
|
|
|
|
for(let i of res){
|
|
|
|
|
let data = [
|
|
|
|
|
[],
|
|
|
|
|
[],
|
|
|
|
|
[]
|
|
|
|
|
]
|
|
|
|
|
for (let i of res) {
|
|
|
|
|
yMsg.push(i.Name)
|
|
|
|
|
data[0].push(i.Data['正面'])
|
|
|
|
|
data[1].push(i.Data['中性'])
|
|
|
|
|
data[2].push(i.Data['负面'])
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
stackOption:stack(yMsg,data,['#00aaff','#20cc62','#ff4852'])
|
|
|
|
|
stackOption: stack(yMsg, data, ['#00aaff', '#20cc62', '#ff4852'])
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//渠道分布
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getSourcetypeC',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sType:'BrandOverview',
|
|
|
|
|
sTimeType:'34',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
sType: 'BrandOverview',
|
|
|
|
|
...brandRatioTime,
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let arr = []
|
|
|
|
|
let channelMsg = []
|
|
|
|
|
for(let i of res){
|
|
|
|
|
let obj = {name:i.Name}
|
|
|
|
|
for (let i of res) {
|
|
|
|
|
let obj = {
|
|
|
|
|
name: i.Name
|
|
|
|
|
}
|
|
|
|
|
let da = []
|
|
|
|
|
Object.keys(i.Data).forEach(ele=>{
|
|
|
|
|
Object.keys(i.Data).forEach(ele => {
|
|
|
|
|
da.push(i.Data[ele])
|
|
|
|
|
channelMsg.push(ele)
|
|
|
|
|
})
|
|
|
|
@ -145,98 +155,97 @@ Component({
|
|
|
|
|
}
|
|
|
|
|
channelMsg = [...new Set(channelMsg)]
|
|
|
|
|
this.setData({
|
|
|
|
|
brandOption3:multipleColumn(sBrand,channelMsg,arr),
|
|
|
|
|
brandOption3: multipleColumn(sBrand, channelMsg, arr),
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//品牌事件对比
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getSourcetypeC',
|
|
|
|
|
sType:'HotEvent0528',
|
|
|
|
|
sType: 'HotEvent0528',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sTimeType:'34',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
...brandRatioTime,
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
},'http://cloud.sws010.com/api/v7.ashx').then(res=>{
|
|
|
|
|
console.log(res);
|
|
|
|
|
}, 'http://cloud.sws010.com/api/v7.ashx').then(res => {
|
|
|
|
|
let channelMsg = []
|
|
|
|
|
let dataArr = []
|
|
|
|
|
for(let [index,i] of res.entries()){
|
|
|
|
|
if(index==0){
|
|
|
|
|
for (let [index, i] of res.entries()) {
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
channelMsg = Object.keys(i.Data)
|
|
|
|
|
}
|
|
|
|
|
let obj = {}
|
|
|
|
|
obj.name = i.Name
|
|
|
|
|
obj.data = Object.keys(i.Data).map(ele=>{
|
|
|
|
|
obj.data = Object.keys(i.Data).map(ele => {
|
|
|
|
|
return i.Data[ele]
|
|
|
|
|
})
|
|
|
|
|
dataArr.push(obj)
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
brandOption5:multipleColumn(sBrand,channelMsg,dataArr),
|
|
|
|
|
brandOption5: multipleColumn(sBrand, channelMsg, dataArr),
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//重点媒体
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getSourceCount0528C',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sType:'BrandOverview',
|
|
|
|
|
sTimeType:'34',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
sType: 'BrandOverview',
|
|
|
|
|
...brandRatioTime,
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let xMsg = []
|
|
|
|
|
for(let i of res[0].value){
|
|
|
|
|
for (let i of res[0].value) {
|
|
|
|
|
xMsg.push(i.key)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let data = new Array(res.length).fill([])
|
|
|
|
|
for(let [index,i] of res.entries()){
|
|
|
|
|
for(let j of i.value){
|
|
|
|
|
data[index].push(j.value)
|
|
|
|
|
for (let [index, i] of res.entries()) {
|
|
|
|
|
for (let j of i.value) {
|
|
|
|
|
data[index].push(j.value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//横轴,数据,纵轴
|
|
|
|
|
this.setData({
|
|
|
|
|
brandOption4:sHistogram(xMsg,data,sBrand,[])
|
|
|
|
|
brandOption4: sHistogram(xMsg, data, sBrand, [])
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//品牌传播TOP媒体
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getSourceTopCount0528C',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sType:'BrandOverview',
|
|
|
|
|
sTimeType:'34',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
sType: 'BrandOverview',
|
|
|
|
|
...brandRatioTime,
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.setData({
|
|
|
|
|
brandTop:[res[0],res[1]],
|
|
|
|
|
brandTopData:res
|
|
|
|
|
brandTop: [res[0], res[1]],
|
|
|
|
|
brandTopData: res
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//销量对比
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getCheZhuCountTimeC',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
sType:'Marketing1C',
|
|
|
|
|
iContrastType:'1',
|
|
|
|
|
sType: 'Marketing1C',
|
|
|
|
|
iContrastType: '1',
|
|
|
|
|
sBrand: sBrand.join(',')
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dDate = []
|
|
|
|
|
let dVal = new Array(res.Data[0].value.length).fill([])
|
|
|
|
|
dVal = dVal.map(ele=>{
|
|
|
|
|
dVal = dVal.map(ele => {
|
|
|
|
|
ele = JSON.stringify(ele)
|
|
|
|
|
ele = JSON.parse(ele)
|
|
|
|
|
return ele
|
|
|
|
|
})
|
|
|
|
|
for(let i of res.Data){
|
|
|
|
|
for (let i of res.Data) {
|
|
|
|
|
dDate.push(i.key)
|
|
|
|
|
for(let [index,j] of i.value.entries()){
|
|
|
|
|
for (let [index, j] of i.value.entries()) {
|
|
|
|
|
dVal[index].push(j)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
salesDate:res.Time,
|
|
|
|
|
transformOption2: brokenLines(sBrand,dVal,dColor,dDate),
|
|
|
|
|
salesDate: res.Time,
|
|
|
|
|
transformOption2: brokenLines(sBrand, dVal, dColor, dDate),
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//正负词云
|
|
|
|
@ -273,29 +282,27 @@ Component({
|
|
|
|
|
// positiveWord,
|
|
|
|
|
// negativeWord
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
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
|
|
|
|
|
console.log(index);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
this.setData({
|
|
|
|
|
topActive: index,
|
|
|
|
|
brandTop:obj[index]
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
changeModalHot2(event) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
})
|