update(FM):

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

@ -9,17 +9,10 @@ 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,
setPlayList,
setAudioId,
setPlayState,
setPlayQueue,
setPlayOrder,
setShowCard,
} = useAudioStore(
useShallow((state) => ({ useShallow((state) => ({
playState: state.playState,
playListInfo: state.playListInfo, playListInfo: state.playListInfo,
setPlayListInfo: state.setPlayListInfo, setPlayListInfo: state.setPlayListInfo,
setAudioId: state.setAudioId, setAudioId: state.setAudioId,
@ -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