fix(notice): 修改管理控制台公告布局,并在首页滚动显示
This commit is contained in:
1 parent
ced7fbe085
commit
d4f629106f
18 files changed
+737
-105
No files matched your search
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
import { inject } from 'vue';
|
||||
import { Bot, Megaphone } from 'lucide-vue-next';
|
||||
import AnnouncementCardCarousel from '@/shared/components/AnnouncementCardCarousel.vue';
|
||||
import { LOGIN_KEY } from '../composables/login.context';
|
||||
|
||||
const lk = inject(LOGIN_KEY)! as any;
|
||||
@@ -37,25 +38,18 @@ const lk = inject(LOGIN_KEY)! as any;
|
||||
{{ $t('landing.hero.subtitle') }}
|
||||
</p>
|
||||
|
||||
<div v-if="lk.announcements.length > 0" class="bg-white/70 backdrop-blur-sm rounded-2xl border border-default p-6 shadow-sm">
|
||||
<h3 class="text-sm font-bold text-slate-950 mb-4 flex items-center gap-2">
|
||||
<div v-if="lk.announcements.length > 0" class="bg-white/75 backdrop-blur-md rounded-2xl border border-white/60 p-5 shadow-sm">
|
||||
<h3 class="text-sm font-bold text-slate-900 mb-3 flex items-center gap-2">
|
||||
<Megaphone class="w-4 h-4 text-brand-600" />
|
||||
{{ $t('login.announcements') }}
|
||||
</h3>
|
||||
<div class="space-y-3">
|
||||
<div
|
||||
v-for="ann in lk.announcements.slice(0, 3)"
|
||||
:key="ann.id"
|
||||
class="group cursor-pointer hover:bg-white/50 p-2 rounded-lg transition-colors"
|
||||
@click="lk.openAnnouncement(ann)"
|
||||
>
|
||||
<div class="flex justify-between items-start gap-2">
|
||||
<h4 class="text-sm font-semibold text-primary group-hover:text-brand-800 line-clamp-1">{{ ann.title }}</h4>
|
||||
<span class="text-[10px] text-muted whitespace-nowrap">{{ new Date(ann.created_at).toLocaleDateString() }}</span>
|
||||
</div>
|
||||
<p class="text-xs text-secondary line-clamp-2 mt-1">{{ ann.content }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<AnnouncementCardCarousel
|
||||
:announcements="lk.announcements"
|
||||
variant="login"
|
||||
:auto-play="lk.announcements.length > 1"
|
||||
:auto-play-interval="8000"
|
||||
@select="lk.openAnnouncement"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user