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

Loading…
Cancel
Save