add notice bar for HomeTab.vue

This commit is contained in:
Timi
2026-10-28 11:44:15 +08:00
parent e71c0e8a4e
commit bf901f4031
8 changed files with 213 additions and 96 deletions
+78 -82
View File
@@ -1,95 +1,93 @@
<template>
<t-navbar
fixed
:z-index="20"
title="客户"
>
<template #right>
<t-badge
v-if="canReadNotify"
class="notification-badge"
:count="unreadNotifyCount"
:offset="[-6, 6]"
:max-count="99"
:show-zero="false"
>
<t-button
aria-label="通知"
@click="router.push('/notify')"
theme="default"
shape="square"
variant="text"
size="small"
>
<t-icon name="notification" size="1.25rem" />
</t-button>
</t-badge>
</template>
</t-navbar>
<main class="page-content scroll column home-tab">
<section
v-for="group in visibleEntryGroupList"
:key="group.title"
class="entry-group"
<div class="page-layout navbar home-tab">
<t-navbar
fixed
:z-index="20"
title="客户"
>
<h2 v-text="group.title"/>
<div class="items" :class="group.layout">
<div
v-for="item in group.entryList"
:key="item.path"
class="item-wrap"
v-entrance-transition="{ step: 30 }"
<template #right>
<t-badge
v-if="canReadNotify"
class="notification-badge"
:count="unreadNotifyCount"
:offset="[-6, 6]"
:max-count="99"
:show-zero="false"
>
<t-button
class="item"
:class="{ quick: item.path === '/customer/quick-sign-in' || item.path === '/management/order-fulfillments/quick' }"
aria-label="通知"
@click="router.push('/notify')"
theme="default"
shape="square"
variant="text"
@click="router.push(item.path)"
size="small"
>
<div class="body">
<t-icon :name="item.icon" size="1.75rem"/>
<h2 v-text="item.title"/>
</div>
<t-icon name="notification" size="1.25rem" />
</t-button>
</t-badge>
</template>
</t-navbar>
<main class="page-content scroll column">
<pending-notice-bar />
<section
v-for="group in visibleEntryGroupList"
:key="group.title"
class="entry-group"
>
<h2 v-text="group.title"/>
<div class="items" :class="group.layout">
<div
v-for="item in group.entryList"
:key="item.path"
class="item-wrap"
v-entrance-transition="{ step: 30 }"
>
<t-button
class="item"
:class="{ quick: item.path === '/customer/quick-sign-in' || item.path === '/management/order-fulfillments/quick' }"
variant="text"
@click="router.push(item.path)"
>
<div class="body">
<t-icon :name="item.icon" size="1.75rem"/>
<h2 v-text="item.title"/>
</div>
</t-button>
</div>
</div>
</section>
<div class="help-wrap" v-entrance-transition>
<t-button
class="help"
theme="primary"
variant="text"
content="使用帮助"
@click="router.push('/management/help')"
>
<template #icon>
<t-icon name="help-circle"/>
</template>
</t-button>
<t-button
v-if="canUseAi"
class="ai"
theme="primary"
variant="text"
content="AI 小糕"
@click="openAiChat"
>
<template #icon>
<t-icon name="robot-2" />
</template>
</t-button>
</div>
</section>
<div class="help-wrap" v-entrance-transition>
<t-button
class="help"
theme="primary"
variant="text"
content="使用帮助"
@click="router.push('/management/help')"
>
<template #icon>
<t-icon name="help-circle"/>
</template>
</t-button>
<t-button
v-if="canUseAi"
class="ai"
theme="primary"
variant="text"
content="AI 小糕"
@click="openAiChat"
>
<template #icon>
<t-icon name="robot-2" />
</template>
</t-button>
</div>
</main>
</main>
</div>
</template>
<script setup lang="ts">
import { NotifyAPI, useUserStore } from "timi-web-api";
import PendingNoticeBar from "./component/PendingNoticeBar.vue";
import { corePermissionCodes, gaoRoleCodes, permissionCodes } from "@/utils/permission";
defineOptions({
@@ -208,11 +206,9 @@ onMounted(async () => {
<style scoped lang="less">
.home-tab {
gap: 1rem;
padding-left: 1rem;
padding-right: 1rem;
.entry-group {
margin: 0 1rem;
& + & {
margin-top: 1.5rem;