|
|
|
@ -9,17 +9,10 @@ import { useAudioStore } from '@/store';
|
|
|
|
|
|
|
|
|
|
export default function ButtonFM() {
|
|
|
|
|
const { toast } = useToast();
|
|
|
|
|
const {
|
|
|
|
|
playListInfo,
|
|
|
|
|
setPlayListInfo,
|
|
|
|
|
setPlayList,
|
|
|
|
|
setAudioId,
|
|
|
|
|
setPlayState,
|
|
|
|
|
setPlayQueue,
|
|
|
|
|
setPlayOrder,
|
|
|
|
|
setShowCard,
|
|
|
|
|
} = useAudioStore(
|
|
|
|
|
const { playListInfo, setPlayListInfo, setPlayList, setAudioId, setPlayQueue, setPlayOrder, setShowCard } =
|
|
|
|
|
useAudioStore(
|
|
|
|
|
useShallow((state) => ({
|
|
|
|
|
playState: state.playState,
|
|
|
|
|
playListInfo: state.playListInfo,
|
|
|
|
|
setPlayListInfo: state.setPlayListInfo,
|
|
|
|
|
setAudioId: state.setAudioId,
|
|
|
|
@ -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({
|
|
|
|
|