From 941eb2e66e36ea7f99fd1bed8724d5149e956af0 Mon Sep 17 00:00:00 2001 From: alger Date: Fri, 13 Sep 2024 09:43:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BD=9C=E8=80=85=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MusicList.vue | 15 +++++++++++++-- src/components/common/SongItem.vue | 10 +++++----- src/layout/components/MusicFull.vue | 8 ++++---- src/layout/components/PlayBar.vue | 10 +++++----- src/type/music.ts | 4 +++- 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/components/MusicList.vue b/src/components/MusicList.vue index 8a83910..7304127 100644 --- a/src/components/MusicList.vue +++ b/src/components/MusicList.vue @@ -3,7 +3,10 @@ :show="show" :height="isMobile ? '100vh' : '70vh'" placement="bottom" + block-scroll + mask-closable :style="{ backgroundColor: 'transparent' }" + @mask-click="close" >
@@ -93,7 +96,16 @@ const formatDetail = computed(() => (detail: any) => { const handlePlay = () => { const tracks = songList || []; - store.commit('setPlayList', tracks); + store.commit( + 'setPlayList', + tracks.map((item) => ({ + ...item, + picUrl: item.al.picUrl, + song: { + artists: item.ar, + }, + })), + ); }; const close = () => { @@ -111,7 +123,6 @@ const loadMoreSongs = async () => { const reslist = await getMusicDetail(trackIds); // displayedSongs.value = displayedSongs.value.concat(reslist.data.songs); displayedSongs.value = JSON.parse(JSON.stringify([...displayedSongs.value, ...reslist.data.songs])); - console.log('displayedSongs.value', displayedSongs.value); page.value++; } catch (error) { console.error('error', error); diff --git a/src/components/common/SongItem.vue b/src/components/common/SongItem.vue index 3d9ca33..ae28f92 100644 --- a/src/components/common/SongItem.vue +++ b/src/components/common/SongItem.vue @@ -7,8 +7,8 @@
- {{ artists.name }}{{ artistsindex < item.artists.length - 1 ? ' / ' : '' }}{{ artists.name }}{{ artistsindex < (item.ar || item.song.artists).length - 1 ? ' / ' : '' }}
@@ -32,12 +32,12 @@