用户信息接口对接Mock数据

This commit is contained in:
付民康
2025-03-17 19:25:02 +08:00
parent babcfda6bf
commit ecdb6e92b9
7 changed files with 17 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
<template>
<router-link to="/personalCenter?status=all&message_type=mr">
<d-badge class="g-notice" :count="counts" :offset="[-2, 4]" :hidden="!counts" status="danger">
<d-badge class="g-notice" :count="accountInfo.noticeUnreadNum" :offset="[-2, 4]" :hidden="!accountInfo.noticeUnreadNum" status="danger">
<d-icon style="font-size: 16px" name="notice" />
</d-badge>
</router-link>
@@ -11,7 +11,9 @@ import { ref, onMounted, onBeforeUnmount } from 'vue';
import { getMessageCount } from '@/api/notice';
import { addEventListener, offEvent } from '@/utils/eventBus';
import debounce from 'lodash/debounce';
import { useAccount } from '@/utils/hooks/useAccount';
const { accountInfo, RemoveInfo } = useAccount();
const counts = ref(9);
const getCounts = () => {
getMessageCount().then((result) => {

View File

@@ -1,16 +1,16 @@
<template>
<div class="g-user-avatar flex-center ml-1" @click="toggleDropDown">
<GAvatar :width="28" :height="28" :name="accountInfo.nickname" :src="accountInfo.avatar"></GAvatar>
<GAvatar :width="28" :height="28" :name="accountInfo.username" :src="accountInfo.avatar"></GAvatar>
</div>
<d-drawer v-model="visible" class="g-user-drawer-container">
<div class="g-user-drawer">
<div class="g-user-drawer-info">
<div class="g-user-avatar">
<GAvatar style="width: 28px" :name="accountInfo.nickname" :src="accountInfo.avatar"></GAvatar>
<GAvatar style="width: 28px" :name="accountInfo.username" :src="accountInfo.avatar"></GAvatar>
</div>
<div class="g-user-drawer-info-list">
<div class="g-user-drawer-info-list-name">
<span class="break-all">{{ accountInfo.nickname }}</span>
<span class="break-all">{{ accountInfo.username?accountInfo.username[0]:'' }}</span>
<GIcon class="close-icon" name="gt-close" size="12" @click="handleClose" />
</div>
<div class="g-user-drawer-info-list-id break-all">@{{ accountInfo.username }}</div>