liuyongli 3 years ago
parent 3074a9a990
commit 25a255380a

@ -10,8 +10,11 @@ Component({
4: 50000 4: 50000
}, },
showTu1: false, showTu1: false,
showTu2: false showTu2: false,
// words: // words:
HotWords: {},
PositiveWords: {},
NegativeWords: {},
}, },
lifetimes: { lifetimes: {
attached() { attached() {
@ -29,18 +32,18 @@ Component({
this.getData(sTimeType, sStartTime, sEndTime); this.getData(sTimeType, sStartTime, sEndTime);
}, },
getData(sTimeType, sStartTime, sEndTime) { getData(sTimeType, sStartTime, sEndTime) {
wx.showToast({ // wx.showToast({
title: '加载中', // title: '加载中',
icon: 'loading', // icon: 'loading',
duration: 300000 // duration: 3000
}), // }),
Promise.all([this.getData1(sTimeType, sStartTime, sEndTime), Promise.all([this.getData1(sTimeType, sStartTime, sEndTime),
this.getData2(sTimeType, sStartTime, sEndTime), this.getData2(sTimeType, sStartTime, sEndTime),
this.getData3(sTimeType, sStartTime, sEndTime) this.getData3(sTimeType, sStartTime, sEndTime)
]).then(() => { ]).then(() => {
setTimeout(() => { // setTimeout(() => {
wx.hideToast(); // wx.hideToast();
}, 500) // }, 500)
}) })
// this.getData1(sTimeType, sStartTime, sEndTime), // this.getData1(sTimeType, sStartTime, sEndTime),
// this.getData2(sTimeType, sStartTime, sEndTime), // this.getData2(sTimeType, sStartTime, sEndTime),
@ -61,17 +64,16 @@ Component({
sEndTime: sEndTime sEndTime: sEndTime
} }
app.globalData.request(obj).then(res => { app.globalData.request(obj).then(res => {
const data = res // const data = res
const arr1 = [] // const arr1 = []
Object.keys(data).forEach(key => { // Object.keys(data).forEach(key => {
let o = [key, data[key]] // let o = [key, data[key]]
arr1.push(o) // arr1.push(o)
}) // })
this.setData({ this.setData({
HotWords: arr1, HotWords: res,
showTu: true
}) })
resolve(true) // resolve(true)
}) })
}) })
}, },
@ -89,17 +91,20 @@ Component({
sEndTime: sEndTime sEndTime: sEndTime
} }
app.globalData.request(obj).then(res => { app.globalData.request(obj).then(res => {
const data = res
const arr2 = []
Object.keys(data).forEach(key => {
let list = [key, data[key]]
arr2.push(list)
})
this.setData({ this.setData({
PositiveWords: arr2, PositiveWords: res,
showTu1: true
}) })
resolve(true) // const data = res
// const arr2 = []
// Object.keys(data).forEach(key => {
// let list = [key, data[key]]
// arr2.push(list)
// })
// this.setData({
// PositiveWords: arr2,
// showTu1: true
// })
// resolve(true)
}) })
}) })
@ -118,17 +123,20 @@ Component({
sEndTime: sEndTime sEndTime: sEndTime
} }
app.globalData.request(obj).then(res => { app.globalData.request(obj).then(res => {
const data = res
const arr3 = []
Object.keys(data).forEach(key => {
let list = [key, data[key]]
arr3.push(list)
})
this.setData({ this.setData({
NegativeWords: arr3, NegativeWords: res,
showTu2: true
}) })
resolve(true) // const data = res
// const arr3 = []
// Object.keys(data).forEach(key => {
// let list = [key, data[key]]
// arr3.push(list)
// })
// this.setData({
// NegativeWords: arr3,
// showTu2: true
// })
// resolve(true)
}) })
}) })

@ -1,6 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"word-cloud": "../../word-cloud/index", "word-cloud": "../../word-cloud/index",
"word-cloud-car":"../../wdCloudCar/index",
"time-component":"/components/timecomponent/index" "time-component":"/components/timecomponent/index"
} }
} }

@ -3,16 +3,16 @@
<time-component bindchange="changeTime"></time-component> <time-component bindchange="changeTime"></time-component>
<view class="brand"> <view class="brand">
<view class="text" bindtap="a">热门词云</view> <view class="text" bindtap="a">热门词云</view>
<word-cloud canvasId="w1" wx:if="{{showTu}}" list="{{HotWords}}" width="100%" height="200" color="#FF1C20"></word-cloud> <word-cloud-car height="{{484}}" list="{{HotWords}}"></word-cloud-car>
</view> </view>
<view class="brand"> <view class="brand">
<view class="text">正面词云</view> <view class="text">正面词云</view>
<view> <view>
<word-cloud canvasId="w2" wx:if="{{showTu1}}" list="{{PositiveWords}}" width="100%" height="200" color="#0284FF"></word-cloud> <word-cloud-car height="{{484}}" list="{{PositiveWords}}"></word-cloud-car>
</view> </view>
</view> </view>
<view class="brand"> <view class="brand">
<view class="text">负面词云</view> <view class="text">负面词云</view>
<word-cloud canvasId="w3" wx:if="{{showTu2}}" list="{{NegativeWords}}" width="100%" height="200" color="#8D830F"></word-cloud> <word-cloud-car height="{{484}}" list="{{NegativeWords}}"></word-cloud-car>
</view> </view>
</view> </view>

