diff --git a/src/components/Button/ButtonFM.tsx b/src/components/Button/ButtonFM.tsx index e2db585..405020b 100644 --- a/src/components/Button/ButtonFM.tsx +++ b/src/components/Button/ButtonFM.tsx @@ -43,7 +43,7 @@ export default function ButtonFM() { if (res.code === 200 && res.data.length > 0) { const setRes = setPlayListInfo({ type: 'fm', - id: null, + id: 'fm', }); if (!setRes) return; setPlayList(res.data); diff --git a/src/components/SongCard/SongCardList.tsx b/src/components/SongCard/SongCardList.tsx index 3e89f7c..d153aca 100644 --- a/src/components/SongCard/SongCardList.tsx +++ b/src/components/SongCard/SongCardList.tsx @@ -9,6 +9,11 @@ import { SongCard } from '@/components'; import { useAudioStore } from '@/store'; interface Props { + /** 列表类型 + * vol: 期刊 + * collectSingle: 收藏单曲 + * playerCard: 播放器内 + */ listInfo: { type: 'vol' | 'collectSingle' | 'playerCard'; id: string | null }; songList: SongInfo[]; /** 收藏按钮的显示逻辑 always: 总是显示 playing: 播放时显示 */ @@ -42,7 +47,7 @@ export default function SongCardList({ listInfo, songList, className, collectTyp const isPlayingList = listInfo.type === playListInfo.type && listInfo.id === playListInfo.id; // 正在播放当前歌单 const isInQueue = playQueue.some((item) => item.id === id); // 所选的歌在队列中 - if (isPlayingList && isInQueue) { + if ((isPlayingList && isInQueue) || listInfo.type === 'playerCard') { setAudioId(id); return; }