From 04ff469b3a7029825e2354f1da3727709fa50123 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Sun, 15 May 2022 20:49:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=B0=8F=E8=AF=B4?= =?UTF-8?q?=E5=90=8C=E7=B1=BB=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/book.js | 4 + src/components/book/LastChapterAbout.vue | 64 ------- src/router/index.js | 5 + src/views/Book.vue | 224 +++++++++++++---------- src/views/BookContent.vue | 3 - 5 files changed, 139 insertions(+), 161 deletions(-) delete mode 100644 src/components/book/LastChapterAbout.vue diff --git a/src/api/book.js b/src/api/book.js index 4d98b58..fd360be 100644 --- a/src/api/book.js +++ b/src/api/book.js @@ -8,6 +8,10 @@ export function getLastChapterAbout(params) { return request.get('/book/lastChapterAbout', { params }); } +export function listRecBooks(params) { + return request.get('/book/recList', { params }); +} + export function getBookContent(chapterId) { return request.get(`/book/content/${chapterId}`); } diff --git a/src/components/book/LastChapterAbout.vue b/src/components/book/LastChapterAbout.vue deleted file mode 100644 index f928f6f..0000000 --- a/src/components/book/LastChapterAbout.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 05cbdc9..3d7f04d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -35,4 +35,9 @@ const router = createRouter({ ] }) +// 解决 vue 中路由跳转时,总是从新页面中间开始显示 +router.afterEach((to,from,next) => { + window.scrollTo(0,0) +}) + export default router \ No newline at end of file diff --git a/src/views/Book.vue b/src/views/Book.vue index c7dcd94..23b6a42 100644 --- a/src/views/Book.vue +++ b/src/views/Book.vue @@ -4,34 +4,45 @@
-
-

{{book.bookName}}

- {{book.authorName}} +

{{ book.bookName }}

+ {{ + book.authorName + }}
  • - 类别:{{book.categoryName}} - 状态:{{book.bookStatus == 0 ? '连载中' : '已完结'}} - 总点击:{{book.visitCount}} - 总字数:{{book.wordCount}} + 类别:{{ book.categoryName }} + 状态:{{ + book.bookStatus == 0 ? "连载中" : "已完结" + }} + 总点击:{{ book.visitCount }} + 总字数:{{ book.wordCount }}
-

- -

+

收起 @@ -40,9 +51,9 @@ >
- - 点击阅读 @@ -63,8 +74,52 @@
- - + +
+
+
+
+

最新章节

+ ({{ chapterAbout.chapterTotal }}章) +
+ 全部目录 +
+ +
+
+
@@ -74,7 +129,7 @@

作品评论区

(0条)
- 发表评论 +
@@ -93,16 +148,19 @@ >
+ +
+