zx 3 years ago
parent 69f95221ca
commit 1cc7a8d909

@ -7,6 +7,39 @@ function splitQueryParams(params) {
}
return tempParams.join("&");
}
! function () {
//获取页面配置并进行页面分享配置
var PageTmp = Page
Page = function (pageConfig) {
//1. 获取当前页面路由
let routerUrl = ""
wx.onAppRoute(function (res) {
//app.js中需要在隐式路由中才能用getCurrentPages获取到页面路由
let pages = getCurrentPages(),
view = pages[pages.length - 1];
routerUrl = view.route
})
//2. 全局开启分享配置
pageConfig = Object.assign({
onShareAppMessage: function () {
//根据不同路由设置不同分享内容(微信小程序分享自带参数,如非特例,不需配置分享路径)
let shareInfo={}
let noGlobalSharePages=["index/index"]
//全局分享配置,如部分页面需要页面默认分享或自定义分享可以单独判断处理
if (!routerUrl.includes(noGlobalSharePages)){
shareInfo = {
title: "硕为思汽车智能洞察",
// imageUrl: wx.getStorageSync("shareUrl")
}
}
return shareInfo
}
}, pageConfig);
// 配置页面模板
PageTmp(pageConfig);
}
}();
App({
onLaunch: function () {
// 展示本地存储能力

@ -17,6 +17,18 @@ Component({
wlvl: 36,
wShow: false,
wordCloudData: [],
pieColor: [
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
],
},
methods: {
getData() {

@ -27,7 +27,7 @@
<view class="circle-data">
<view wx:for="{{weiyiTotalData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: space-between;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">

@ -157,4 +157,7 @@
border-radius: 4rpx;
padding: 16px;
overflow: hidden;
}
.colorTags {
width: 10px;height: 10px;border-radius: 1px;
}

@ -35,14 +35,16 @@ Page({
sBrand: wx.getStorageSync('sBrand') || '',
}).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)
if(total > 0) {
let obj = {
positive: (res.正面/total*100).toFixed(0),
middle: (res.中性/total*100).toFixed(0),
negative: (res.负面/total*100).toFixed(0)
}
this.setData({
affData: obj
})
}
this.setData({
affData: obj
})
});
},
toDataList() {

@ -9,6 +9,35 @@ const app = getApp();
const dColor=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6']
Component({
data: {
colorList: [
'background: #5470c6',
'background: #91cc75',
'background: #fac858',
'background: #ee6666',
'background: #73c0de',
'background: #3ba272',
'background: #fc8452',
'background: #9a60b4',
'background: #ea7ccc',
'background: #c23531',
'background: #c23531',
'background: #61a0a8',
'background: #d48265',
'background: #91c7ae',
'background: #749f83',
],
pieColor: [
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
],
imageUrl: getApp().globalData.imageUrl,
showChart: true,
weiboData: {},
@ -226,7 +255,6 @@ Component({
sEndTime: wx.getStorageSync('sEndTime') || '',
sBrand: wx.getStorageSync('sBrand') || '',
}).then(res => {
console.log(res)
let dName = []; let dPositive = [];let dNegative = [];
res.forEach(ele => {
dName.push(ele.key);
@ -273,7 +301,7 @@ Component({
let obj = {
value: res.attestation[key],
name: key,
percent: (res.attestation[key]*100/sexTotal).toFixed(2)
percent: (res.attestation[key]*100/sexTotal).toFixed(0)
};
sexArr.push(obj)
};

@ -1,7 +1,7 @@
<view class="wb-content">
<view class="wb-item">
<view class="wb-chart-title">微博信息</view>
<view class="wb-chart-item" style="padding: 16rpx 0rpx 16rpx 32rpx;height: 185rpx;">
<view class="wb-chart-item" style="padding: 16rpx 0rpx 16rpx 0rpx;height: 195rpx;">
<view class="wb-data">
<view>信息总量</view><view>参与大V总量</view><view>参与用户数</view>
</view>
@ -20,7 +20,7 @@
</view>
<view class="wb-item">
<view class="wb-chart-title">微博传播趋势</view>
<view class="wb-chart-item" style="width: 100%;margin-left: -40rpx;">
<view class="wb-chart-item" style="width: 100%;margin-left: -30rpx;">
<c-echars showChart="{{showChart}}" canvasId="yqTrans-canvas" chartId="yqTransLine" chartOption="{{yqTransform}}" height="100%"></c-echars>
</view>
</view>
@ -31,9 +31,9 @@
<c-echars showChart="{{showChart}}" canvasId="wbkol-canvas" chartId="wbkol" chartOption="{{weiboKol}}" height="100%"></c-echars>
</view>
<scroll-view class="circle-data" scroll-y>
<view wx:for="{{weiboKolData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view wx:for="{{weiboKolData}}" wx:for-item="item" wx:for-index="index" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{colorList[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -55,9 +55,9 @@
<c-echars showChart="{{showChart}}" canvasId="wbtype-canvas" chartId="wbtype" chartOption="{{weiboType}}" height="100%"></c-echars>
</view>
<view class="circle-data">
<view wx:for="{{weiboTypeData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view wx:for="{{weiboTypeData}}" wx:for-item="item" wx:key="name" wx:for-index="index" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -88,9 +88,9 @@
<c-echars showChart="{{showChart}}" canvasId="wbuser-canvas" chartId="wbuser" chartOption="{{weiboUserChart}}" height="100%"></c-echars>
</view>
<scroll-view class="circle-data" scroll-y>
<view wx:for="{{weiboRegionData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view wx:for="{{weiboRegionData}}" wx:for-item="item" wx:key="name" wx:for-index="index" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">

@ -37,7 +37,7 @@
font-size: 12px;
font-weight: 400;
color: #999999;
margin: 0rpx 48rpx 0rpx 0rpx;
margin: 0rpx 24rpx 0rpx 30rpx;
}
.wb-data-number {
display: flex;
@ -45,7 +45,7 @@
font-size: 14px;
font-weight: 600;
color: #333333;
margin: 16rpx 48rpx 16rpx 0rpx;
margin: 16rpx 24rpx 16rpx 30rpx;
}
.circle-chart {
width: 50%;
@ -148,4 +148,7 @@
border-radius: 4rpx;
padding: 16px;
overflow: hidden;
}
.colorTags {
width: 10px;height: 10px;border-radius: 1px;
}

@ -25,30 +25,11 @@ Component({
//热门词云
wordCloudActive: 0,
wordCloudData: [],
eventTransActive: 0,
},
methods: {
getData() {
app.globalData.request({
action: 'getSourcetypeTime', //事件传播态势
token: 't%2BrswgjvzGM=',
sType: 'HotEvent',
sTimeType: wx.getStorageSync('sTimeType') || 34,
sStartTime: wx.getStorageSync('sStartTime') || '',
sEndTime: wx.getStorageSync('sEndTime') || '',
sRele: wx.getStorageSync('sRele') || '',
}).then(res => {
let dx = [];
let dValue = [[],[],[],[],[],[],[]];
res.forEach(ele => {
dx.push(ele.Time)
for(let i=0;i<ele.Data.length;i++) {
dValue[i].push(ele.Data[i])
}
});
this.setData({
eventTransform: brokenLine(dName,dValue,dColor,dx)
})
});
this.getEventTrans();
app.globalData.request({
action: 'getSourceTop', //传播重点媒体
token: 't%2BrswgjvzGM=',
@ -118,6 +99,29 @@ Component({
});
this.getWordCloud();
},
getEventTrans() {
app.globalData.request({
action: 'getSourcetypeTime', //事件传播态势
token: 't%2BrswgjvzGM=',
sType: 'HotEvent',
sTimeType: this.data.eventTransActive == 0 ? '34' : '20',
// sStartTime: wx.getStorageSync('sStartTime') || '',
// sEndTime: wx.getStorageSync('sEndTime') || '',
sRele: wx.getStorageSync('sRele') || '',
}).then(res => {
let dx = [];
let dValue = [[],[],[],[],[],[],[]];
res.forEach(ele => {
dx.push(ele.Time)
for(let i=0;i<ele.Data.length;i++) {
dValue[i].push(ele.Data[i])
}
});
this.setData({
eventTransform: brokenLine(dName,dValue,dColor,dx)
})
});
},
getWordCloud() {
app.globalData.request({
action: this.data.wordCloudActive == 0?'getHotWord':this.data.wordCloudActive == 1?'getPositive':'getNegative', //热门词云 正面词云 负面词云
@ -139,6 +143,10 @@ Component({
changeWordCloud(event) {
this.setData({wordCloudActive: event.detail.index});
this.getWordCloud()
},
changeEventTransActive(event) {
this.setData({eventTransActive: event.detail.index});
this.getEventTrans()
}
},
lifetimes: {

@ -1,7 +1,16 @@
<view class="evt-content">
<view class="evt-item">
<view class="evt-chart-title">事件传播态势</view>
<view class="evt-chart-item" style="width: 96%;margin-left: 16rpx;">
<!-- <view class="evt-chart-title">事件传播态势</view> -->
<view class="evw-area-title">
<view style="width: 50%;">事件传播态势</view>
<view style="width: 50%;">
<van-tabs type="card" active="{{ eventTransActive }}" color="#BBBBBB" bind:change="changeEventTransActive">
<van-tab title="按小时"></van-tab>
<van-tab title="按天"></van-tab>
</van-tabs>
</view>
</view>
<view class="evt-chart-item" style="width: 96%;margin-left: 16rpx;margin-top: 16rpx">
<c-echars showChart="{{showChart}}" canvasId="evt-trans" chartId="evt-transLine" chartOption="{{eventTransform}}" height="100%"></c-echars>
</view>
</view>

@ -20,6 +20,18 @@ Component({
//kol观点
kolActive: 0,
kolData: [],
pieColor: [
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
],
},
methods: {
getData() {

@ -17,7 +17,7 @@
<scroll-view class="circle-data" scroll-y>
<view wx:for="{{weiboRegionData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -41,7 +41,7 @@
<scroll-view class="circle-data" scroll-y>
<view wx:for="{{weiboAffData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">

@ -157,4 +157,7 @@
}
.evw-media-item {
padding: 24rpx 16rpx 0rpx 32rpx;
}
.colorTags {
width: 10px;height: 10px;border-radius: 1px;
}

@ -1,6 +1,5 @@
<view>
<view class="top-brand-switch">
<time-custom bind:change="changeTime"></time-custom>
<view class="switch-container">
<view class="switch-middle">
<view class="main-title">{{detailData.title}}</view>

@ -43,6 +43,18 @@ Component({
// 疑似车黑ID
carHaterId: histogram([],[],[],'#20CC62'),
idEventChart: histogram([],[],[],'#20CC62'),
pieColor: [
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
],
},
methods: {
getData() {

@ -53,7 +53,7 @@
<view class="circle-data">
<view wx:for="{{tutorAffData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: space-between;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -83,7 +83,7 @@
<view class="circle-data" style="margin-top: 24rpx;height: auto;">
<view wx:for="{{dataCompData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: space-between;">
<view class="circle-data-item" style="width: 60%;">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -138,7 +138,7 @@
<view class="circle-data" style="margin-top: 24rpx;height: auto;">
<view wx:for="{{mainUserData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: space-between;">
<view class="circle-data-item" style="width: 60%;">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -205,7 +205,7 @@
<view class="circle-data" style="margin-top: 24rpx;height: auto;">
<view wx:for="{{subUserData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: space-between;">
<view class="circle-data-item" style="width: 60%;">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">

@ -154,4 +154,7 @@
.rank_num {
width: 53rpx;
height: 40rpx;
}
.colorTags {
width: 10px;height: 10px;border-radius: 1px;
}

@ -48,15 +48,17 @@ Page({
sSeriesName: wx.getStorageSync('sSeriesName') || '',
}).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)
if(total > 0) {
let obj = {
positive: (res.正面/total*100).toFixed(0),
middle: (res.中性/total*100).toFixed(0),
negative: (res.负面/total*100).toFixed(0)
}
this.setData({
affData: obj,
totalCount: total
})
}
this.setData({
affData: obj,
totalCount: total
})
});
},
toDataList() {

@ -23,13 +23,13 @@
<van-divider custom-style="background: linear-gradient(117deg, rgba(245,245,245,0) 0%, #EEEEEE 50%, rgba(232,232,232,0) 100%);" hairline />
<van-row>
<van-col class="tab-btn" span="8">
<text style="font-size: 12px;font-weight: 400;color: rgba(255,255,255,0.6000);">正面调性</text><text class="brand-number"> {{affData.positive}}%</text>
<text style="font-size: 12px;font-weight: 400;color: rgba(255,255,255,0.6000);">正面调性</text><text class="brand-number"> {{affData.positive || 0}}%</text>
</van-col>
<van-col class="tab-btn" span="8">
<text style="font-size: 12px;font-weight: 400;color: rgba(255,255,255,0.6000);">负面调性</text><text class="brand-number"> {{affData.negative}}%</text>
<text style="font-size: 12px;font-weight: 400;color: rgba(255,255,255,0.6000);">负面调性</text><text class="brand-number"> {{affData.negative || 0}}%</text>
</van-col>
<van-col class="tab-btn" span="8">
<text style="font-size: 12px;font-weight: 400;color: rgba(255,255,255,0.6000);">中性调性</text><text class="brand-number"> {{affData.middle}}%</text>
<text style="font-size: 12px;font-weight: 400;color: rgba(255,255,255,0.6000);">中性调性</text><text class="brand-number"> {{affData.middle || 0}}%</text>
</van-col>
</van-row>
</view>

@ -34,6 +34,35 @@ Component({
//kol观点
kolActive: 0,
kolData: [],
colorList: [
'background: #5470c6',
'background: #91cc75',
'background: #fac858',
'background: #ee6666',
'background: #73c0de',
'background: #3ba272',
'background: #fc8452',
'background: #9a60b4',
'background: #ea7ccc',
'background: #c23531',
'background: #c23531',
'background: #61a0a8',
'background: #d48265',
'background: #91c7ae',
'background: #749f83',
],
pieColor: [
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
],
},
methods: {
getData() {

@ -33,7 +33,7 @@
<scroll-view class="circle-data" scroll-y>
<view wx:for="{{weiboKolData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{colorList[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -57,7 +57,7 @@
<view class="circle-data">
<view wx:for="{{weiboTypeData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -90,7 +90,7 @@
<scroll-view class="circle-data" scroll-y>
<view wx:for="{{weiboRegionData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">

@ -147,4 +147,7 @@
border-radius: 4rpx;
padding: 16px;
overflow: hidden;
}
.colorTags {
width: 10px;height: 10px;border-radius: 1px;
}

@ -45,6 +45,18 @@ Page({
//活跃用户地区
wbActiveUserArea1: [],
wbActiveUserArea2: [],
pieColor: [
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
'background: rgb(244,72,85)',
'background: rgb(245,109,47)',
'background: rgb(248,189,32)',
'background: rgb(75,203,100)',
'background: rgb(75,214,213)',
],
},
onLoad(option) {
this.setData({

@ -76,7 +76,7 @@
<view class="kol-content">
<view class="kol-item" style="background: #FFF0F1;" wx:for="{{kolDataMedia}}" wx:key="index" wx:if="{{index<3}}">
<!-- <image style="width: 64rpx;height: 64rpx;margin-top: 20rpx;" src="{{item._source.profileimgurl}}" /> -->
<view class="kol-user-name">{{item.name}}</view>
<view class="kol-user-name" style="margin-top: 25%">{{item.name}}</view>
<view style="display: flex;justify-content: space-between;padding: 24rpx 24rpx 0rpx 24rpx">
<view class="kol-value">传播值</view>
<view class="kol-value-number">{{item.value}}</view>
@ -86,7 +86,7 @@
<view class="kol-content">
<view class="kol-item" style="background: #FFF0F1;" wx:for="{{kolDataMedia}}" wx:key="index" wx:if="{{index>=3&&index<6}}">
<!-- <image style="width: 64rpx;height: 64rpx;margin-top: 20rpx;" src="{{item._source.profileimgurl}}" /> -->
<view class="kol-user-name">{{item.name}}</view>
<view class="kol-user-name" style="margin-top: 25%">{{item.name}}</view>
<view style="display: flex;justify-content: space-between;padding: 24rpx 24rpx 0rpx 24rpx">
<view class="kol-value">传播值</view>
<view class="kol-value-number">{{item.value}}</view>
@ -96,7 +96,7 @@
<view class="kol-content">
<view class="kol-item" style="background: #FFF0F1;" wx:for="{{kolDataMedia}}" wx:key="index" wx:if="{{index>=6&&index<9}}">
<!-- <image style="width: 64rpx;height: 64rpx;margin-top: 20rpx;" src="{{item._source.profileimgurl}}" /> -->
<view class="kol-user-name">{{item.name}}</view>
<view class="kol-user-name" style="margin-top: 25%">{{item.name}}</view>
<view style="display: flex;justify-content: space-between;padding: 24rpx 24rpx 0rpx 24rpx">
<view class="kol-value">传播值</view>
<view class="kol-value-number">{{item.value}}</view>
@ -126,7 +126,7 @@
<view class="circle-data">
<view wx:for="{{affPercentData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: space-between;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -175,7 +175,7 @@
<scroll-view class="circle-data" scroll-y>
<view wx:for="{{themeUserData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: flex-start;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">
@ -259,7 +259,7 @@
<view class="circle-data">
<view wx:for="{{affWeiboPercentData}}" wx:for-item="item" wx:key="name" style="margin-bottom: 64rpx;display: flex;justify-content: space-between;">
<view class="circle-data-item">
<view style="width: 10px;height: 10px;background: #0084FF;border-radius: 1px;"></view>
<view class="colorTags" style="{{pieColor[index]}}"></view>
<view class="circle-data-title">{{item.name}}</view>
</view>
<view class="circle-data-item">

@ -244,4 +244,7 @@
.area-item-chart{
width: 50%;
height: 410rpx;
}
.colorTags {
width: 10px;height: 10px;border-radius: 1px;
}

@ -3,6 +3,8 @@ import moment from "moment"
Page({
data: {
Guid: '',
total: 0,
selectedNumber: 0,
//form
sQuDao: [],
sQingGan: [],
@ -33,6 +35,10 @@ Page({
show2: false,
d1: 0,
d2: 0,
//导出字段
reportOption: [],
reportShow: false,
fieldList: [],
},
onLoad: function(options) {
this.setData({Guid: options.Guid, sStartTime: options.StartTime, sEndTime: options.EndTime})
@ -94,6 +100,18 @@ Page({
});
this.setData({searchOption: option})
});
app.globalData.request({
action: 'getToExcelField', //获取导出字段
sType: 'BrandData',
token: 't%2BrswgjvzGM=',
}).then(res => {
let option = [];
res.forEach(ele => {
let obj = {name: ele.name, value: ele.field};
option.push(obj)
});
this.setData({reportOption: option})
});
},
getData() {
app.globalData.request({
@ -114,7 +132,7 @@ Page({
iTimeType: this.data.iTimeType, //0发布时间 1入库时间
iGroupBy: this.data.iGroupBy, //0不去重 1相似度去重
listType: this.data.listType, //0默认 1影响力倒序
}).then(res => {
},(res) => {this.setData({total: res.totalNum})} ).then(res => {
this.setData({dataList: res})
});
},
@ -137,6 +155,11 @@ Page({
sTitleChange(event) {this.setData({ sTitle: event.detail });this.getData()},
changeSelectAll(event) {
this.setData({ isSelectAll: event.detail});
if(event.detail.length != 0) {
this.setData({selectedNumber: this.data.total});
} else {
this.setData({selectedNumber: this.data.dataList.length});
}
},
toThemeBoard() {
let Guid = this.data.Guid;
@ -152,7 +175,12 @@ Page({
toDetail() {
// 外链
},
openReport() {
this.setData({reportShow: true})
},
report() { //生成数据
let d = new Date();
let date = d.getFullYear().toString() + (d.getMonth()+1)+ d.getDate()
app.globalData.request({
action: 'toExcel', //数据列表
token: 't%2BrswgjvzGM=',
@ -165,14 +193,23 @@ Page({
sTitleType: this.data.sTitleType,
sType: 'ZhuTiFenXiBl',
sGuid: this.data.Guid,
sField: '', //导出字段
sFileName: '', //文件名称
sField: this.data.fieldList.join(','), //导出字段
sFileName: "事件数据"+date, //文件名称
sCheckedIds: '', //数据id
iNum: 0, //导出条数
iNum: this.data.selectedNumber, //导出条数
iTimeType: this.data.iTimeType, //0发布时间 1入库时间
}).then(res => {
console.log(res)
});
},(res) => {
if(res.Code == 1) {
this.setData({reportShow: false})
wx.showModal({
title: '数据生成中,请前往”我的“查看生成进度',
showCancel: false
})
}
}).then(() => {});
},
fieldChange(event) {
this.setData({fieldList: event.detail})
},
// 时间选择器
onDisplayStart() {

@ -12,17 +12,27 @@
<view class="top-tab">
<van-dropdown-menu>
<van-dropdown-item id="allSource" title="全部渠道">
<van-checkbox-group value="{{ sQuDao }}" bind:change="changeSource">
<van-checkbox wx:for="{{affList}}" wx:key="key" name="{{item.key}}" shape="square">{{item.value}}</van-checkbox>
</van-checkbox-group>
<view style="padding: 24rpx">
<van-checkbox-group value="{{ sQuDao }}" bind:change="changeSource">
<van-checkbox wx:for="{{affList}}" wx:key="key" name="{{item.key}}" shape="square">
<view style="margin: 12rpx">{{item.value}}</view>
</van-checkbox>
</van-checkbox-group>
</view>
</van-dropdown-item>
<van-dropdown-item id="allAff" title="全部调性">
<van-checkbox-group value="{{ sQingGan }}" bind:change="changeQingGan">
<van-checkbox wx:for="{{qgList}}" wx:key="key" name="{{item.key}}" shape="square">{{item.value}}</van-checkbox>
</van-checkbox-group>
<van-checkbox-group value="{{ sCrisis }}" bind:change="changeWeiJi">
<van-checkbox wx:for="{{wjList}}" wx:key="key" name="{{item.key}}" shape="square">{{item.value}}</van-checkbox>
</van-checkbox-group>
<view style="padding: 24rpx">
<van-checkbox-group value="{{ sQingGan }}" bind:change="changeQingGan">
<van-checkbox wx:for="{{qgList}}" wx:key="key" name="{{item.key}}" shape="square">
<view style="margin: 12rpx">{{item.value}}</view>
</van-checkbox>
</van-checkbox-group>
<van-checkbox-group value="{{ sCrisis }}" bind:change="changeWeiJi">
<van-checkbox wx:for="{{wjList}}" wx:key="key" name="{{item.key}}" shape="square">
<view style="margin: 12rpx">{{item.value}}</view>
</van-checkbox>
</van-checkbox-group>
</view>
</van-dropdown-item>
<van-dropdown-item id="sort" title="时间范围">
<view>
@ -87,8 +97,17 @@
</van-checkbox-group>
</view>
<view style="width: 80%;">
<van-button bind:click="report" custom-style="width: 45%" color="#0084FF" class="theme-add-btn" plain>生成数据</van-button>
<van-button bind:click="openReport" custom-style="width: 45%" color="#0084FF" class="theme-add-btn" plain>生成数据</van-button>
<van-button bind:click="toThemeBoard" custom-style="width: 45%" color="#0084FF" class="theme-add-btn">数据看板</van-button>
</view>
</view>
<van-dialog use-slot title="生成数据" show="{{reportShow}}" bind:confirm="report" show-cancel-button>
<scroll-view scroll-y style="height: 380rpx;">
<van-checkbox-group value="{{ fieldList }}" bind:change="fieldChange">
<van-checkbox wx:for="{{reportOption}}" wx:key="key" name="{{item.value}}" shape="square">
{{item.name}}
</van-checkbox>
</van-checkbox-group>
</scroll-view>
</van-dialog>
</view>

@ -58,7 +58,7 @@
.content_button{
display: flex;
margin-top: 20rpx;
margin-left: 270rpx;
margin-left: 42%;
}
/* tabs */
.view-tabs .van-tabs__nav{

Loading…
Cancel
Save