|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
import singleLine from "../../../../../components/option/sgOption"
|
|
|
|
|
import pieOption from '../../../../../components/option/pieOption'
|
|
|
|
|
import raydarOption from '../../../../../components/option/raydarOption'
|
|
|
|
|
import pictographicOption from '../../../../../components/option/pictographicOption'
|
|
|
|
|
import histogram from "../../../../../components/option/columnarOption"
|
|
|
|
|
const app = getApp();
|
|
|
|
|
const dColor=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6']
|
|
|
|
|
Component({
|
|
|
|
@ -8,6 +10,7 @@ Component({
|
|
|
|
|
showChart: true,
|
|
|
|
|
detailData: '',
|
|
|
|
|
affData: {},
|
|
|
|
|
imageUrl: getApp().globalData.imageUrl,
|
|
|
|
|
ttTransform: singleLine([],[]),
|
|
|
|
|
dcActive: 0,
|
|
|
|
|
// 论坛调性分布
|
|
|
|
@ -17,8 +20,29 @@ Component({
|
|
|
|
|
dataComp: pieOption(dColor,[]),
|
|
|
|
|
dataCompData: [],
|
|
|
|
|
// 话题分布
|
|
|
|
|
tpActive: 0,
|
|
|
|
|
topicData: raydarOption([],[]),
|
|
|
|
|
topicUser: []
|
|
|
|
|
topicUser: [],
|
|
|
|
|
// 主贴用户分析
|
|
|
|
|
muActive: 0,
|
|
|
|
|
mainUserChart: pieOption(dColor,[]),
|
|
|
|
|
mainUserData: [],
|
|
|
|
|
// 主贴ID车型分析
|
|
|
|
|
mcmActive: 0,
|
|
|
|
|
mainIdTypeData: [],
|
|
|
|
|
// 主贴ID区域分布
|
|
|
|
|
mainIdArea1: pictographicOption([],[]),
|
|
|
|
|
mainIdArea2: pictographicOption([],[]),
|
|
|
|
|
// 跟帖用户分析
|
|
|
|
|
suActive: 0,
|
|
|
|
|
subUserChart: pieOption(dColor,[]),
|
|
|
|
|
subUserData: [],
|
|
|
|
|
// 跟帖ID区域分布
|
|
|
|
|
subIdArea1: pictographicOption([],[]),
|
|
|
|
|
subIdArea2: pictographicOption([],[]),
|
|
|
|
|
// 疑似车黑ID
|
|
|
|
|
carHaterId: histogram([],[],[],'#20CC62'),
|
|
|
|
|
idEventChart: histogram([],[],[],'#20CC62'),
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getData() {
|
|
|
|
@ -64,12 +88,106 @@ Component({
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dx = []; let dValue = [];
|
|
|
|
|
res.forEach(ele => {
|
|
|
|
|
dx.push(ele.Time); dValue.push(ele.value)
|
|
|
|
|
dx.push(ele.Time);
|
|
|
|
|
dValue.push(ele.value)
|
|
|
|
|
});
|
|
|
|
|
this.setData({ ttTransform: singleLine(dValue,dx) })
|
|
|
|
|
});
|
|
|
|
|
this.getDataComp();
|
|
|
|
|
this.getTopic();
|
|
|
|
|
this.getMainUserAnalize();
|
|
|
|
|
this.getMainIdType();
|
|
|
|
|
this.getSubUserAnalize();
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getRegion', //主贴ID区域分布
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
|
sType: 'BbsSeries',
|
|
|
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
|
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
|
|
|
sSeriesName: wx.getStorageSync('sSeriesName') || '',
|
|
|
|
|
iBBsType: 2
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dr = []; let dv = []; let total = 0;
|
|
|
|
|
for(let key in res) {
|
|
|
|
|
dr.push(key);
|
|
|
|
|
dv.push(res[key]);
|
|
|
|
|
total = total + res[key]*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({
|
|
|
|
|
mainIdArea1: pictographicOption(dr1,dv1),
|
|
|
|
|
mainIdArea2: pictographicOption(dr2,dv2),
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getRegion', //跟帖ID区域分布
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
|
sType: 'BbsSeries',
|
|
|
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
|
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
|
|
|
sSeriesName: wx.getStorageSync('sSeriesName') || '',
|
|
|
|
|
iBBsType: 3
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dr = []; let dv = []; let total = 0;
|
|
|
|
|
for(let key in res) {
|
|
|
|
|
dr.push(key);
|
|
|
|
|
dv.push(res[key]);
|
|
|
|
|
total = total + res[key]*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({
|
|
|
|
|
subIdArea1: pictographicOption(dr1,dv1),
|
|
|
|
|
subIdArea2: pictographicOption(dr2,dv2),
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getCarblackUserName', //疑似车黑ID
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
|
sType: 'BbsSeries',
|
|
|
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
|
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
|
|
|
sSeriesName: wx.getStorageSync('sSeriesName') || '',
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dx = []; let dValue = [];
|
|
|
|
|
for(let key in res) {
|
|
|
|
|
dx.push(key);
|
|
|
|
|
dValue.push(res[key])
|
|
|
|
|
}
|
|
|
|
|
this.setData({ carHaterId: histogram(dx,dValue,[],'#20CC62')})
|
|
|
|
|
});
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getUserRegTime', //跟帖ID注册时间
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
|
sType: 'BbsSeries',
|
|
|
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
|
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
|
|
|
sSeriesName: wx.getStorageSync('sSeriesName') || '',
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let dx = []; let dValue = [];
|
|
|
|
|
for(let key in res) {
|
|
|
|
|
dx.push(key);
|
|
|
|
|
dValue.push(res[key])
|
|
|
|
|
}
|
|
|
|
|
this.setData({ idEventChart: histogram(dx,dValue,[],'#20CC62')})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getDataComp() {
|
|
|
|
|
app.globalData.request({
|
|
|
|
@ -97,14 +215,13 @@ Component({
|
|
|
|
|
},
|
|
|
|
|
getTopic() {
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getPositiveTopic', //话题分布
|
|
|
|
|
action: this.data.tpActive==0?'getPositiveTopic':'getNegativeTopic', //话题分布
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
|
sType: 'BbsSeries',
|
|
|
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
|
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
|
|
|
sSeriesName: wx.getStorageSync('sSeriesName') || '',
|
|
|
|
|
}).then(res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
let dName = []; let dValue = [];
|
|
|
|
|
let users = [];
|
|
|
|
|
for(let key in res.Data) {
|
|
|
|
@ -118,9 +235,79 @@ Component({
|
|
|
|
|
this.setData({topicData: raydarOption(dName,dValue),topicUser: users})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getMainUserAnalize() {
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: this.data.muActive == 0?'getAttestationSex':'getUserAttestation', //主贴用户分析-性别
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
|
sType: 'BbsSeries',
|
|
|
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
|
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
|
|
|
sSeriesName: wx.getStorageSync('sSeriesName') || '',
|
|
|
|
|
iBBsType: 2,
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let arr = [];
|
|
|
|
|
for(let key in res) {
|
|
|
|
|
let obj = {name: key, value: res[key]};
|
|
|
|
|
arr.push(obj);
|
|
|
|
|
}
|
|
|
|
|
this.setData({mainUserChart: pieOption(dColor,arr), mainUserData: arr})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getMainIdType() {
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getGuanZhuSeriesname', //主贴ID车型
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
|
sType: 'BbsSeries',
|
|
|
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
|
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
|
|
|
sSeriesName: wx.getStorageSync('sSeriesName') || '',
|
|
|
|
|
iBBsType: this.data.mcmActive == 0 ? 2 : 3,
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let arr = [];
|
|
|
|
|
for(let key in res) {
|
|
|
|
|
let obj = {name: key, value: res[key]};
|
|
|
|
|
arr.push(obj)
|
|
|
|
|
}
|
|
|
|
|
this.setData({mainIdTypeData: arr})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getSubUserAnalize() {
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: this.data.suActive == 0?'getAttestationSex':'getUserAttestation', //跟帖用户分析-性别
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
|
sType: 'BbsSeries',
|
|
|
|
|
sTimeType: wx.getStorageSync('sTimeType') || 34,
|
|
|
|
|
sBrand: wx.getStorageSync('sBrand') || '',
|
|
|
|
|
sSeriesName: wx.getStorageSync('sSeriesName') || '',
|
|
|
|
|
iBBsType: 3,
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let arr = [];
|
|
|
|
|
for(let key in res) {
|
|
|
|
|
let obj = {name: key, value: res[key]};
|
|
|
|
|
arr.push(obj);
|
|
|
|
|
}
|
|
|
|
|
this.setData({subUserChart: pieOption(dColor,arr), subUserData: arr})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
dcChange(event) {
|
|
|
|
|
this.setData({dcActive: event.detail.index});
|
|
|
|
|
this.getDataComp()
|
|
|
|
|
},
|
|
|
|
|
tpChange(event) {
|
|
|
|
|
this.setData({tpActive: event.detail.index});
|
|
|
|
|
this.getTopic()
|
|
|
|
|
},
|
|
|
|
|
muChange(event) {
|
|
|
|
|
this.setData({muActive: event.detail.index});
|
|
|
|
|
this.getMainUserAnalize()
|
|
|
|
|
},
|
|
|
|
|
mcmChange(event) {
|
|
|
|
|
this.setData({mcmActive: event.detail.index});
|
|
|
|
|
this.getMainIdType()
|
|
|
|
|
},
|
|
|
|
|
suChange(event) {
|
|
|
|
|
this.setData({suActive: event.detail.index});
|
|
|
|
|
this.getSubUserAnalize()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
lifetimes: {
|
|
|
|
|