diff --git a/src/components/PlayListDetail.vue b/src/components/PlayListDetail.vue index 28043b4000f5c72736acf3473860e3e7b9acf8fa..0e99cab2a27e8990bffbef17d66cb2220df365fb 100644 --- a/src/components/PlayListDetail.vue +++ b/src/components/PlayListDetail.vue @@ -42,7 +42,13 @@ export default { emitter.on("sendId", async (id) => { let res = await GetArtistDesc("artist/desc", id); songerDec.value = res.data.briefDesc; - coverPic.value = res.data.topicData[0].coverUrl; + if (res.data.topicData) { + //当图片数据存在时 + coverPic.value = res.data.topicData[0].coverUrl; + } else { + //当图片数据不存在时 + coverPic.value = ""; + } }); return { songerDec, @@ -66,6 +72,8 @@ export default { height: 200px; width: 200px; border-radius: 20px; + overflow: hidden; /** 弹性子元素的overflow失效问题 */ + flex: 0 0 auto; /** 给弹性子元素加上 flex:0 0 auto; */ } .detail-img .img { height: 200px; diff --git a/src/components/PlayLists.vue b/src/components/PlayLists.vue index 3333c43c28418891f6ddb4173036705ab083800e..2336ba1526923a059d7482dc7ec7267f67bac0bd 100644 --- a/src/components/PlayLists.vue +++ b/src/components/PlayLists.vue @@ -99,7 +99,7 @@ export default { getTopSongs("artist/top/song", id).then((res) => { playlists.length = 0; // 清空数组 playlists.push(res.data.songs); - // console.log(playlists); + // console.log(playlists[0][0]); // 存储所有歌曲的 id playlists[0].forEach((item) => { ids.push(item.id); diff --git a/src/components/Player.vue b/src/components/Player.vue index b0dde80d189fcb2878a6c6ffbddc8f50d33c4ffa..24a1e91e79594844bf40dd2d83ca61190e6490ae 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -1,38 +1,146 @@ - - + + 您的浏览器不支持 audio 元素。 - + - 新地球 - - 林俊杰 + 太傻 - + 巫启贤 - + - 02:03 / 5:00 + {{ nowTime }} / {{ durationTime }} @@ -40,8 +148,7 @@ export default {