fix: 修复选集点击偏移问题,优化事件处理和布局

This commit is contained in:
katelya
2025-09-03 22:01:00 +08:00
parent f0bbcf00dc
commit af73306814
3 changed files with 159 additions and 5 deletions
+4 -2
View File
@@ -737,12 +737,14 @@ function PlayPageClient() {
// ---------------------------------------------------------------------------
// 处理集数切换
const handleEpisodeChange = (episodeNumber: number) => {
if (episodeNumber >= 0 && episodeNumber < totalEpisodes) {
// episodeNumber是显示的集数(从1开始),需要转换为索引(从0开始)
const episodeIndex = episodeNumber - 1;
if (episodeIndex >= 0 && episodeIndex < totalEpisodes) {
// 在更换集数前保存当前播放进度
if (artPlayerRef.current && artPlayerRef.current.paused) {
saveCurrentPlayProgress();
}
setCurrentEpisodeIndex(episodeNumber);
setCurrentEpisodeIndex(episodeIndex);
}
};