This commit is contained in:
make
2025-04-22 21:28:08 +08:00
parent cd0cfdeec5
commit c87a377282
10 changed files with 446 additions and 381 deletions

View File

@@ -141,7 +141,7 @@ body .bg-top-pink-minheight{
.detail-info{
}
.detail-title-xiangqing h1{
.detail-title-xiangqing h2{
font-family: PingFang SC;
font-style: normal;
font-weight: 600;
@@ -242,4 +242,92 @@ margin-right: 0.1rem;
color: #B2B2B2;
line-height: 20px;
width: 100%;
}
}
.site-description {
font-size: 0.3rem;
padding: 0.1rem 0.1rem;
line-height: 0.6rem;
background: #ffffff;
margin-bottom: 0.2rem;
text-align: center;
}
/* 面包屑容器 -----------------------------start */
/* 面包屑容器 */
.breadcrumb {
font-family: Arial, sans-serif;
padding: 10px 15px;
background-color: #f8f9fa;
border-radius: 5px;
margin: 10px 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
/* 有序列表样式 */
.breadcrumb ol {
list-style: none;
margin: 0;
padding: 0;
display: flex;
align-items: center;
flex-wrap: wrap;
}
/* 面包屑项 */
.breadcrumb-item {
font-size: 14px;
color: #666;
}
/* 链接样式 */
.breadcrumb-item a {
text-decoration: none;
color: #007bff;
transition: color 0.3s ease;
}
.breadcrumb-item a:hover {
color: #0056b3;
text-decoration: underline;
}
/* 分隔符 */
.breadcrumb-item + .breadcrumb-item::before {
content: ">";
margin: 0 8px;
color: #999;
font-weight: bold;
}
/* 当前页面样式 */
.breadcrumb-item.active {
color: #333;
font-weight: bold;
}
/* 响应式调整 */
@media (max-width: 768px) {
.breadcrumb {
padding: 8px 10px;
}
.breadcrumb-item {
font-size: 12px;
}
.breadcrumb-item + .breadcrumb-item::before {
margin: 0 5px;
}
}
/* 面包屑容器 -----------------------------end */
.page_num{text-align: center;font-size: 14px;box-sizing: border-box;padding: 10px;width: 330px;margin: 0 auto;display: flex;}
.page_num select{padding: 0 10px;height: 34px;line-height: 35px;box-sizing: border-box;border: 1px solid #7d9465;background: #fff;border-radius: 5px;margin: 0 10px;width: 140px;cursor: pointer;}
.page_num a{height:34px;line-height: 35px;padding: 0 15px;display: block;margin: 0;box-sizing: border-box;background: #dcebcd;
color: #004d00;border-radius:5px;transition: all 0.3s;}
.page_num a:hover{background: #004d00;color:#fff}

View File

@@ -56,31 +56,38 @@ function incShouCangFun(intId){
}
}
const strBookshelfKey = window.location.hostname + 'strBookshelfKey';
const strHistoryKey = window.location.hostname + 'strHistoryKey';
// 加入书架
function addShujiaFun(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));
layerPopup('已成功加入书架!',3)
localStorage.setItem(strBookshelfKey, JSON.stringify(arrBookshelf));
}
function displayShujia() {
// 获取书架数据
const shujia = JSON.parse(localStorage.getItem('shujiakey')) || [];
const shujia = JSON.parse(localStorage.getItem(strBookshelfKey)) || [];
if (shujia.length === 0) {
console.log('书架为空');