2022-12-11 16:21:17 +08:00
|
|
|
<template>
|
2022-12-11 17:46:29 +08:00
|
|
|
<div class="wechat">
|
2022-12-19 16:33:14 +08:00
|
|
|
<div class="head">
|
|
|
|
|
<span>居民好友统计</span><span>(统计数据为去重后的数据)</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="item">
|
|
|
|
|
<div class="item_name">居民好友</div>
|
|
|
|
|
<div class="item_num">{{ (235625).toLocaleString('en-US') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item">
|
|
|
|
|
<div class="item_name">昨日新增</div>
|
|
|
|
|
<div class="item_num">235 <img src="../img/up.png" alt="" class="imgs"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item">
|
|
|
|
|
<div class="item_name">昨日流失</div>
|
|
|
|
|
<div class="item_num">18 <img src="../img/down.png" alt="" class="imgs"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-12-20 10:21:22 +08:00
|
|
|
<div class="friends_box">
|
|
|
|
|
<div id="friends"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-12-19 16:33:14 +08:00
|
|
|
<div class="head">
|
|
|
|
|
<span>居民群统计</span><span>(统计数据为去重后的数据)</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="item">
|
|
|
|
|
<div class="item_name">居民群</div>
|
|
|
|
|
<div class="item_num">{{ (5230).toLocaleString('en-US') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item">
|
|
|
|
|
<div class="item_name">群成员</div>
|
|
|
|
|
<div class="item_num">235</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item">
|
|
|
|
|
<div class="item_name">昨日新增</div>
|
|
|
|
|
<div class="item_num">18 <img src="../img/up.png" alt="" class="imgs"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item">
|
|
|
|
|
<div class="item_name">昨日流失</div>
|
|
|
|
|
<div class="item_num">18 <img src="../img/down.png" alt="" class="imgs"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-12-20 10:21:22 +08:00
|
|
|
|
|
|
|
|
<div class="groups_box">
|
|
|
|
|
<div id="groups"></div>
|
|
|
|
|
</div>
|
2022-12-11 17:46:29 +08:00
|
|
|
</div>
|
2022-12-11 16:21:17 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-12-20 10:21:22 +08:00
|
|
|
import echarts from 'echarts';
|
2022-12-11 16:21:17 +08:00
|
|
|
export default {
|
2022-12-19 16:33:14 +08:00
|
|
|
name: "wechat",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-12-20 10:21:22 +08:00
|
|
|
mounted() {
|
|
|
|
|
this.getFriendsEcharts()
|
|
|
|
|
this.getGroupsEcharts()
|
|
|
|
|
},
|
2022-12-19 16:33:14 +08:00
|
|
|
methods: {
|
2022-12-20 10:21:22 +08:00
|
|
|
getFriendsEcharts() {
|
|
|
|
|
let friendsDom = document.getElementById('friends');
|
|
|
|
|
let myChart = echarts.init(friendsDom);
|
|
|
|
|
let option = {
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: "axis",
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: ['1月', '2月', '3月', '4月', '5月'],
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
data: [350, 230, 224, 218, 135],
|
|
|
|
|
type: 'line',
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#3975C6', // 折线线条颜色
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#3975C6', // 折角颜色
|
|
|
|
|
},
|
|
|
|
|
areaStyle: {
|
|
|
|
|
color: {
|
|
|
|
|
type: 'linear',
|
|
|
|
|
x: 0,
|
|
|
|
|
y: 0,
|
|
|
|
|
x2: 0,
|
|
|
|
|
y2: 1,
|
|
|
|
|
colorStops: [ // 渐变颜色
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#2891ff33',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: '#2891ff00',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
global: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
option && myChart.setOption(option);
|
|
|
|
|
},
|
|
|
|
|
getGroupsEcharts() {
|
|
|
|
|
let groupsDom = document.getElementById('groups');
|
|
|
|
|
let myChart = echarts.init(groupsDom);
|
|
|
|
|
let option = {
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: "axis",
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: ['1月', '2月', '3月', '4月', '5月'],
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
data: [350, 230, 224, 218, 135],
|
|
|
|
|
type: 'line',
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#3975C6', // 折线线条颜色
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#3975C6', // 折角颜色
|
|
|
|
|
},
|
|
|
|
|
areaStyle: {
|
|
|
|
|
color: {
|
|
|
|
|
type: 'linear',
|
|
|
|
|
x: 0,
|
|
|
|
|
y: 0,
|
|
|
|
|
x2: 0,
|
|
|
|
|
y2: 1,
|
|
|
|
|
colorStops: [ // 渐变颜色
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#2891ff33',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: '#2891ff00',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
global: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
option && myChart.setOption(option);
|
|
|
|
|
}
|
2022-12-19 16:33:14 +08:00
|
|
|
},
|
2022-12-11 16:21:17 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.wechat {
|
2022-12-19 16:33:14 +08:00
|
|
|
padding: 0 32px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
.head {
|
|
|
|
|
margin-top: 32px;
|
|
|
|
|
span:first-child {
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
color: #333333;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
span:last-child {
|
|
|
|
|
font-size: 26px;
|
|
|
|
|
color: #999999;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card {
|
|
|
|
|
padding: 24px 0;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
display: flex;
|
|
|
|
|
text-align: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
background: #FFF;
|
|
|
|
|
border-radius: 16px;
|
|
|
|
|
margin-top: 24px;
|
|
|
|
|
|
|
|
|
|
.item {
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
|
|
.item_name {
|
|
|
|
|
color: #666666;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item_num {
|
|
|
|
|
color: #000000;
|
|
|
|
|
font-size: 36px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
2022-12-11 16:21:17 +08:00
|
|
|
|
2022-12-19 16:33:14 +08:00
|
|
|
.imgs {
|
|
|
|
|
width: 30px;
|
|
|
|
|
height: 30px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-20 10:21:22 +08:00
|
|
|
|
|
|
|
|
.friends_box,
|
|
|
|
|
.groups_box {
|
|
|
|
|
margin-top: 24px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 514px;
|
|
|
|
|
background: #FFF;
|
|
|
|
|
|
|
|
|
|
#friends,
|
|
|
|
|
#groups {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-11 16:21:17 +08:00
|
|
|
}
|
|
|
|
|
</style>
|