- 重构首页结构,增加Banner轮播与左侧快捷入口 - 新增单位企业广告区及会员服务广告区 - 实现决策咨询板块,涵盖市县决策、行业资讯、前沿观察、企业动态 - 设计决策参考板块,展示政策原文、深度解读、研究成果、专题研究 - 完善专家资讯板块,包含专家视点、专家动态及专家申请卡片 - 添加智库观察板块与翰墨文谈板块,丰富内容分类 - 底部功能区新增资料下载、申报模板、成果报送、联系我们快捷链接 - 采用蓝色主色调和卡片式布局,提升视觉统一与响应式体验 - 使用模拟数据占位,便于后续接入实际API数据 - 重构SiteFooter提升一致性与风格统一
103 lines
1.8 KiB
Vue
103 lines
1.8 KiB
Vue
<template>
|
|
<div class="article-item" :class="{ 'has-image': showImage && article.image }">
|
|
<NuxtLink :to="article.link || `/article/${article.id}`" class="article-link">
|
|
<div class="article-content">
|
|
<div class="article-title">{{ article.title }}</div>
|
|
<div class="article-meta">
|
|
<span v-if="article.source" class="source">{{ article.source }}</span>
|
|
<span class="date">{{ article.date }}</span>
|
|
</div>
|
|
</div>
|
|
<img v-if="showImage && article.image" :src="article.image" :alt="article.title" class="article-image" />
|
|
</NuxtLink>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
interface Article {
|
|
id: number
|
|
title: string
|
|
date: string
|
|
source?: string
|
|
image?: string
|
|
link?: string
|
|
}
|
|
|
|
defineProps<{
|
|
article: Article
|
|
showImage?: boolean
|
|
}>()
|
|
</script>
|
|
|
|
<style scoped>
|
|
.article-item {
|
|
padding: 10px 0;
|
|
border-bottom: 1px dashed #eee;
|
|
}
|
|
|
|
.article-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.article-link {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 12px;
|
|
text-decoration: none;
|
|
color: inherit;
|
|
}
|
|
|
|
.article-content {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.article-title {
|
|
font-size: 14px;
|
|
color: #333;
|
|
line-height: 1.5;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
transition: color 0.2s;
|
|
}
|
|
|
|
.article-link:hover .article-title {
|
|
color: #1e3a5f;
|
|
}
|
|
|
|
.article-meta {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
margin-top: 6px;
|
|
font-size: 12px;
|
|
color: #999;
|
|
}
|
|
|
|
.source {
|
|
color: #e74c3c;
|
|
}
|
|
|
|
.article-image {
|
|
width: 100px;
|
|
height: 70px;
|
|
object-fit: cover;
|
|
border-radius: 4px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.has-image .article-title {
|
|
-webkit-line-clamp: 1;
|
|
}
|
|
|
|
@media (max-width: 576px) {
|
|
.article-image {
|
|
width: 80px;
|
|
height: 56px;
|
|
}
|
|
}
|
|
</style>
|