This commit is contained in:
2026-08-12 18:49:54 +08:00
parent 13a856cef9
commit 71b3361361
9 changed files with 67 additions and 48 deletions
+2 -2
View File
@@ -141,7 +141,7 @@ watch(mobileMenuOpen, async (open, wasOpen) => {
})
onMounted(() => {
void notifications.refreshUnreadCount()
if (auth.hasPermission('merchant:notification:view')) void notifications.refreshUnreadCount()
document.addEventListener('keydown', handleKeydown)
window.addEventListener('beforeunload', handleBeforeUnload)
desktopMediaQuery = window.matchMedia('(min-width: 721px)')
@@ -202,7 +202,7 @@ async function handleLogout() {
<p v-if="pageDescription">{{ pageDescription }}</p>
</div>
<div class="client-user">
<button class="client-header-notifications" type="button" disabled title="消息中心接口待接入" aria-label="我的消息,接口待接入"><Bell :size="19" /><span v-if="notifications.unreadCount !== null && notifications.unreadCount > 0" class="client-header-notifications-badge">{{ notifications.unreadCount > 99 ? '99+' : notifications.unreadCount }}</span></button>
<RouterLink v-if="auth.hasPermission('merchant:notification:view')" class="client-header-notifications" to="/notifications" aria-label="打开我的消息"><Bell :size="19" /><span v-if="notifications.unreadCount !== null && notifications.unreadCount > 0" class="client-header-notifications-badge">{{ notifications.unreadCount > 99 ? '99+' : notifications.unreadCount }}</span></RouterLink>
<span class="client-avatar">{{ auth.user?.name.slice(0, 1) }}</span>
<span class="client-user-copy"><strong>{{ auth.user?.name }}</strong><small>{{ auth.user?.roles.join('、') }}</small></span>
</div>