feat(web): 试看搜索书籍后返回书架时提示是否加入书架
This commit is contained in:
@@ -211,18 +211,20 @@ const handleBookClick = async (book) => {
|
||||
durChapterPos = 0,
|
||||
} = book;
|
||||
// 判断是否为 searchBook
|
||||
if (book.durChapterIndex === undefined) {
|
||||
const isSeachBook = "respondTime" in book
|
||||
if (isSeachBook) {
|
||||
await API.saveBook(book);
|
||||
}
|
||||
toDetail(bookUrl, name, author, durChapterIndex, durChapterPos);
|
||||
toDetail(bookUrl, name, author, durChapterIndex, durChapterPos, isSeachBook);
|
||||
};
|
||||
const toDetail = (bookUrl, bookName, bookAuthor, chapterIndex, chapterPos) => {
|
||||
const toDetail = (bookUrl, bookName, bookAuthor, chapterIndex, chapterPos, isSeachBook) => {
|
||||
if (bookName === "尚无阅读记录") return;
|
||||
sessionStorage.setItem("bookUrl", bookUrl);
|
||||
sessionStorage.setItem("bookName", bookName);
|
||||
sessionStorage.setItem("bookAuthor", bookAuthor);
|
||||
sessionStorage.setItem("chapterIndex", chapterIndex);
|
||||
sessionStorage.setItem("chapterPos", chapterPos);
|
||||
sessionStorage.setItem("isSeachBook", isSeachBook);
|
||||
readingRecent.value = {
|
||||
name: bookName,
|
||||
author: bookAuthor,
|
||||
|
||||
Reference in New Issue
Block a user