Merge branch 'dev' of git.oa00.com:xiaowen/swsWecat into dev

* 'dev' of git.oa00.com:xiaowen/swsWecat:
  zx - 词云
dev
liuyongli 3 years ago
commit 3074a9a990

@ -100,6 +100,22 @@ App({
}
})
})
},
requestImg: function(data) {
let obj = {version: '1', data};
return new Promise((resolve, reject) => {
wx.request({
url: 'https://saas.kaidalai.cn/word_cloud/wordCloud/getWordCloud',
data: obj,
method: 'post',
success: function (res) {
resolve(res)
},
fail: function (err) {
reject(err);
}
})
})
}
},

@ -0,0 +1,44 @@
const app = getApp();
Component({
properties: {
list: {
type: Object,
value: {},
},
height: {
type: Number,
value: 484
},
},
data: {
wdUrl: '',
},
lifetimes: {
attached: function () {
},
},
methods: {
},
observers: {
list(newVal) {
if (!newVal || newVal == {}) return
let arr = [];
for(let key in newVal) {
let obj = {
name: key,
num: newVal[key]
};
arr.push(obj)
}
setTimeout(() => {
app.globalData.requestImg(arr).then(res => {
var imgData = res.data.replace(/[\r\n]/g, '')
var base64Img = 'data:image/png;base64,' + imgData;
this.setData({wdUrl: base64Img})
});
}, 500)
}
},
})

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

@ -0,0 +1,3 @@
<view class="img-container" style="height: {{ height }}rpx;">
<image src="{{wdUrl}}" style="width: 100%; height: 120px;" />
</view>

@ -0,0 +1,12 @@
.img-container {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
width: calc(100% - 32px);
height: 484rpx;
background-color: #fff;
border-radius: 4rpx;
margin: 32rpx 0 0 32rpx;
overflow: hidden;
}

