refactor(views): 重构多个视图组件代码和样式

重构了多个视图组件的代码结构和样式,包括:
1. 重命名变量和类名以提高可读性
2. 优化CSS样式结构和响应式设计
3. 添加过渡动画和悬停效果
4. 统一组件命名规范
5. 改进表单验证和交互体验
6. 增强代码注释和文档

feat(types): 修改Article接口定义
更新Article接口字段,将categoryId改为attributeid,并将categoryName和tags改为数组类型

fix(services): 修改文章服务接口
更新getAllArticles方法,改为获取已发布文章

style(layouts): 调整主布局样式
修改导航栏背景透明度和布局间距

chore(assets): 更新背景图片
替换旧的背景图片文件
This commit is contained in:
qingfeng1121
2025-10-26 18:50:04 +08:00
parent 6c4d14d06a
commit 85bf3214cc
14 changed files with 989 additions and 932 deletions

View File

@@ -1,15 +1,15 @@
<template>
<div id="aericle-style">
<div class="aericle-list">
<div class="nonsense-container">
<div class="nonsense-list">
<div
class="aericle-item"
v-for="item in aericleList"
class="nonsense-item"
v-for="item in nonsenseList"
:key="item.id"
>
<div class="aericle-meta">
<span class="aericle-time">{{ item.time }}</span>
<div class="nonsense-meta-info">
<span class="nonsense-time">{{ item.time }}</span>
</div>
<div class="aericle-content">{{ item.content }}</div>
<div class="nonsense-content">{{ item.content }}</div>
</div>
</div>
</div>
@@ -18,8 +18,11 @@
<script setup>
import { ref } from 'vue'
// 吐槽数据(仅站长可见/可发)
const aericleList = ref([
/**
* 吐槽数据列表
* 仅站长可见/可发
*/
const nonsenseList = ref([
{
id: 1,
content: '嘿嘿 嘿嘿嘿流口水ing',
@@ -29,70 +32,101 @@ const aericleList = ref([
</script>
<style scoped>
#aericle-style {
/* 吐槽页面主容器样式 */
.nonsense-container {
background: rgba(255,255,255,0.95);
border-radius: 12px;
padding: 32px 20px 24px 20px;
box-shadow: 0 2px 12px rgba(0,0,0,0.06);
transition: box-shadow 0.3s ease;
}
.aericle-header {
/* 吐槽页面主容器悬浮效果 */
.nonsense-container:hover {
box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
/* 吐槽头部样式 */
.nonsense-header {
text-align: center;
margin-bottom: 28px;
}
.aericle-header h1 {
.nonsense-header h1 {
font-size: 2.2rem;
margin-bottom: 8px;
color: #409eff;
letter-spacing: 2px;
}
.aericle-desc {
.nonsense-description {
color: #888;
font-size: 1rem;
margin-bottom: 0;
}
.aericle-list {
/* 吐槽列表样式 */
.nonsense-list {
display: flex;
flex-direction: column;
gap: 18px;
}
.aericle-item {
/* 吐槽项样式 */
.nonsense-item {
background: #f8fafd;
border-radius: 10px;
padding: 18px 20px 14px 20px;
box-shadow: 0 1px 4px rgba(0,0,0,0.03);
position: relative;
transition: box-shadow 0.2s;
}
.aericle-item:hover {
box-shadow: 0 4px 16px rgba(64,158,255,0.12);
transition: box-shadow 0.2s, transform 0.2s ease;
}
.aericle-meta {
/* 吐槽项悬浮效果 */
.nonsense-item:hover {
box-shadow: 0 4px 16px rgba(64,158,255,0.12);
transform: translateY(-2px);
}
/* 吐槽元信息样式 */
.nonsense-meta-info {
font-size: 13px;
color: #aaa;
margin-bottom: 8px;
text-align: right;
}
.aericle-content {
/* 吐槽内容样式 */
.nonsense-content {
font-size: 1.08rem;
color: #333;
line-height: 1.8;
word-break: break-all;
font-style: italic;
}
/* 响应式设计 */
@media (max-width: 768px) {
#aericle-style {
.nonsense-container {
padding: 14px 4px 10px 4px;
margin: 0 8px;
}
.aericle-header h1 {
.nonsense-header h1 {
font-size: 1.4rem;
}
.aericle-content {
.nonsense-content {
font-size: 0.98rem;
line-height: 1.6;
}
.nonsense-list {
gap: 12px;
}
.nonsense-item {
padding: 14px 16px 10px 16px;
}
}
</style>