🐞 fix: 修复搜索下 mv和歌曲同时播放问题

This commit is contained in:
alger
2024-12-05 21:35:20 +08:00
parent 5d4c4922fd
commit 08fa160de4
+6 -5
View File
@@ -23,8 +23,9 @@
</template>
<script setup lang="ts">
import { useStore } from 'vuex';
import { getAlbum, getListDetail } from '@/api/list';
import { getMvUrl } from '@/api/mv';
import MvPlayer from '@/components/MvPlayer.vue';
import { IMvItem } from '@/type/mv';
import { getImgUrl } from '@/utils';
@@ -39,8 +40,6 @@ const props = defineProps<{
};
}>();
const url = ref('');
const songList = ref<any[]>([]);
const showPop = ref(false);
@@ -53,6 +52,8 @@ const getCurrentMv = () => {
} as unknown as IMvItem;
};
const store = useStore();
const handleClick = async () => {
listInfo.value = null;
if (props.item.type === '专辑') {
@@ -72,8 +73,8 @@ const handleClick = async () => {
}
if (props.item.type === 'mv') {
const res = await getMvUrl(props.item.id);
url.value = res.data.data.url;
store.commit('setIsPlay', false);
store.commit('setPlayMusic', false);
showPop.value = true;
}
};