@ -31,6 +31,7 @@ Component({
],
copyShow: false,
copyData: {},
wordCloudObject: {},
},
methods: {
getData() {
@ -122,12 +123,13 @@ Component({
sEndTime: wx.getStorageSync('sEndTime') || '',
sBrand: wx.getStorageSync('sBrand') || '',
}).then(res => {
let arr1 = [];
Object.keys(res).forEach(key => {
let o = [key, res[key]]
arr1.push(o)
});
this.setData({wordCloudData: arr1, wShow: true})
this.setData({wordCloudObject: res})
// let arr1 = [];
// Object.keys(res).forEach(key => {
// let o = [key, res[key]]
// arr1.push(o)
// });
// this.setData({wordCloudData: arr1, wShow: true})
});
},
toEventDetail(e) {

@ -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
}

@ -52,10 +52,10 @@
</van-tabs>
</view>
</view>
<view class="wd-cloud">
<word-cloud-car height="{{484}}" list="{{wordCloudObject}}"></word-cloud-car>
<!-- <view class="wd-cloud">
<word-cloud wx:if="{{wShow}}" canvasId="ta-wc" list="{{wordCloudData}}" width="100%" height="200" color="#FF1C20" lvl="{{wlvl}}"></word-cloud>
<!-- <c-echars showChart="{{showChart}}" canvasId="wdcd-canvas" chartId="wdcd" chartOption="{{wordCloudData}}" height="100%"></c-echars> -->
</view>
</view> -->
</view>
<view class="ta-item">
<view class="ta-chart-title" style="display: flex;justify-content: space-between;">

@ -35,6 +35,7 @@ Component({
],
imageUrl: getApp().globalData.imageUrl,
wordCloudObject: {},
showChart: true,
weiboData: {},
weiboAff: {},
@ -470,14 +471,7 @@ Component({
sEndTime: wx.getStorageSync('sEndTime') || '',
sBrand: wx.getStorageSync('sBrand') || '',
}).then(res => {
let arr1 = [];
Object.keys(res).forEach(key => {
let o = [key, res[key]]
arr1.push(o)
});
this.setData({
wordCloudData: arr1
})
this.setData({wordCloudObject: res})
});
},
getKol() {

@ -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
}

@ -168,9 +168,7 @@
</van-tabs>
</view>
</view>
<view class="brand">
<word-cloud canvasId="ta-wc" list="{{wordCloudData}}" width="100%" height="200" color="#FF1C20"></word-cloud>
</view>
<word-cloud-car height="{{484}}" list="{{wordCloudObject}}"></word-cloud-car>
</view>
<view class="wb-item">
<view class="wb-chart-title">调性分布</view>

@ -141,11 +141,12 @@
}
/* 词云 */
.brand{
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: calc(100% - 32px);
height: 484rpx;
background-color: #fff;
margin-top: 32rpx;
border-radius: 4rpx;
margin: 32rpx 0 0 32rpx;
overflow: hidden;

@ -13,6 +13,7 @@ Component({
//热门词云
wordCloudActive: 0,
wordCloudData: [],
wordCloudObject: {},
},
methods: {
getData() {
@ -59,12 +60,7 @@ 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})
this.setData({wordCloudObject: res})
});
},
changeWordCloud(event) {

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

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

@ -17,6 +17,7 @@ Component({
wordCloudData: [],
copyShow: false,
copyData: {},
wordCloudObject: {},
},
methods: {
getData() {
@ -90,12 +91,7 @@ Component({
sBrand: wx.getStorageSync('sBrand') || '',
sSeriesName: wx.getStorageSync('sSeriesName') || ''
}).then(res => {
let arr1 = [];
Object.keys(res).forEach(key => {
let o = [key, res[key]]
arr1.push(o)
});
this.setData({wordCloudData: arr1})
this.setData({wordCloudObject: res})
});
},
toEventDetail(e) {

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

@ -52,9 +52,7 @@
</van-tabs>
</view>
</view>
<view class="wd-cloud">
<word-cloud canvasId="ta-wc" list="{{wordCloudData}}" width="100%" height="200" color="#FF1C20"></word-cloud>
</view>
<word-cloud-car height="{{484}}" list="{{wordCloudObject}}"></word-cloud-car>
</view>
<view class="ta-item">
<view class="ta-chart-title" style="display: flex;justify-content: space-between;">

@ -34,6 +34,7 @@ Component({
//词云
wordCloudActive: 0,
wordCloudData: [],
wordCloudObject: {},
//kol观点
kolActive: 0,
kolData: [],
@ -312,12 +313,13 @@ Component({
sBrand: wx.getStorageSync('sBrand') || '',
sSeriesName: wx.getStorageSync('sSeriesName') || ''
}).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: arr1})
this.setData({wordCloudObject: res})
});
},
getKol() {

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

@ -132,9 +132,7 @@
</van-tabs>
</view>
</view>
<view class="brand">
<word-cloud canvasId="ta-wc" list="{{wordCloudData}}" width="100%" height="200" color="#FF1C20"></word-cloud>
</view>
<word-cloud-car height="{{484}}" list="{{wordCloudObject}}"></word-cloud-car>
</view>
<view class="wb-item">
<view class="wb-chart-title">微博传播裂变</view>

@ -37,6 +37,7 @@ Page({
//词云
wordCloudActive: 0,
wordCloudData: [],
wordCloudObject: {},
//大V分析
bigvActive: 0,
rowData: [],
@ -318,12 +319,7 @@ Page({
app.globalData.request(
Object.assign(obj,{action: this.data.wordCloudActive == 0 ? 'getPositive':this.data.wordCloudActive == 1 ?'getNegative':'getHotWord'})
).then(res => {
let arr1 = [];
Object.keys(res).forEach(key => {
let o = [key, res[key]]
arr1.push(o)
});
this.setData({wordCloudData: arr1})
this.setData({wordCloudObject: res})
});
},
getBigv() {

@ -2,6 +2,6 @@
"navigationBarTitleText": "主题数据看板",
"usingComponents": {
"c-echars": "../../../../../components/c-echars/index",
"word-cloud": "../../../../../components/word-cloud/index"
"word-cloud-car": "../../../../../components/wdCloudCar/index"
}
}

@ -201,9 +201,7 @@
</van-tabs>
</view>
</view>
<view class="brand">
<word-cloud canvasId="tb-wc" list="{{wordCloudData}}" width="100%" height="200" color="#FF1C20"></word-cloud>
</view>
<word-cloud-car height="{{484}}" list="{{wordCloudObject}}"></word-cloud-car>
</view>
</view>
<view class="tb-content" wx:if="{{tabActive == 1}}">

Loading…
Cancel
Save