From 47ded4157dfe2b96c65e48ae6f753100c879c879 Mon Sep 17 00:00:00 2001 From: openclaw Date: Wed, 25 Mar 2026 14:47:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=E7=AB=A0=E8=8A=82=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=A8=E6=80=81=E5=8A=A0=E8=BD=BDdata/chapters.json?= =?UTF-8?q?,=E7=A6=81=E7=94=A8=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alacarte-novel-website/chapters.html | 30 ++++++++++++++++++++++------ alacarte-novel-website/js/app.js | 11 +++++++--- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/alacarte-novel-website/chapters.html b/alacarte-novel-website/chapters.html index 96dac3f..30dac41 100644 --- a/alacarte-novel-website/chapters.html +++ b/alacarte-novel-website/chapters.html @@ -46,7 +46,7 @@

阿拉德:剑之回响

-

共 39 章 · 连载中

+

39 章 · 连载中

@@ -119,14 +119,32 @@
- + diff --git a/alacarte-novel-website/js/app.js b/alacarte-novel-website/js/app.js index 0b85d77..c314f49 100644 --- a/alacarte-novel-website/js/app.js +++ b/alacarte-novel-website/js/app.js @@ -180,7 +180,10 @@ function renderChaptersList() { const container = document.getElementById('chaptersList'); if (!container) return; - container.innerHTML = chaptersData.map(chapter => ` + // 优先使用从JSON动态加载的数据 + const data = window.chaptersData || chaptersData; + + container.innerHTML = data.map(chapter => `
@@ -211,12 +214,13 @@ function setupFilters() { function filterChapters(filter) { const items = document.querySelectorAll('.timeline-item'); + const data = window.chaptersData || chaptersData; items.forEach((item, index) => { let show = true; if (filter === 'latest') { - show = index >= items.length - 5; + show = index >= data.length - 5; } else if (filter === 'unread') { const chapterId = parseInt(item.dataset.chapter); const readChapters = JSON.parse(localStorage.getItem('readChapters') || '[]'); @@ -259,7 +263,8 @@ function setupSearch() { function updateReadingProgress() { const readChapters = JSON.parse(localStorage.getItem('readChapters') || '[]'); - const progress = Math.round((readChapters.length / chaptersData.length) * 100); + const data = window.chaptersData || chaptersData; + const progress = Math.round((readChapters.length / data.length) * 100); const progressFill = document.getElementById('progressFill'); const progressText = document.getElementById('progressText');