新增公告中心功能
## 功能概述 在钱包旁边新增公告中心,用户可以查看平台通知、教程、规则和常见问题。 ## 主要变更 ### 后端 - 新增 announcement 模块(handler/service/repository) - 新增 announcements 数据库表 - 添加公告相关 API 端点(用户端和管理端) - 扩展 response 包,新增 NotFound 和 InternalServerError 方法 ### 前端 - 新增公告功能模块(/features/announcement) - 实现公告列表页和详情页 - 在顶部导航添加公告入口(钱包旁边) - 支持按分类筛选(通知、教程、规则、FAQ) - 支持置顶和重要标记显示 ### 数据库 - 迁移文件:000005_add_announcements.sql - 示例数据:000006_insert_sample_announcements.sql - 包含6条示例公告 ## 技术特点 - 遵循项目现有架构模式 - 响应式设计,支持移动端 - 自动统计浏览次数 - 支持富文本内容展示 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { apiRequest } from '@/utils/apiRequest'
|
||||
|
||||
export interface Announcement {
|
||||
id: number
|
||||
title: string
|
||||
content: string
|
||||
category: string
|
||||
priority: number
|
||||
is_pinned: boolean
|
||||
is_important: boolean
|
||||
view_count: number
|
||||
status: string
|
||||
published_at: string | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface AnnouncementListParams {
|
||||
category?: string
|
||||
page?: number
|
||||
page_size?: number
|
||||
}
|
||||
|
||||
export interface PaginatedResult<T> {
|
||||
items: T[]
|
||||
total: number
|
||||
page: number
|
||||
page_size: number
|
||||
}
|
||||
|
||||
export async function fetchAnnouncements(params: AnnouncementListParams = {}): Promise<PaginatedResult<Announcement>> {
|
||||
return apiRequest<PaginatedResult<Announcement>>('/api/announcements', {
|
||||
method: 'GET',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
export async function fetchAnnouncementDetail(id: number): Promise<Announcement> {
|
||||
return apiRequest<Announcement>(`/api/announcements/${id}`, {
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './api/announcements'
|
||||
@@ -0,0 +1,305 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ArrowLeft, Bell, Calendar, Document, QuestionFilled, View, Warning } from '@element-plus/icons-vue'
|
||||
import { fetchAnnouncementDetail, type Announcement } from '@/features/announcement'
|
||||
import { formatDateTime } from '@/utils/time'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
const announcement = ref<Announcement | null>(null)
|
||||
|
||||
const categories = [
|
||||
{ value: 'notice', label: '通知公告', icon: Bell, color: '#3b82f6' },
|
||||
{ value: 'tutorial', label: '使用教程', icon: Document, color: '#10b981' },
|
||||
{ value: 'rule', label: '规则说明', icon: Warning, color: '#f59e0b' },
|
||||
{ value: 'faq', label: '常见问题', icon: QuestionFilled, color: '#8b5cf6' },
|
||||
]
|
||||
|
||||
onMounted(loadAnnouncement)
|
||||
|
||||
async function loadAnnouncement() {
|
||||
const id = Number(route.params.id)
|
||||
if (!id) {
|
||||
router.push('/announcements')
|
||||
return
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
announcement.value = await fetchAnnouncementDetail(id)
|
||||
} catch (err) {
|
||||
console.error('加载公告失败', err)
|
||||
router.push('/announcements')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
router.push('/announcements')
|
||||
}
|
||||
|
||||
function getCategoryInfo(category: string) {
|
||||
return categories.find(c => c.value === category) || categories[0]
|
||||
}
|
||||
|
||||
function getCategoryLabel(category: string) {
|
||||
const cat = categories.find(c => c.value === category)
|
||||
return cat ? cat.label : category
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="page announcement-detail-page" v-loading="loading">
|
||||
<div class="detail-header">
|
||||
<button class="back-button" @click="goBack">
|
||||
<el-icon><ArrowLeft /></el-icon>
|
||||
<span>返回列表</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="announcement" class="announcement-detail-card">
|
||||
<div class="detail-meta">
|
||||
<el-tag
|
||||
:type="announcement.category === 'notice' ? 'primary' : 'info'"
|
||||
effect="plain"
|
||||
size="small"
|
||||
class="category-tag"
|
||||
:style="{
|
||||
borderColor: getCategoryInfo(announcement.category).color,
|
||||
color: getCategoryInfo(announcement.category).color
|
||||
}"
|
||||
>
|
||||
<el-icon><component :is="getCategoryInfo(announcement.category).icon" /></el-icon>
|
||||
{{ getCategoryLabel(announcement.category) }}
|
||||
</el-tag>
|
||||
<el-tag v-if="announcement.is_pinned" type="warning" effect="plain" size="small">置顶</el-tag>
|
||||
<el-tag v-if="announcement.is_important" type="danger" effect="plain" size="small">重要</el-tag>
|
||||
</div>
|
||||
|
||||
<h1 class="detail-title">{{ announcement.title }}</h1>
|
||||
|
||||
<div class="detail-info">
|
||||
<span class="info-item">
|
||||
<el-icon><Calendar /></el-icon>
|
||||
发布时间:{{ formatDateTime(announcement.published_at || announcement.created_at) }}
|
||||
</span>
|
||||
<span class="info-item">
|
||||
<el-icon><View /></el-icon>
|
||||
浏览次数:{{ announcement.view_count }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="detail-divider"></div>
|
||||
|
||||
<div class="detail-content" v-html="announcement.content"></div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.announcement-detail-page {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.back-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 10px 18px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 10px;
|
||||
background: #ffffff;
|
||||
color: #64748b;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.back-button:hover {
|
||||
border-color: #3b82f6;
|
||||
background: #eff6ff;
|
||||
color: #3b82f6;
|
||||
}
|
||||
|
||||
.announcement-detail-card {
|
||||
padding: 40px;
|
||||
border: 1px solid #e6eaf2;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 12px 30px rgba(17, 24, 39, 0.05);
|
||||
}
|
||||
|
||||
.detail-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.category-tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
margin: 0 0 20px;
|
||||
color: #111827;
|
||||
font-size: 28px;
|
||||
font-weight: 800;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.detail-info {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: #64748b;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.info-item .el-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.detail-divider {
|
||||
height: 1px;
|
||||
margin-bottom: 32px;
|
||||
background: #e6eaf2;
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
color: #334155;
|
||||
font-size: 16px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.detail-content :deep(h1),
|
||||
.detail-content :deep(h2),
|
||||
.detail-content :deep(h3) {
|
||||
margin: 28px 0 16px;
|
||||
color: #111827;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.detail-content :deep(h1) {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.detail-content :deep(h2) {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.detail-content :deep(h3) {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.detail-content :deep(p) {
|
||||
margin: 16px 0;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.detail-content :deep(ul),
|
||||
.detail-content :deep(ol) {
|
||||
margin: 16px 0;
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
.detail-content :deep(li) {
|
||||
margin: 8px 0;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.detail-content :deep(code) {
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
background: #f1f5f9;
|
||||
color: #e11d48;
|
||||
font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.detail-content :deep(pre) {
|
||||
margin: 20px 0;
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
background: #1e293b;
|
||||
color: #e2e8f0;
|
||||
font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.detail-content :deep(pre code) {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.detail-content :deep(blockquote) {
|
||||
margin: 20px 0;
|
||||
padding: 12px 20px;
|
||||
border-left: 4px solid #3b82f6;
|
||||
background: #eff6ff;
|
||||
color: #1e40af;
|
||||
}
|
||||
|
||||
.detail-content :deep(a) {
|
||||
color: #3b82f6;
|
||||
text-decoration: none;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.detail-content :deep(a:hover) {
|
||||
color: #2563eb;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.detail-content :deep(img) {
|
||||
max-width: 100%;
|
||||
margin: 20px 0;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.announcement-detail-card {
|
||||
padding: 24px 20px;
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.detail-info {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,351 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Bell, Document, InfoFilled, QuestionFilled, Tickets, Warning } from '@element-plus/icons-vue'
|
||||
import { fetchAnnouncements, type Announcement } from '@/features/announcement'
|
||||
import { formatDateTime } from '@/utils/time'
|
||||
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
const announcements = ref<Announcement[]>([])
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(20)
|
||||
const total = ref(0)
|
||||
const activeCategory = ref<string>('')
|
||||
|
||||
const categories = [
|
||||
{ value: '', label: '全部', icon: Tickets, color: '#64748b' },
|
||||
{ value: 'notice', label: '通知公告', icon: Bell, color: '#3b82f6' },
|
||||
{ value: 'tutorial', label: '使用教程', icon: Document, color: '#10b981' },
|
||||
{ value: 'rule', label: '规则说明', icon: Warning, color: '#f59e0b' },
|
||||
{ value: 'faq', label: '常见问题', icon: QuestionFilled, color: '#8b5cf6' },
|
||||
]
|
||||
|
||||
const filteredCategories = computed(() => categories)
|
||||
|
||||
onMounted(loadAnnouncements)
|
||||
|
||||
async function loadAnnouncements() {
|
||||
loading.value = true
|
||||
try {
|
||||
const result = await fetchAnnouncements({
|
||||
category: activeCategory.value || undefined,
|
||||
page: currentPage.value,
|
||||
page_size: currentPageSize.value,
|
||||
})
|
||||
announcements.value = result.items
|
||||
total.value = result.total
|
||||
} catch (err) {
|
||||
console.error('加载公告失败', err)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleCategoryChange(category: string) {
|
||||
activeCategory.value = category
|
||||
currentPage.value = 1
|
||||
loadAnnouncements()
|
||||
}
|
||||
|
||||
function handleSizeChange() {
|
||||
currentPage.value = 1
|
||||
loadAnnouncements()
|
||||
}
|
||||
|
||||
function handlePageChange() {
|
||||
loadAnnouncements()
|
||||
}
|
||||
|
||||
function viewDetail(id: number) {
|
||||
router.push(`/announcements/${id}`)
|
||||
}
|
||||
|
||||
function getCategoryInfo(category: string) {
|
||||
return categories.find(c => c.value === category) || categories[0]
|
||||
}
|
||||
|
||||
function getCategoryLabel(category: string) {
|
||||
const cat = categories.find(c => c.value === category)
|
||||
return cat ? cat.label : category
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="page announcements-page" v-loading="loading">
|
||||
<div class="announcements-hero">
|
||||
<div class="page-header">
|
||||
<p class="eyebrow">平台公告</p>
|
||||
<h1>公告中心</h1>
|
||||
<p>查看平台通知、使用教程、规则说明和常见问题解答</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="category-tabs">
|
||||
<button
|
||||
v-for="cat in filteredCategories"
|
||||
:key="cat.value"
|
||||
class="category-tab"
|
||||
:class="{ active: activeCategory === cat.value }"
|
||||
@click="handleCategoryChange(cat.value)"
|
||||
>
|
||||
<el-icon :style="{ color: activeCategory === cat.value ? cat.color : '#94a3b8' }">
|
||||
<component :is="cat.icon" />
|
||||
</el-icon>
|
||||
<span>{{ cat.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="announcements-list">
|
||||
<div v-if="announcements.length === 0" class="empty-state">
|
||||
<el-icon class="empty-icon"><InfoFilled /></el-icon>
|
||||
<p>暂无公告</p>
|
||||
</div>
|
||||
<div
|
||||
v-for="item in announcements"
|
||||
:key="item.id"
|
||||
class="announcement-card"
|
||||
@click="viewDetail(item.id)"
|
||||
>
|
||||
<div class="announcement-header">
|
||||
<div class="announcement-meta">
|
||||
<el-tag
|
||||
:type="getCategoryInfo(item.category).value === 'notice' ? 'primary' : 'info'"
|
||||
effect="plain"
|
||||
size="small"
|
||||
class="category-tag"
|
||||
:style="{ borderColor: getCategoryInfo(item.category).color, color: getCategoryInfo(item.category).color }"
|
||||
>
|
||||
<el-icon><component :is="getCategoryInfo(item.category).icon" /></el-icon>
|
||||
{{ getCategoryLabel(item.category) }}
|
||||
</el-tag>
|
||||
<el-tag v-if="item.is_pinned" type="warning" effect="plain" size="small">置顶</el-tag>
|
||||
<el-tag v-if="item.is_important" type="danger" effect="plain" size="small">重要</el-tag>
|
||||
</div>
|
||||
<span class="announcement-date">{{ formatDateTime(item.published_at || item.created_at) }}</span>
|
||||
</div>
|
||||
<h3 class="announcement-title">{{ item.title }}</h3>
|
||||
<p class="announcement-preview">{{ item.content.substring(0, 120) }}{{ item.content.length > 120 ? '...' : '' }}</p>
|
||||
<div class="announcement-footer">
|
||||
<span class="view-count">
|
||||
<el-icon><Tickets /></el-icon>
|
||||
浏览 {{ item.view_count }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pagination-wrap" v-if="total > 0">
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="currentPageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@current-change="handlePageChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.announcements-page {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.announcements-hero {
|
||||
padding: 32px;
|
||||
border: 1px solid #e6eaf2;
|
||||
border-radius: 12px;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.06)),
|
||||
#ffffff;
|
||||
box-shadow: 0 14px 36px rgba(17, 24, 39, 0.06);
|
||||
}
|
||||
|
||||
.announcements-hero :deep(.page-header) {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.category-tabs {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
padding: 16px;
|
||||
border: 1px solid #e6eaf2;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 12px 30px rgba(17, 24, 39, 0.05);
|
||||
}
|
||||
|
||||
.category-tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 18px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 10px;
|
||||
background: #f8fafc;
|
||||
color: #64748b;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.category-tab:hover {
|
||||
border-color: #cbd5e1;
|
||||
background: #f1f5f9;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.category-tab.active {
|
||||
border-color: #3b82f6;
|
||||
background: #eff6ff;
|
||||
color: #3b82f6;
|
||||
}
|
||||
|
||||
.category-tab .el-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.announcements-list {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.announcement-card {
|
||||
padding: 24px;
|
||||
border: 1px solid #e6eaf2;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 12px 30px rgba(17, 24, 39, 0.05);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.announcement-card:hover {
|
||||
border-color: #3b82f6;
|
||||
box-shadow: 0 16px 40px rgba(59, 130, 246, 0.15);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.announcement-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.announcement-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.category-tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.announcement-date {
|
||||
color: #94a3b8;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.announcement-title {
|
||||
margin: 0 0 12px;
|
||||
color: #111827;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.announcement-preview {
|
||||
margin: 0 0 16px;
|
||||
color: #64748b;
|
||||
font-size: 14px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.announcement-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.view-count {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: #94a3b8;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.view-count .el-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 320px;
|
||||
padding: 48px;
|
||||
border: 1px solid #e6eaf2;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
margin-bottom: 16px;
|
||||
color: #cbd5e1;
|
||||
font-size: 64px;
|
||||
}
|
||||
|
||||
.empty-state p {
|
||||
margin: 0;
|
||||
color: #94a3b8;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.pagination-wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.announcements-hero {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.category-tabs {
|
||||
padding: 12px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.category-tab {
|
||||
padding: 8px 14px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.announcement-card {
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.announcement-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.announcement-preview {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
Finished,
|
||||
House,
|
||||
InfoFilled,
|
||||
Megaphone,
|
||||
Search,
|
||||
Service,
|
||||
Shop,
|
||||
@@ -33,6 +34,7 @@ const navItems = [
|
||||
{ label: "我的订单", to: "/orders", icon: Tickets },
|
||||
{ label: "消息", to: "/messages", icon: ChatDotRound },
|
||||
{ label: "钱包", to: "/wallet", icon: Wallet },
|
||||
{ label: "公告", to: "/announcements", icon: Megaphone },
|
||||
];
|
||||
const buyerServiceItems = [
|
||||
{ label: "待支付", icon: Coin, to: { path: "/orders", query: { tab: "pending_payment" } } },
|
||||
|
||||
@@ -66,4 +66,14 @@ export const accountRoutes: RouteRecordRaw[] = [
|
||||
component: () => import('@/features/chats/views/ChatView.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/announcements',
|
||||
name: 'announcements',
|
||||
component: () => import('@/features/announcement/views/AnnouncementsView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/announcements/:id',
|
||||
name: 'announcement-detail',
|
||||
component: () => import('@/features/announcement/views/AnnouncementDetailView.vue'),
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user