From 43767a8fb92f1bad9313097ee44fc281b4cc0e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=99=E5=85=89?= <5248283+lsg15829561090@user.noreply.gitee.com> Date: Wed, 2 Oct 2024 12:11:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generated/core/OpenAPI.ts | 2 +- src/views/forum/ForumView.vue | 204 ++++++++++++++++++++++++++-------- 2 files changed, 159 insertions(+), 47 deletions(-) diff --git a/generated/core/OpenAPI.ts b/generated/core/OpenAPI.ts index 8a670f9..bb0dc7f 100644 --- a/generated/core/OpenAPI.ts +++ b/generated/core/OpenAPI.ts @@ -20,7 +20,7 @@ export type OpenAPIConfig = { }; export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:8101', + BASE: 'http://oj.shuguangwl.com:8101', VERSION: '1.0', WITH_CREDENTIALS: true, CREDENTIALS: 'include', diff --git a/src/views/forum/ForumView.vue b/src/views/forum/ForumView.vue index 11c1812..16c5ef6 100644 --- a/src/views/forum/ForumView.vue +++ b/src/views/forum/ForumView.vue @@ -1,23 +1,28 @@ - - + + + + 发布帖子 + 切换侧边栏 + + - - - + + {{ item.thumbNum }} {{ item.favourNum }} 收藏 - - - - 你好你好你好你好你好你好你好你好你好你好你好你好你好你好 - - @@ -53,17 +53,47 @@ + + + + + + + + + + + + + + + + + + @@ -124,25 +195,29 @@ const dataSource = article; display: flex; padding: 20px; gap: 20px; - color:--text-color; + color: var(--text-color); + min-height: 100vh; } -/* 侧边栏样式 */ .sidebar { - - flex: 0 0 200px; - background-color: --background-color; + flex: 0 0 250px; + background-color: var(--background-secondary-color); padding: 15px; border-radius: 8px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - border: 0.5px solid #fff; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + transition: all 0.3s ease; + overflow: hidden; +} + +.sidebar-hidden { + display: none; /* 隐藏侧边栏 */ } .sidebar-title { - - font-size: 18px; + font-size: 20px; font-weight: bold; - margin-bottom: 10px; + margin-bottom: 15px; + text-align: center; } .category-list { @@ -152,31 +227,43 @@ const dataSource = article; } .category-list li { - padding: 8px; + padding: 10px; cursor: pointer; - border-radius: 4px; - transition: background-color 0.3s; + border-radius: 5px; + transition: background-color 0.3s, color 0.3s; + text-align: center; + font-weight: 500; + margin-bottom: 5px; } .category-list li:hover { - background-color: #d8d8d8; + background-color: var(--primary-color-light); + color: white; } .category-list li.active { - background-color: #1890ff; + background-color: var(--primary-color); color: white; } /* 主内容区域样式 */ .main-content { flex: 1; + padding: 20px; + background-color: var(--background-secondary-color); + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); +} + +.post-button-container { + display: flex; + justify-content: space-between; /* 调整按钮位置 */ + margin-bottom: 20px; } .list-demo-action-layout { - background-color: --background-color; padding: 20px; border-radius: 8px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .list-demo-item { @@ -189,7 +276,8 @@ const dataSource = article; display: flex; justify-content: center; align-items: center; - width: 150px; + width: 100%; + max-width: 300px; /* 设置最大宽度 */ height: 150px; overflow: hidden; border-radius: 8px; @@ -198,7 +286,31 @@ const dataSource = article; } .image-area img { - max-width: 100%; - max-height: 100%; + width: 100%; + height: auto; + object-fit: cover; /* 确保图片自适应显示 */ + border-radius: 8px; +} + +@media (max-width: 768px) { + .forum-container { + flex-direction: column; /* 将布局调整为垂直方向 */ + padding: 10px; + } + + .sidebar { + flex: 1; + width: 100%; /* 占满整个屏幕 */ + } + + .main-content { + width: 100%; /* 主内容也占满整个屏幕 */ + } + + .post-button-container { + justify-content: center; + } } + +