fix(播放队列): 修复随机播放模式下的状态重置问题

在Player组件中重置shuffleCurrent状态,确保随机播放逻辑正确执行。同时在AlbumDetail页面为随机播放按钮添加点击事件,正确设置随机播放状态。
This commit is contained in:
Astrian Zheng 2025-05-26 13:23:22 +10:00
parent d99ae28f8c
commit 0db105705b
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA
2 changed files with 8 additions and 1 deletions

View File

@ -161,6 +161,8 @@ watch(() => playQueueStore.playMode.shuffle, (isShuffle) => {
if (!playQueueStore.shuffleCurrent) {
shuffledList.push(currentIndex)
}
// shuffleCurrent
playQueueStore.shuffleCurrent = undefined
//
let shuffleSpace = [...Array(trackCount).keys()]

View File

@ -78,7 +78,12 @@ function playTheAlbum(from: number = 0) {
</button>
<button
class="text-white w-10 h-10 bg-white/5 border border-[#ffffff39] rounded-full flex justify-center items-center">
class="text-white w-10 h-10 bg-white/5 border border-[#ffffff39] rounded-full flex justify-center items-center"
@click="() => {
playTheAlbum()
playQueue.shuffleCurrent = true
playQueue.playMode.shuffle = true
}">
<ShuffleIcon :size="4" />
</button>