This commit is contained in:
make
2025-04-17 17:28:17 +08:00
parent 3212819051
commit 76010ff43b
29 changed files with 673 additions and 953 deletions

View File

@@ -98,7 +98,7 @@ c{clear: both;display: none;}
.sortChannelG_nav a.on{color:#ff77a5;}
.sortChannelP_nav a.on{color:#67c3a6;}
.sortChannel_nav{padding-left:80px;border-bottom: 1px solid #FBFBFB;}
.sortChannel_nav{padding-left:110px;border-bottom: 1px solid #FBFBFB;}
.sortChannel_nav a.on{color:#C3C3C3}
.sortChannel_nav a.on2{left:45px;color:#03a9f4;}
@@ -180,7 +180,7 @@ c{clear: both;display: none;}
.novel_info .btn-group-cell>.btn-normal.abt3{background: #4CAF50;}
.chapter-list li{border-bottom:1px solid #efefef;padding:10px 0px 10px 10px;}
.chapter-list li a{display:block;font-size:14px;}
.chapter-list span{background:url(list.png) no-repeat scroll 0 0 transparent;display:block;float:right;height:20px;margin-right:10px;margin-top:2px;width:14px;font-family:"宋体"}
.chapter-list span{display:block;float:right;height:20px;margin-right:10px;margin-top:2px;width:14px;font-family:"宋体"}
/* 章节页 */
.set{width:100%;height:32px;padding:10px 0px 0px 0px;font-size:12px;clear:both;overflow:hidden;background:#ecf0f0;}
@@ -278,7 +278,8 @@ color: #004d00;border-radius:5px;transition: all 0.3s;}
.sort_page_num>a{padding:5px 10px; background: #4ab2e6;margin: 5px;color: #fff;display: inline-block;}
.sort_page_num>a.prev_off{background:#eee;}
.sort_page_num>a:hover,.sort_page_num>a.page_on{background: #3F51B5;}
.novel_search_page h1{font-size: 1rem;text-align: center;margin-bottom: 1rem;}
.novel_search_page h1 span{color:red;}

View File

@@ -150,32 +150,39 @@ function incShouCangFun(intId){
}
}
const strBookshelfKey = window.location.hostname + 'strBookshelfKey';
// 加入书架
function addShujiaFun(NovelInfo){
function addBookshelfFun(NovelInfo) {
if (!NovelInfo) {
NovelInfo = arrNovel
}
let arrBookshelf = JSON.parse(localStorage.getItem(strBookshelfKey)) || [];
// 获取当前书架数据
let arrShujia = JSON.parse(localStorage.getItem('shujiakey')) || [];
console.log(arrShujia)
// 检查书籍是否已存在
const exists = arrShujia.some(item => item.xsxq_id === NovelInfo.xsxq_id);
if (exists) {
layerPopup('该书已在书架中!',3)
return;
const index = arrBookshelf.findIndex(item => item.n_id === NovelInfo.n_id);
if (index !== -1) {
// 如果存在,更新该书籍的信息
arrBookshelf[index] = { ...arrBookshelf[index], ...NovelInfo };
layerPopup('已存在书架中!', 3)
} else {
// 如果不存在,添加到历史记录
arrBookshelf.push(NovelInfo);
layerPopup('已成功加入书架!', 3)
}
// 添加到书架
arrShujia.push(NovelInfo);
// 更新本地存储
localStorage.setItem('shujiakey', JSON.stringify(arrShujia));
localStorage.setItem(strBookshelfKey, JSON.stringify(arrBookshelf));
layerPopup('已成功加入书架!',3)
}
function displayShujia() {
// 获取书架数据
const shujia = JSON.parse(localStorage.getItem('shujiakey')) || [];
const shujia = JSON.parse(localStorage.getItem(strBookshelfKey)) || [];
if (shujia.length === 0) {
console.log('书架为空');

View File

@@ -1009,7 +1009,7 @@ body {
}
.detail-box .imgbox .flag,.topbar-addfavorite,.topbar-login .btn-submit,.topbar-sethome {
background: url("all.gif") no-repeat scroll 0 0 transparent
/* background: url("all.gif") no-repeat scroll 0 0 transparent */
}
.topbar {
@@ -2813,4 +2813,8 @@ body {
margin: 0;
font-size: 12px;
}
/* page end */
/* page end */
.novel_search_page h1{font-size: 1rem;text-align: center;margin-bottom: 1rem;}
.novel_search_page .search_tip{font-size: 0.8rem;text-align: center;margin-bottom: 1rem;}
.novel_search_page h1 span{color:red;}