From 64f8f6c4f48ecda55acdca5f8048353c79ffda97 Mon Sep 17 00:00:00 2001
From: zx <604444282@qq.com>
Date: Mon, 10 Oct 2022 12:01:21 +0800
Subject: [PATCH] zx
---
.../pages/brandInsight/TailInsight/index.js | 2 +-
.../brandInsight/brandDataList/index.wxml | 2 +-
.../pages/brandInsight/weiboInsight/index.js | 16 ++++++------
.../pages/eventInsight/evDatalist/index.wxml | 2 +-
.../pages/eventInsight/evTailwing/index.js | 2 +-
.../modalInsight/modalDataList/index.wxml | 2 +-
pages/insight/pages/themeBoard/index.js | 26 +++++++++----------
pages/insight/pages/themeList/index.wxml | 2 +-
8 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/pages/insight/pages/brandInsight/TailInsight/index.js b/pages/insight/pages/brandInsight/TailInsight/index.js
index d7a73a1..1786a24 100644
--- a/pages/insight/pages/brandInsight/TailInsight/index.js
+++ b/pages/insight/pages/brandInsight/TailInsight/index.js
@@ -87,7 +87,7 @@ Component({
let total = res.正面 * 1 + res.中性 * 1 + res.负面 * 1;
let arr = [];
for(let key in res) {
- let obj = {name: key, value: res[key], percent: (res[key]/total*100).toFixed(0)};
+ let obj = {name: key, value: res[key], percent: total != 0 ? (res[key]/total*100).toFixed(0):0};
arr.push(obj)
};
this.setData({ weiyiTotal: pieOption(dColor,arr), weiyiTotalData: arr})
diff --git a/pages/insight/pages/brandInsight/brandDataList/index.wxml b/pages/insight/pages/brandInsight/brandDataList/index.wxml
index 36d7a55..4c532b1 100644
--- a/pages/insight/pages/brandInsight/brandDataList/index.wxml
+++ b/pages/insight/pages/brandInsight/brandDataList/index.wxml
@@ -76,7 +76,7 @@
- 生成数据
+ 生成数据
diff --git a/pages/insight/pages/brandInsight/weiboInsight/index.js b/pages/insight/pages/brandInsight/weiboInsight/index.js
index f597c21..be439fd 100644
--- a/pages/insight/pages/brandInsight/weiboInsight/index.js
+++ b/pages/insight/pages/brandInsight/weiboInsight/index.js
@@ -98,9 +98,9 @@ Component({
}).then(res => {
let total = res.正面 * 1 + res.中性 * 1 + res.负面 * 1
let obj = {
- positive: (res.正面 / total * 100).toFixed(0),
- middle: (res.中性 / total * 100).toFixed(0),
- negative: (res.负面 / total * 100).toFixed(0),
+ positive: total != 0 ? (res.正面 / total * 100).toFixed(0) : 0,
+ middle: total != 0 ? (res.中性 / total * 100).toFixed(0) : 0,
+ negative: total != 0 ? (res.负面 / total * 100).toFixed(0) : 0,
}
this.setData({
weiboAff: obj
@@ -146,7 +146,7 @@ Component({
let obj = {
value: ele.value,
name: ele.key,
- percent: (ele.value * 100 / total).toFixed(0)
+ percent: total != 0 ? (ele.value * 100 / total).toFixed(0) : 0
};
arr.push(obj)
});
@@ -173,7 +173,7 @@ Component({
let obj = {
value: ele.value,
name: ele.key,
- percent: (ele.value * 100 / total).toFixed(0)
+ percent: total != 0 ? (ele.value * 100 / total).toFixed(0) : 0
};
arr.push(obj)
});
@@ -331,7 +331,7 @@ Component({
let obj = {
value: res.sex[key],
name: key,
- percent: (res.sex[key] * 100 / sexTotal).toFixed(0)
+ percent: sexTotal != 0 ? (res.sex[key] * 100 / sexTotal).toFixed(0) : 0
};
sexArr.push(obj)
};
@@ -343,7 +343,7 @@ Component({
let obj = {
value: res.attestation[key],
name: key,
- percent: (res.attestation[key] * 100 / sexTotal).toFixed(0)
+ percent: sexTotal != 0 ? (res.attestation[key] * 100 / sexTotal).toFixed(0) : 0
};
sexArr.push(obj)
};
@@ -355,7 +355,7 @@ Component({
let obj = {
value: res.RegionWeiBo[key],
name: key,
- percent: (res.RegionWeiBo[key] * 100 / sexTotal).toFixed(0)
+ percent: sexTotal != 0 ? (res.RegionWeiBo[key] * 100 / sexTotal).toFixed(0) : 0
};
sexArr.push(obj)
};
diff --git a/pages/insight/pages/eventInsight/evDatalist/index.wxml b/pages/insight/pages/eventInsight/evDatalist/index.wxml
index d103e9d..39e1405 100644
--- a/pages/insight/pages/eventInsight/evDatalist/index.wxml
+++ b/pages/insight/pages/eventInsight/evDatalist/index.wxml
@@ -79,7 +79,7 @@
- 生成数据
+ 生成数据
diff --git a/pages/insight/pages/eventInsight/evTailwing/index.js b/pages/insight/pages/eventInsight/evTailwing/index.js
index bbe14cb..3de2491 100644
--- a/pages/insight/pages/eventInsight/evTailwing/index.js
+++ b/pages/insight/pages/eventInsight/evTailwing/index.js
@@ -54,7 +54,7 @@ Component({
app.globalData.request({
action: this.data.wordCloudActive == 0?'getPositive':'getNegative', // 正面词云 负面词云
token: 't%2BrswgjvzGM=',
- sType: 'HotEvent',
+ sType: 'BrandWeiYi',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sStartTime: wx.getStorageSync('sStartTime') || '',
sEndTime: wx.getStorageSync('sEndTime') || '',
diff --git a/pages/insight/pages/modalInsight/modalDataList/index.wxml b/pages/insight/pages/modalInsight/modalDataList/index.wxml
index 70a2af2..84c0fde 100644
--- a/pages/insight/pages/modalInsight/modalDataList/index.wxml
+++ b/pages/insight/pages/modalInsight/modalDataList/index.wxml
@@ -76,7 +76,7 @@
- 生成数据
+ 生成数据
diff --git a/pages/insight/pages/themeBoard/index.js b/pages/insight/pages/themeBoard/index.js
index e570a98..7d1951f 100644
--- a/pages/insight/pages/themeBoard/index.js
+++ b/pages/insight/pages/themeBoard/index.js
@@ -96,7 +96,7 @@ Page({
let total = data.正面 * 1 + data.中性 * 1 + data.负面 * 1;
let arr = [];
for(let key in data) {
- let obj = {name: key, value: data[key], percent: (data[key]/total*100).toFixed(0)};
+ let obj = {name: key, value: data[key], percent: total != 0 ? (data[key]/total*100).toFixed(0):0};
arr.push(obj)
};
this.setData({ affPercent: pieOption(dColor,arr), affPercentData: arr})
@@ -261,9 +261,9 @@ Page({
getUserChar() {
let obj = {
token: 't%2BrswgjvzGM=',
- sTimeType: wx.getStorageSync('sTimeType') || 34,
- sStartTime: wx.getStorageSync('sStartTime') || '',
- sEndTime: wx.getStorageSync('sEndTime') || '',
+ sTimeType: 4,
+ sStartTime: this.data.sStartTime,
+ sEndTime: this.data.sEndTime,
sQuDao: this.data.sQuDao,
sQingGan: this.data.sQingGan,
sTitle: this.data.sTitle,
@@ -283,7 +283,7 @@ Page({
let obj = {
value: res.sex[key],
name: key,
- percent: (res.sex[key]*100/sexTotal).toFixed(0)
+ percent: sexTotal!=0? (res.sex[key]*100/sexTotal).toFixed(0):0
};
sexArr.push(obj)
};
@@ -295,7 +295,7 @@ Page({
let obj = {
value: res.attestation[key],
name: key,
- percent: (res.attestation[key]*100/sexTotal).toFixed(2)
+ percent: sexTotal!=0? (res.attestation[key]*100/sexTotal).toFixed(2):0
};
sexArr.push(obj)
};
@@ -306,9 +306,9 @@ Page({
getWordCloud() {
let obj = {
token: 't%2BrswgjvzGM=',
- sTimeType: wx.getStorageSync('sTimeType') || 34,
- sStartTime: wx.getStorageSync('sStartTime') || '',
- sEndTime: wx.getStorageSync('sEndTime') || '',
+ sTimeType: 4,
+ sStartTime: this.data.sStartTime,
+ sEndTime: this.data.sEndTime,
sQuDao: this.data.sQuDao,
sQingGan: this.data.sQingGan,
sTitle: this.data.sTitle,
@@ -325,9 +325,9 @@ Page({
getBigv() {
let obj = {
token: 't%2BrswgjvzGM=',
- sTimeType: wx.getStorageSync('sTimeType') || 34,
- sStartTime: wx.getStorageSync('sStartTime') || '',
- sEndTime: wx.getStorageSync('sEndTime') || '',
+ sTimeType: 4,
+ sStartTime: this.data.sStartTime,
+ sEndTime: this.data.sEndTime,
sQuDao: this.data.sQuDao,
sQingGan: this.data.sQingGan,
sTitle: this.data.sTitle,
@@ -352,7 +352,7 @@ Page({
let totalAff = affData.正面 * 1 + affData.中性 * 1 + affData.负面 * 1;
let arr = [];
for(let key in affData) {
- let obj = {name: key, value: affData[key], percent: (affData[key]/totalAff*100).toFixed(0)};
+ let obj = {name: key, value: affData[key], percent: totalAff!=0? (affData[key]/totalAff*100).toFixed(0):0};
arr.push(obj)
};
this.setData({ affWeiboPercent: pieOption(dColor,arr), affWeiboPercentData: arr})
diff --git a/pages/insight/pages/themeList/index.wxml b/pages/insight/pages/themeList/index.wxml
index d87ab79..3d497fc 100644
--- a/pages/insight/pages/themeList/index.wxml
+++ b/pages/insight/pages/themeList/index.wxml
@@ -110,7 +110,7 @@
- 生成数据
+ 生成数据
数据看板