@@ -83,7 +94,7 @@
@@ -278,18 +288,22 @@ const selectSpeed = (speed: number) => {
@apply text-lg font-medium mb-4 text-center;
}
+ .speed-controls {
+ @apply my-8 mx-4;
+ }
.speed-options {
- @apply flex flex-wrap justify-center gap-4 my-8 mx-4;
-
- .speed-option {
- @apply py-2 px-4 rounded-full cursor-pointer transition-all;
- @apply bg-gray-100 dark:bg-gray-800;
- @apply hover:bg-green-100 dark:hover:bg-green-900;
-
- &.active {
- @apply bg-green-500 text-white;
- }
- }
+ @apply flex flex-wrap justify-center gap-4;
+ }
+ .speed-slider {
+ @apply mt-4;
+ }
+ .speed-option {
+ @apply py-2 px-4 rounded-full cursor-pointer transition-all;
+ @apply bg-gray-100 dark:bg-gray-800;
+ @apply hover:bg-green-100 dark:hover:bg-green-900;
+ }
+ .speed-option.active {
+ @apply bg-green-500 text-white;
}
}
diff --git a/src/renderer/components/player/PlayBar.vue b/src/renderer/components/player/PlayBar.vue
index 05f21e9..d3781f9 100644
--- a/src/renderer/components/player/PlayBar.vue
+++ b/src/renderer/components/player/PlayBar.vue
@@ -58,7 +58,7 @@
- {{ playMusic.name }}
+ {{ playMusic?.name || '' }}
{{ playbackRate }}x
@@ -123,15 +123,15 @@
- {{ playMusic.id ? t('player.playBar.lyric') : t('player.playBar.noSongPlaying') }}
+ {{ playMusic?.id ? t('player.playBar.lyric') : t('player.playBar.noSongPlaying') }}
-
+
-
+
{{ t('player.playBar.reparse') }}
@@ -191,7 +191,9 @@ const background = ref('#000');
watch(
() => playerStore.playMusic,
async () => {
- background.value = playMusic.value.backgroundColor as string;
+ if (playMusic && playMusic.value && playMusic.value.backgroundColor) {
+ background.value = playMusic.value.backgroundColor as string;
+ }
},
{ immediate: true, deep: true }
);
@@ -359,6 +361,7 @@ const setMusicFull = () => {
};
const isFavorite = computed(() => {
+ if (!playMusic || !playMusic.value) return false;
// 对于B站视频,使用ID匹配函数
if (playMusic.value.source === 'bilibili' && playMusic.value.bilibiliData?.bvid) {
return playerStore.favoriteList.some((id) => isBilibiliIdMatch(id, playMusic.value.id));