From 9c03de74f818377a7d3253c512202cd0da6d1197 Mon Sep 17 00:00:00 2001 From: first19326 <870390039@qq.com> Date: Fri, 3 Nov 2023 00:47:07 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A3=81=E7=BA=B8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=8A=B6=E6=80=81=E4=B8=8B=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E8=8F=9C=E5=8D=95=E6=8C=89=E9=92=AE=E6=9C=AA=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index b4175236c9..c777137c16 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,7 +17,12 @@ - + From 418d73caba1f2939cd4361fd9aee66544deaba20 Mon Sep 17 00:00:00 2001 From: first19326 <870390039@qq.com> Date: Fri, 3 Nov 2023 00:48:17 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D720px=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E8=A7=86=E7=AA=97=E4=B8=8B=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E6=8C=89=E9=92=AE=E6=9C=AA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index c777137c16..3c905b66fa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -183,7 +183,7 @@ onBeforeUnmount(() => { .i-icon { transform: translateY(2px); } - @media (min-width: 720px) { + @media (min-width: 721px) { display: none; } } From 1f8afa7268646fef3bdbbab9750ecb60c13067d9 Mon Sep 17 00:00:00 2001 From: first19326 <870390039@qq.com> Date: Fri, 3 Nov 2023 00:49:18 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8Safari?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E5=85=B3=E9=97=AD=E9=9F=B3=E4=B9=90?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=B1=8F=E5=B9=95=E9=97=AA=E7=83=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Music.vue | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/Music.vue b/src/components/Music.vue index 1568eb2727..5239a46874 100644 --- a/src/components/Music.vue +++ b/src/components/Music.vue @@ -42,7 +42,7 @@ - +
@@ -281,12 +281,6 @@ watch( } // 弹窗动画 -.fade-enter-active { - animation: fade 0.3s ease-in-out; -} -.fade-leave-active { - animation: fade 0.3s ease-in-out reverse; -} .zoom-enter-active { animation: zoom 0.4s ease-in-out; } From 17b278f4679e1f9c4e756d91ddd5a94022ca2c4c Mon Sep 17 00:00:00 2001 From: first19326 <870390039@qq.com> Date: Fri, 3 Nov 2023 00:49:56 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A3=81=E7=BA=B8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=8A=B6=E6=80=81=E6=97=A0=E6=B3=95=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=B8=8B=E8=BD=BD=E6=8C=89=E9=92=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Background.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Background.vue b/src/components/Background.vue index 178cfd5b37..2b8e385e07 100644 --- a/src/components/Background.vue +++ b/src/components/Background.vue @@ -1,5 +1,5 @@ diff --git a/src/views/Func/index.vue b/src/views/Func/index.vue index d3d23c0460..e3775fdadc 100644 --- a/src/views/Func/index.vue +++ b/src/views/Func/index.vue @@ -5,7 +5,7 @@
- +
@@ -41,6 +41,9 @@ const store = mainStore(); const currentTime = ref({}); const timeInterval = ref(null); +// 播放器 id +const playerHasId = import.meta.env.VITE_SONG_ID; + // 更新时间 const updateTimeData = () => { currentTime.value = getCurrentTime(); From 46b187d01f40ef586e1542933e7bfff27da7fa4f Mon Sep 17 00:00:00 2001 From: first19326 <870390039@qq.com> Date: Sat, 4 Nov 2023 20:21:50 +0800 Subject: [PATCH 6/8] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E9=9F=B3=E4=B9=90=E5=A4=B1=E8=B4=A5=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Player.vue | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/components/Player.vue b/src/components/Player.vue index 05870cacd9..626602c335 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -16,6 +16,7 @@ @pause="onPause" @timeupdate="onTimeUp" @onSelectSong="onSelectSong" + @error="loadMusicError" /> @@ -37,6 +38,8 @@ const playList = ref([]); const playIndex = ref(0); const playListCount = ref(0); +const skipTimeout = ref(null); + // 配置项 const props = defineProps({ // 音频自动播放 @@ -202,8 +205,39 @@ const changeSong = (type) => { }); }; +// 加载音频错误 +const loadMusicError = () => { + let notice = ""; + if (playList.value.length > 1) { + notice = "播放音频出现错误,播放器将在 2s 后进行跳转"; + // 播放下一首 + skipTimeout.value = setTimeout(() => { + changeSong(1); + if (!player.value.audio.paused) { + onPlay(); + } + }, 2000); + } else { + notice = "播放音频出现错误"; + } + ElMessage({ + message: notice, + grouping: true, + icon: h(PlayWrong, { + theme: "filled", + fill: "#EFEFEF", + duration: 2000, + }), + }); + console.error("播放音乐: " + player.value.currentMusic.title + " 出现错误"); +}; + // 暴露子组件方法 defineExpose({ playToggle, changeVolume, changeSong }); + +onBeforeUnmount(() => { + clearTimeout(skipTimeout.value); +});