From fffaecb0a387619af400070408a2883bf209f23e Mon Sep 17 00:00:00 2001 From: abab2320 <1589841436@qq.com> Date: Thu, 22 May 2025 20:35:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=96=E5=AD=90=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Front/vue-unilife/package.json | 2 + Front/vue-unilife/pnpm-lock.yaml | 19 +++ Front/vue-unilife/src/assets/style/style.css | 2 +- .../vue-unilife/src/components/HeaderBar.vue | 2 +- .../components/PostDetailPage/AuthorInfor.vue | 63 +++++++++ .../components/PostDetailPage/PostContent.vue | 90 ++++++++++++ .../PostContent/CommentInput.vue | 133 ++++++++++++++++++ .../PostContent/CommentList.vue | 84 +++++++++++ .../PostContent/MarkdownContent.vue | 29 ++++ .../PostDetailPage/SidebarCategory.vue | 60 ++++++++ Front/vue-unilife/src/routers/routers.ts | 5 + Front/vue-unilife/src/views/ForumHome.vue | 30 +++- .../vue-unilife/src/views/PostDetailPage.vue | 77 ++++++++++ Front/前端环境.md | 5 + 14 files changed, 596 insertions(+), 5 deletions(-) create mode 100644 Front/vue-unilife/src/components/PostDetailPage/AuthorInfor.vue create mode 100644 Front/vue-unilife/src/components/PostDetailPage/PostContent.vue create mode 100644 Front/vue-unilife/src/components/PostDetailPage/PostContent/CommentInput.vue create mode 100644 Front/vue-unilife/src/components/PostDetailPage/PostContent/CommentList.vue create mode 100644 Front/vue-unilife/src/components/PostDetailPage/PostContent/MarkdownContent.vue create mode 100644 Front/vue-unilife/src/components/PostDetailPage/SidebarCategory.vue create mode 100644 Front/vue-unilife/src/views/PostDetailPage.vue diff --git a/Front/vue-unilife/package.json b/Front/vue-unilife/package.json index 25f2901..f469a79 100644 --- a/Front/vue-unilife/package.json +++ b/Front/vue-unilife/package.json @@ -13,6 +13,8 @@ "@vue/shared": "^3.5.13", "axios": "^1.8.3", "element-plus": "^2.9.7", + "highlight.js": "^11.11.1", + "marked": "^15.0.12", "vee-validate": "^4.15.0", "vue": "^3.5.13", "vue-router": "^4.5.0", diff --git a/Front/vue-unilife/pnpm-lock.yaml b/Front/vue-unilife/pnpm-lock.yaml index 3bfe1af..0480a9c 100644 --- a/Front/vue-unilife/pnpm-lock.yaml +++ b/Front/vue-unilife/pnpm-lock.yaml @@ -20,6 +20,12 @@ importers: element-plus: specifier: ^2.9.7 version: 2.9.7(vue@3.5.13(typescript@5.7.3)) + highlight.js: + specifier: ^11.11.1 + version: 11.11.1 + marked: + specifier: ^15.0.12 + version: 15.0.12 vee-validate: specifier: ^4.15.0 version: 4.15.0(vue@3.5.13(typescript@5.7.3)) @@ -588,6 +594,10 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + highlight.js@11.11.1: + resolution: {integrity: sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==} + engines: {node: '>=12.0.0'} + hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -614,6 +624,11 @@ packages: magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + marked@15.0.12: + resolution: {integrity: sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==} + engines: {node: '>= 18'} + hasBin: true + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} @@ -1416,6 +1431,8 @@ snapshots: he@1.2.0: {} + highlight.js@11.11.1: {} + hookable@5.5.3: {} immutable@5.1.2: {} @@ -1436,6 +1453,8 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 + marked@15.0.12: {} + math-intrinsics@1.1.0: {} memoize-one@6.0.0: {} diff --git a/Front/vue-unilife/src/assets/style/style.css b/Front/vue-unilife/src/assets/style/style.css index 935ef47..3579fd1 100644 --- a/Front/vue-unilife/src/assets/style/style.css +++ b/Front/vue-unilife/src/assets/style/style.css @@ -86,7 +86,7 @@ button { } .card:hover { - transform: translateY(-5px); + transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); } diff --git a/Front/vue-unilife/src/components/HeaderBar.vue b/Front/vue-unilife/src/components/HeaderBar.vue index 26c8486..911de5c 100644 --- a/Front/vue-unilife/src/components/HeaderBar.vue +++ b/Front/vue-unilife/src/components/HeaderBar.vue @@ -56,7 +56,7 @@ height: 70px; width: 100%; background: #ead1fb; - position:absolute; + position:fixed; top: 0; left:0; padding:0; diff --git a/Front/vue-unilife/src/components/PostDetailPage/AuthorInfor.vue b/Front/vue-unilife/src/components/PostDetailPage/AuthorInfor.vue new file mode 100644 index 0000000..05922a7 --- /dev/null +++ b/Front/vue-unilife/src/components/PostDetailPage/AuthorInfor.vue @@ -0,0 +1,63 @@ + + + + + \ No newline at end of file diff --git a/Front/vue-unilife/src/components/PostDetailPage/PostContent.vue b/Front/vue-unilife/src/components/PostDetailPage/PostContent.vue new file mode 100644 index 0000000..f627888 --- /dev/null +++ b/Front/vue-unilife/src/components/PostDetailPage/PostContent.vue @@ -0,0 +1,90 @@ + + + + + \ No newline at end of file diff --git a/Front/vue-unilife/src/components/PostDetailPage/PostContent/CommentInput.vue b/Front/vue-unilife/src/components/PostDetailPage/PostContent/CommentInput.vue new file mode 100644 index 0000000..6857068 --- /dev/null +++ b/Front/vue-unilife/src/components/PostDetailPage/PostContent/CommentInput.vue @@ -0,0 +1,133 @@ + + + + + \ No newline at end of file diff --git a/Front/vue-unilife/src/components/PostDetailPage/PostContent/CommentList.vue b/Front/vue-unilife/src/components/PostDetailPage/PostContent/CommentList.vue new file mode 100644 index 0000000..bcb1874 --- /dev/null +++ b/Front/vue-unilife/src/components/PostDetailPage/PostContent/CommentList.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/Front/vue-unilife/src/components/PostDetailPage/PostContent/MarkdownContent.vue b/Front/vue-unilife/src/components/PostDetailPage/PostContent/MarkdownContent.vue new file mode 100644 index 0000000..066203b --- /dev/null +++ b/Front/vue-unilife/src/components/PostDetailPage/PostContent/MarkdownContent.vue @@ -0,0 +1,29 @@ + + + diff --git a/Front/vue-unilife/src/components/PostDetailPage/SidebarCategory.vue b/Front/vue-unilife/src/components/PostDetailPage/SidebarCategory.vue new file mode 100644 index 0000000..2b0b225 --- /dev/null +++ b/Front/vue-unilife/src/components/PostDetailPage/SidebarCategory.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/Front/vue-unilife/src/routers/routers.ts b/Front/vue-unilife/src/routers/routers.ts index 6569da5..d272da5 100644 --- a/Front/vue-unilife/src/routers/routers.ts +++ b/Front/vue-unilife/src/routers/routers.ts @@ -46,6 +46,11 @@ const routes:Array = [ path:'/uniLifeHome', name: 'ForumHome', component: ForumHome, + }, + { + path:'/post/:id', + name:'PostDetail', + component: () => import('@/views/PostDetailPage.vue'), } ]; diff --git a/Front/vue-unilife/src/views/ForumHome.vue b/Front/vue-unilife/src/views/ForumHome.vue index 0c977a9..aeb362f 100644 --- a/Front/vue-unilife/src/views/ForumHome.vue +++ b/Front/vue-unilife/src/views/ForumHome.vue @@ -63,6 +63,27 @@ const posts = [ tags: ['Ant Design', '设计语言', '蚂蚁金服'], excerpt: '段落示意:这是帖子的部分具体内容……', link: '/post/2' + }, + { + id: 3, + title: '蚂蚁金服设计平台简介', + tags: ['Ant Design', '设计语言', '蚂蚁金服'], + excerpt: '段落示意:这是帖子的部分具体内容……', + link: '/post/3' + }, + { + id: 4, + title: '蚂蚁金服设计平台简介', + tags: ['Ant Design', '设计语言', '蚂蚁金服'], + excerpt: '段落示意:这是帖子的部分具体内容……', + link: '/post/4' + }, + { + id: 5, + title: '蚂蚁金服设计平台简介', + tags: ['Ant Design', '设计语言', '蚂蚁金服'], + excerpt: '段落示意:这是帖子的部分具体内容……', + link: '/post/5' } ] @@ -71,8 +92,7 @@ const posts = [ .forum-home { display: flex; width:92%; - height:98%; - padding-top:75px; + padding-top:750px; gap: 40px; // 🔧 左右两栏之间间距 @@ -80,6 +100,7 @@ const posts = [ flex: 3; display: flex; flex-direction: column; + margin-right: 350px; gap: 30px; // 🔧 帖子区块和上半部分间隔加大 background: linear-gradient(to bottom right, #f7f1ff, #ffffff); } @@ -120,7 +141,10 @@ const posts = [ .right-section { flex: 1; - min-width: 240px; + position:fixed; + margin-left:75%; + height: 830px; + min-width: 350px; padding: 16px; background-color: #f9f7ff; border-radius: 8px; diff --git a/Front/vue-unilife/src/views/PostDetailPage.vue b/Front/vue-unilife/src/views/PostDetailPage.vue new file mode 100644 index 0000000..7cdee2e --- /dev/null +++ b/Front/vue-unilife/src/views/PostDetailPage.vue @@ -0,0 +1,77 @@ + + + + + \ No newline at end of file diff --git a/Front/前端环境.md b/Front/前端环境.md index f17c8a7..7d5c2f8 100644 --- a/Front/前端环境.md +++ b/Front/前端环境.md @@ -66,4 +66,9 @@ pnpm install @element-plus/icons-vue ```cmd pnpm add -D sass-embedded +``` + +### 适配Markdown +``` +pnpm add marked highlight.js ``` \ No newline at end of file