update(FM):

1. 点击事件不改变播放状态
2. 初次请求 random song 数量改为 30
feature/artists
mackt 7 months ago
parent 8d75d7d32c
commit 9178682fd5

@ -9,27 +9,20 @@ import { useAudioStore } from '@/store';
export default function ButtonFM() { export default function ButtonFM() {
const { toast } = useToast(); const { toast } = useToast();
const { const { playListInfo, setPlayListInfo, setPlayList, setAudioId, setPlayQueue, setPlayOrder, setShowCard } =
playListInfo, useAudioStore(
setPlayListInfo, useShallow((state) => ({
setPlayList, playState: state.playState,
setAudioId, playListInfo: state.playListInfo,
setPlayState, setPlayListInfo: state.setPlayListInfo,
setPlayQueue, setAudioId: state.setAudioId,
setPlayOrder, setPlayState: state.setPlayState,
setShowCard, setPlayList: state.setPlayList,
} = useAudioStore( setPlayQueue: state.setPlayQueue,
useShallow((state) => ({ setPlayOrder: state.setPlayOrder,
playListInfo: state.playListInfo, setShowCard: state.setShowCard,
setPlayListInfo: state.setPlayListInfo, })),
setAudioId: state.setAudioId, );
setPlayState: state.setPlayState,
setPlayList: state.setPlayList,
setPlayQueue: state.setPlayQueue,
setPlayOrder: state.setPlayOrder,
setShowCard: state.setShowCard,
})),
);
/** /**
* 1. random 30 * 1. random 30
@ -41,11 +34,11 @@ export default function ButtonFM() {
const handlePlayFM = async () => { const handlePlayFM = async () => {
if (playListInfo.type === 'fm') { if (playListInfo.type === 'fm') {
setShowCard(true); setShowCard(true);
setPlayState(true); // if (!playState) setPlayState(true);
return; return;
} }
const res = await apiGetSongRandom(5); const res = await apiGetSongRandom(30);
if (res.code === 200 && res.data.length > 0) { if (res.code === 200 && res.data.length > 0) {
const setRes = setPlayListInfo({ const setRes = setPlayListInfo({

Loading…
Cancel
Save