From 698e83c99243672aee68c97162b7c5ba350130a1 Mon Sep 17 00:00:00 2001 From: mackt <1033530438@qq.com> Date: Mon, 29 Apr 2024 10:41:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=92=AD=E6=94=BE=E5=99=A8=E5=86=85?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=AD=8C=E6=9B=B2=E8=A7=A6=E5=8F=91=20setPla?= =?UTF-8?q?yInfo=20=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E4=B8=8B=E4=B8=80?= =?UTF-8?q?=E9=A6=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Button/ButtonFM.tsx | 2 +- src/components/SongCard/SongCardList.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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; }