liuyongli 3 years ago
parent 3074a9a990
commit 25a255380a

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

@ -3,16 +3,16 @@
<time-component bindchange="changeTime"></time-component>
<view class="brand">
<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 class="brand">
<view class="text">正面词云</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 class="brand">
<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>

@ -1,7 +1,8 @@
{
"usingComponents": {
"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
}

@ -119,6 +119,7 @@
<view class="brand" wx:for="{{positive}}" wx:for-index="index" wx:key="index">
<view style="margin-left: 32rpx;">{{item.name}}</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>
</view>
</view>

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

@ -1,7 +1,8 @@
{
"usingComponents": {
"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
}

@ -119,7 +119,8 @@
<view class="brand" wx:for="{{positive}}" wx:for-index="index" wx:key="index">
<view style="margin-left: 32rpx;">{{item.name}}</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>

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

@ -1,7 +1,8 @@
{
"usingComponents": {
"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
}

@ -81,7 +81,8 @@
</view>
</view>
<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>

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

Loading…
Cancel
Save