From df89986d777a4c585a84881eb02e4a4941dd41bb Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Sun, 15 May 2022 14:02:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(bookContent):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=B0=8F=E8=AF=B4=E5=86=85=E5=AE=B9=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/book.js | 6 +- src/assets/styles/read.css | 2 - src/router/index.js | 6 + src/views/Book.vue | 14 +- src/views/BookContent.vue | 293 +++++++++++++++++++++++++++++++++++++ 5 files changed, 314 insertions(+), 7 deletions(-) create mode 100644 src/views/BookContent.vue diff --git a/src/api/book.js b/src/api/book.js index 2f30e51..6943c64 100644 --- a/src/api/book.js +++ b/src/api/book.js @@ -1,9 +1,13 @@ import request from '../utils/request' -export function getById(bookId) { +export function getBookById(bookId) { return request.get(`/book/${bookId}`); } +export function getBookContent(chapterId) { + return request.get(`/book/content/${chapterId}`); +} + export function listVisitRankBooks() { return request.get('/book/visitRank'); } diff --git a/src/assets/styles/read.css b/src/assets/styles/read.css index 827b5bf..ef73d1d 100644 --- a/src/assets/styles/read.css +++ b/src/assets/styles/read.css @@ -72,7 +72,6 @@ body, .read_style_1 { background-color: #ebe5d8 } .order_list { padding: 0 50px; line-height: 2.6; } .order_list .btns { padding: 20px 0 } /* 作者的话 */ -.author_say { margin: 35px auto 10px; width: 90%; min-height: 70px; border-radius: 3px; background: url(../images/author_say.png) no-repeat; border: 1px solid #e3e3e3/*rgba(0,0,0,.1)*/ } .say_bar { padding: 14px 14px 14px 74px; font-size: 14px } /* 翻页 */ .nextPageBox { margin: 30px auto; text-align: center; width: 98% } @@ -149,7 +148,6 @@ body, .read_style_1 { background-color: #ebe5d8 } .icon_pc em { filter: alpha(opacity=90); -moz-opacity: 0.9; opacity: 0.9; } .read_dz { height:40px; line-height:40px; border-radius:40px; padding:0 22px; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#0c000000,endColorstr=#0c000000); background:rgba(0,0,0,.07); display:block; position:absolute; bottom:35px; right:50px; color:#444; font-size:18px } .read_dz:hover { color:#444; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#19000000,endColorstr=#19000000); background:rgba(0,0,0,.1) } -.read_dz i { width:25px; height:25px; display:inline-block; position:relative; top:4px; margin-right:6px; background:url(../images/icon_readdz.png) no-repeat } .read_style_6 .read_dz { color:#aaa } .read_dz.on { color:#f70; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#0cff8800,endColorstr=#0cff8800); background:rgba(255,136,0,.05) } .read_dz.on i { background-position:-30px 0 } diff --git a/src/router/index.js b/src/router/index.js index cd142ae..05cbdc9 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: '/book/:id/:chapterId', + name: 'bookContent', + component: () => import('@/views/BookContent') + } ] }) diff --git a/src/views/Book.vue b/src/views/Book.vue index 5dc6b9b..ef8069e 100644 --- a/src/views/Book.vue +++ b/src/views/Book.vue @@ -40,8 +40,9 @@ >