|
@@ -34,8 +34,8 @@
|
|
|
</div>
|
|
|
<div class="task-list">
|
|
|
<div class="task-item">
|
|
|
- <div class="task-title">{{t('home.pendingTasks')}}</div>
|
|
|
- <div class="task-num">0</div>
|
|
|
+ <div class="task-title">全部用户</div>
|
|
|
+ <div class="task-num">{{ totalUsers }}</div>
|
|
|
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
<path d="M3.125 11.875H26.875V25.625C26.875 26.3154 26.3154 26.875 25.625 26.875H4.375C3.68464 26.875 3.125 26.3154 3.125 25.625V11.875Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
|
|
|
<path d="M3.125 6.25C3.125 5.55964 3.68464 5 4.375 5H25.625C26.3154 5 26.875 5.55964 26.875 6.25V11.875H3.125V6.25Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
|
|
@@ -45,8 +45,8 @@
|
|
|
</svg>
|
|
|
</div>
|
|
|
<div class="task-item">
|
|
|
- <div class="task-title">{{t('home.ccTasks')}}</div>
|
|
|
- <div class="task-num">0</div>
|
|
|
+ <div class="task-title">在线用户</div>
|
|
|
+ <div class="task-num">{{ activeUsers }}</div>
|
|
|
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
<path d="M26.875 3.125L18.5625 26.875L13.8125 16.1875L3.125 11.4375L26.875 3.125Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
|
|
|
<path d="M26.8751 3.125L13.8126 16.1875" stroke="#167AF0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -60,12 +60,32 @@
|
|
|
<script setup lang="ts">
|
|
|
import {useUserInfo} from '/@/stores/userInfo';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
+import { getUserNum } from '/@/api/marketing/data';
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
const { user } = useUserInfo().userInfos;
|
|
|
console.log('user', user);
|
|
|
|
|
|
+const getUserTime = ref(0);
|
|
|
+const totalUsers = ref('0')
|
|
|
+const activeUsers = ref('0')
|
|
|
+onMounted(() => {
|
|
|
+ getUserNum().then((res) => {
|
|
|
+ totalUsers.value = res.data.totalUsers;
|
|
|
+ activeUsers.value = res.data.activeUsers;
|
|
|
+ });
|
|
|
+ getUserTime.value = setInterval(() => {
|
|
|
+ getUserNum().then((res) => {
|
|
|
+ totalUsers.value = res.data.totalUsers;
|
|
|
+ activeUsers.value = res.data.activeUsers;
|
|
|
+ });
|
|
|
+ }, 10* 60* 1000)
|
|
|
+});
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ clearInterval(getUserTime.value);
|
|
|
+})
|
|
|
|
|
|
const errorHandler = () => {
|
|
|
return './src/assets/avatar.png'
|