From 3681261de8b9fc12e952dc49a540b7d613180879 Mon Sep 17 00:00:00 2001
From: xiongxiaoyang <773861846@qq.com>
Date: Mon, 16 May 2022 07:42:24 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=B0=8F=E8=AF=B4?=
=?UTF-8?q?=E7=9B=AE=E5=BD=95=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/book.js | 4 ++
src/router/index.js | 6 ++
src/views/Book.vue | 7 ++-
src/views/BookChapterList.vue | 107 ++++++++++++++++++++++++++++++++++
src/views/BookContent.vue | 16 +++--
5 files changed, 135 insertions(+), 5 deletions(-)
create mode 100644 src/views/BookChapterList.vue
diff --git a/src/api/book.js b/src/api/book.js
index bc6d08d..9e28def 100644
--- a/src/api/book.js
+++ b/src/api/book.js
@@ -16,6 +16,10 @@ export function listRecBooks(params) {
return request.get('/book/recList', { params });
}
+export function listChapters(params) {
+ return request.get('/book/chapterList', { params });
+}
+
export function getBookContent(chapterId) {
return request.get(`/book/content/${chapterId}`);
}
diff --git a/src/router/index.js b/src/router/index.js
index 3d7f04d..abfdef4 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -25,6 +25,12 @@ const router = createRouter({
name: 'book',
component: () => import('@/views/Book')
+ },
+ {
+ path: '/chapterList/:bookId',
+ name: 'chapterList',
+ component: () => import('@/views/BookChapterList')
+
},
{
path: '/book/:id/:chapterId',
diff --git a/src/views/Book.vue b/src/views/Book.vue
index 744c98c..63d687e 100644
--- a/src/views/Book.vue
+++ b/src/views/Book.vue
@@ -84,7 +84,7 @@
>({{ chapterAbout.chapterTotal }}章)
- 全部目录
@@ -316,6 +316,10 @@ export default {
loadLastChapterAbout(bookId)
};
+ const chapterList = (bookId) => {
+ router.push({ path: `/chapterList/${bookId}` });
+ };
+
const addBookVisit = async (bookId) => {
addVisitCount({bookId: bookId})
}
@@ -326,6 +330,7 @@ export default {
no_comment,
bookContent,
bookDetail,
+ chapterList
};
},
mounted() {
diff --git a/src/views/BookChapterList.vue b/src/views/BookChapterList.vue
new file mode 100644
index 0000000..0f9eec3
--- /dev/null
+++ b/src/views/BookChapterList.vue
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
{{book.bookName}}
+
+
+
+
+
+
+
正文({{chapterList.length}})
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/BookContent.vue b/src/views/BookContent.vue
index d44c86d..9ba84f5 100644
--- a/src/views/BookContent.vue
+++ b/src/views/BookContent.vue
@@ -13,8 +13,8 @@