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.
102 lines
3.7 KiB
102 lines
3.7 KiB
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: [], //负面
|
|
},
|
|
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)
|
|
})
|
|
//品牌传播TOP媒体
|
|
app.globalData.request({
|
|
action: 'getSourceTopCount0528C',
|
|
token: wx.getStorageSync('token'),
|
|
sType: 'BrandWeiYi',
|
|
...brandRatioTime,
|
|
iContrastType: '1',
|
|
iSize:'10',
|
|
sBrand: sBrand.join(',')
|
|
}).then(res => {
|
|
this.setData({
|
|
brandTop: [res[0], res[1]],
|
|
brandTopData: res
|
|
})
|
|
})
|
|
//尾翼趋势
|
|
app.globalData.request({
|
|
action: 'getCountTime0528C',
|
|
token: wx.getStorageSync('token'),
|
|
sType: 'BrandWeiYi',
|
|
iContrastType: '1',
|
|
...brandRatioTime,
|
|
sBrand: sBrand.join(',')
|
|
}).then(res => {
|
|
console.log(res);
|
|
let dDate = []
|
|
let dVal = new Array(res[0].value.length).fill([])
|
|
dVal = dVal.map(ele => {
|
|
ele = JSON.stringify(ele)
|
|
ele = JSON.parse(ele)
|
|
return ele
|
|
})
|
|
for (let i of res) {
|
|
dDate.push(i.key)
|
|
for (let [index, j] of i.value.entries()) {
|
|
dVal[index].push(j)
|
|
}
|
|
}
|
|
this.setData({
|
|
salesDate: res.Time,
|
|
transformOption2: brokenLines(sBrand, dVal, dColor, 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) {
|
|
|
|
},
|
|
}
|
|
}) |