|
@@ -1,11 +1,95 @@
|
|
|
<template>
|
|
|
<div class="height_100 home">
|
|
|
- <div class="content">
|
|
|
+ <template v-if="$permission.hasPermission([1,3])">
|
|
|
<div>
|
|
|
- <span v-html="getTimeState()"></span>{{ userinfo.name }}
|
|
|
+ <div class="header">
|
|
|
+ <div class="avatar">
|
|
|
+ <img class="user-avatar" v-if="avatar" :src="$commonJS.checkViewer(avatar)">
|
|
|
+ <img class="user-avatar" v-else :src="require('@/assets/user-avatar.jpeg')">
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="title">
|
|
|
+ <span v-html="getTimeState()"></span>{{ userinfo.name }}
|
|
|
+ </div>
|
|
|
+ 欢迎使用窍笔后台管理系统
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <div class="content_item loginNum">
|
|
|
+ <div class="logo">
|
|
|
+ <el-image :src="require('@/assets/image/logo3.png')" class="img" fit="contain"></el-image>
|
|
|
+ </div>
|
|
|
+ <div class="content_item_loginNum">
|
|
|
+ 今日登录用户数量:{{stats.loginCount || 0}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="content_item">
|
|
|
+ <el-row>
|
|
|
+ <template>
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="content_item_title">
|
|
|
+ 总注册人数
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="content_item_title">
|
|
|
+ 上月注册人数
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ <template>
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="content_item_content">
|
|
|
+ {{stats.signCount || 0}}
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="content_item_content">
|
|
|
+ {{stats.lastMonthSignCount || 0}}
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="content_item">
|
|
|
+ <el-row>
|
|
|
+ <template>
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="content_item_title">
|
|
|
+ 总付费人数
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="content_item_title">
|
|
|
+ 上月付费人数
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ <template>
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="content_item_content">
|
|
|
+ {{stats.paidCount || 0}}
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <span class="content_item_content">
|
|
|
+ {{stats.lastMonthPaidCount || 0}}
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- 欢迎使用窍笔后台管理系统
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div class="content2">
|
|
|
+ <div>
|
|
|
+ <span v-html="getTimeState()"></span>{{ userinfo.name }}
|
|
|
+ </div>
|
|
|
+ 欢迎使用窍笔后台管理系统
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
@@ -16,17 +100,31 @@ export default {
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
+ stats:{}
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
|
computed: {
|
|
|
userinfo(){
|
|
|
return this.$store.getters.userinfo
|
|
|
- }
|
|
|
+ },
|
|
|
+ avatar(){
|
|
|
+ return this.$s.getCookie('SET_AVATAR')
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getStats()
|
|
|
},
|
|
|
- created() {},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
+ //获取注册人数以及付费人数
|
|
|
+ getStats(){
|
|
|
+ this.$api.getStatsMessage().then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.stats = response.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getTimeState() {
|
|
|
// 获取当前时间
|
|
|
let timeNow = new Date();
|
|
@@ -54,8 +152,75 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.home{
|
|
|
position: relative;
|
|
|
+ --background:#d8d8ea;
|
|
|
+}
|
|
|
+.header{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 15px;
|
|
|
+ line-height: 40px;
|
|
|
+ font-size: 18px;
|
|
|
+ background: var(--background) !important;
|
|
|
+ border-radius: 8px;
|
|
|
+ .avatar{
|
|
|
+ margin-right:15px;
|
|
|
+ }
|
|
|
+ .user-avatar {
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ border-radius: 40px;
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
+ .title{
|
|
|
+ font-weight: bold;
|
|
|
+ background: linear-gradient(to right, red, blue);
|
|
|
+ -webkit-background-clip: text;
|
|
|
+ color: transparent;
|
|
|
+ font-size: 28px;
|
|
|
+ }
|
|
|
}
|
|
|
.content{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .content_item{
|
|
|
+ width: 500px;
|
|
|
+ height: 100px;
|
|
|
+ background: var(--background);
|
|
|
+ border-radius: 8px;
|
|
|
+ margin-top: 15px;
|
|
|
+ margin-right: 15px;
|
|
|
+ padding: 20px;
|
|
|
+ line-height: 50px;
|
|
|
+ text-align: center;
|
|
|
+ &:last-child{
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ .content_item_content{
|
|
|
+ font-size: 32px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .loginNum{
|
|
|
+ width: 350px;
|
|
|
+ font-weight: bold;
|
|
|
+ .logo{
|
|
|
+ width: 140px;
|
|
|
+ height: 40px;
|
|
|
+ .img{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content_item_loginNum{
|
|
|
+ line-height: 60px;
|
|
|
+ text-align: start;
|
|
|
+ padding-left: 16px;
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.content2{
|
|
|
position: absolute;
|
|
|
inset: 0;
|
|
|
margin: auto;
|