* 获取章节信息 * @param {number} chapterNumber - 章节编号 * @returns {Object|null} 章节信息对象
(chapterNumber)
| 1075 | * @returns {Object|null} 章节信息对象 |
| 1076 | */ |
| 1077 | function getChapterInfo(chapterNumber) { |
| 1078 | // 优先使用 NavigationSystem |
| 1079 | if (typeof NavigationSystem !== 'undefined' && NavigationSystem.getChapterByNumber) { |
| 1080 | return NavigationSystem.getChapterByNumber(chapterNumber); |
| 1081 | } |
| 1082 | |
| 1083 | // 备用:直接从 CHAPTERS_DATA 获取 |
| 1084 | if (typeof CHAPTERS_DATA !== 'undefined') { |
| 1085 | return CHAPTERS_DATA.find(ch => ch.number === chapterNumber) || null; |
| 1086 | } |
| 1087 | |
| 1088 | return null; |
| 1089 | } |
| 1090 | |
| 1091 | /** |
| 1092 | * 更新继续阅读弹窗中的章节信息 |
no outgoing calls
no test coverage detected