@ -1,7 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"c-echars": "../../../../../../components/c-echars/index", "c-echars": "../../../../../../components/c-echars/index",
"word-cloud": "../../../../../components/word-cloud/index" "word-cloud": "../../../../../components/word-cloud/index",
"word-cloud-car": "../../../../../components/wdCloudCar/index"
}, },
"component": true "component": true
} }

@ -119,6 +119,7 @@
<view class="brand" wx:for="{{positive}}" wx:for-index="index" wx:key="index"> <view class="brand" wx:for="{{positive}}" wx:for-index="index" wx:key="index">
<view style="margin-left: 32rpx;">{{item.name}}</view> <view style="margin-left: 32rpx;">{{item.name}}</view>
<view> <view>
<!-- <word-cloud-car height="{{484}}" list="{{positiveWord}}"></word-cloud-car> -->
<word-cloud canvasId="{{'wcw'+index}}" list="{{item.value}}" width="100%" height="230" color="#0284FF"></word-cloud> <word-cloud canvasId="{{'wcw'+index}}" list="{{item.value}}" width="100%" height="230" color="#0284FF"></word-cloud>
</view> </view>
</view> </view>

@ -278,7 +278,7 @@ Component({
}).then(res=>{ }).then(res=>{
let positiveWord = [] let positiveWord = []
let negativeWord = [] let negativeWord = []
console.log(res);
for(let i of res){ for(let i of res){
let pobj = {} let pobj = {}
let nobj = {} let nobj = {}

@ -1,7 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"c-echars": "../../../../../../components/c-echars/index", "c-echars": "../../../../../../components/c-echars/index",
"word-cloud": "../../../../../components/word-cloud/index" "word-cloud": "../../../../../components/word-cloud/index",
"word-cloud-car": "../../../components/wdCloudCar/index"
}, },
"component": true "component": true
} }

@ -119,7 +119,8 @@
<view class="brand" wx:for="{{positive}}" wx:for-index="index" wx:key="index"> <view class="brand" wx:for="{{positive}}" wx:for-index="index" wx:key="index">
<view style="margin-left: 32rpx;">{{item.name}}</view> <view style="margin-left: 32rpx;">{{item.name}}</view>
<view > <view >
<word-cloud canvasId="{{'w'+index}}" list="{{item.value}}" width="100%" height="230" color="#0284FF"></word-cloud> <word-cloud-car height="{{484}}" list="{{positiveWord}}"></word-cloud-car>
<!-- <word-cloud canvasId="{{'w'+index}}" list="{{item.value}}" width="100%" height="230" color="#0284FF"></word-cloud> -->
</view> </view>
</view> </view>
</view> </view>

@ -24,7 +24,7 @@ Component({
mediaData: [], mediaData: [],
//热门词云 //热门词云
wordCloudActive: 0, wordCloudActive: 0,
wordCloudData: [], wordCloudData: {},
eventTransActive: 0, eventTransActive: 0,
affActive: 0, affActive: 0,
}, },
@ -132,12 +132,12 @@ Component({
sEndTime: wx.getStorageSync('sEndTime') || '', sEndTime: wx.getStorageSync('sEndTime') || '',
sRele: wx.getStorageSync('sRele') || '', sRele: wx.getStorageSync('sRele') || '',
}).then(res => { }).then(res => {
let arr1 = []; // let arr1 = [];
Object.keys(res).forEach(key => { // Object.keys(res).forEach(key => {
let o = [key, res[key]] // let o = [key, res[key]]
arr1.push(o) // arr1.push(o)
}); // });
this.setData({wordCloudData: arr1}) this.setData({wordCloudData: res})
}); });
}, },
changeWordCloud(event) { changeWordCloud(event) {

@ -1,7 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"c-echars": "../../../../../components/c-echars/index", "c-echars": "../../../../../components/c-echars/index",
"word-cloud": "../../../../../components/word-cloud/index" "word-cloud": "../../../../../components/word-cloud/index",
"word-cloud-car": "../../../../../components/wdCloudCar/index"
}, },
"component": true "component": true
} }

@ -81,7 +81,8 @@
</view> </view>
</view> </view>
<view class="wd-cloud"> <view class="wd-cloud">
<word-cloud canvasId="ta-wc" list="{{wordCloudData}}" width="100%" height="200" color="#FF1C20"></word-cloud> <word-cloud-car height="{{484}}" list="{{wordCloudData}}"></word-cloud-car>
<!-- <word-cloud canvasId="ta-wc" list="{{wordCloudData}}" width="100%" height="200" color="#FF1C20"></word-cloud> -->
</view> </view>
</view> </view>
</view> </view>

@ -28,6 +28,13 @@
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
},
{
"name": "",
"pathName": "contrastPackages/brandRatio/index",
"query": "",
"launchMode": "default",
"scene": null
} }
] ]
} }

Loading…
Cancel
Save