diff --git a/src/api/book.js b/src/api/book.js index 6943c64..4d98b58 100644 --- a/src/api/book.js +++ b/src/api/book.js @@ -4,6 +4,10 @@ export function getBookById(bookId) { return request.get(`/book/${bookId}`); } +export function getLastChapterAbout(params) { + return request.get('/book/lastChapterAbout', { 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 new file mode 100644 index 0000000..f928f6f --- /dev/null +++ b/src/components/book/LastChapterAbout.vue @@ -0,0 +1,64 @@ + + + \ No newline at end of file diff --git a/src/views/Book.vue b/src/views/Book.vue index ef8069e..c7dcd94 100644 --- a/src/views/Book.vue +++ b/src/views/Book.vue @@ -63,36 +63,8 @@
- -
-
-
-
-

最新章节

- (430章) -
- 全部目录 -
-
    -
  • - - 章一百三十四 【一更】 - 更新时间:21/11/16 00:00:00 -
  • -
  • - -   只见一只拥有四条尾巴的火狐,正在不远处龇牙... -
  • - -
-
-
- + +
@@ -280,6 +252,7 @@ import { getBookById } from "@/api/book"; import { ElMessage, ElLoading } from "element-plus"; import Header from "@/components/common/Header"; import Footer from "@/components/common/Footer"; +import LastChapterAbout from "@/components/book/LastChapterAbout.vue" import author_head from "@/assets/images/author_head.png"; import no_comment from "@/assets/images/no_comment.png"; export default { @@ -287,6 +260,7 @@ export default { components: { Header, Footer, + LastChapterAbout }, setup() { const route = useRoute(); diff --git a/src/views/BookContent.vue b/src/views/BookContent.vue index a9fa92f..e9dd958 100644 --- a/src/views/BookContent.vue +++ b/src/views/BookContent.vue @@ -83,19 +83,19 @@
-

{{bookContent.chapterName}}

+

{{data.chapterInfo.chapterName}}

- 类别:{{bookContent.categoryName}} 作者:{{data.bookInfo.categoryName}} 作者:{{bookContent.authorName}}字数:{{bookContent.chapterWordCount}}更新时间:{{bookContent.chapterUpdateTime}} + v-if="data.bookInfo">{{data.bookInfo.authorName}}字数:{{data.chapterInfo.chapterWordCount}}更新时间:{{data.chapterInfo.chapterUpdateTime}}
@@ -104,7 +104,7 @@ id="showReading" class="readBox" style="font-size: 16px; font-family: microsoft yahei" - v-html="bookContent.content"> + v-html="data.bookContent">
@@ -266,13 +266,13 @@ export default { const chapterId = route.params.chapterId; const state = reactive({ - bookContent: {}, + data: {}, imgBaseUrl: process.env.VUE_APP_BASE_IMG_URL, }); onMounted(async () => { const {data} = await getBookContent(chapterId); - state.bookContent = data; + state.data = data; });