+
{{ playMusic.name }}
+
+ {{ playbackRate }}x
+
{{ t('player.playBar.reparse') }}
-
-
-
-
-
-
- {{ t('player.playBar.eq') }}
-
-
-
-
-
-
+
+
+
+
{{ t('player.playBar.playList') }}
-
-
-
-
-
- {{ playbackRate }}x
-
-
- {{ t('player.playBar.playbackSpeed') }}
-
-
@@ -189,9 +157,6 @@ import { useThrottleFn } from '@vueuse/core';
import { useMessage } from 'naive-ui';
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
-
-import EqControl from '@/components/EQControl.vue';
-import SleepTimerPopover from '@/components/player/SleepTimerPopover.vue';
import ReparsePopover from '@/components/player/ReparsePopover.vue';
import {
allTime,
@@ -207,10 +172,12 @@ import MusicFull from '@/layout/components/MusicFull.vue';
import { audioService } from '@/services/audioService';
import {
isBilibiliIdMatch,
- usePlayerStore
+ usePlayerStore
} from '@/store/modules/player';
import { useSettingsStore } from '@/store/modules/settings';
import { getImgUrl, isElectron, isMobile, secondToMinute, setAnimationClass } from '@/utils';
+import AdvancedControlsPopover from '@/components/player/AdvancedControlsPopover.vue';
+import { storeToRefs } from 'pinia';
const playerStore = usePlayerStore();
const settingsStore = useSettingsStore();
@@ -337,22 +304,7 @@ const playModeText = computed(() => {
});
// 播放速度控制
-const playbackRate = ref(1.0);
-const playbackRateOptions = [
- { label: '0.5x', key: 0.5 },
- { label: '0.75x', key: 0.75 },
- { label: '1.0x', key: 1.0 },
- { label: '1.25x', key: 1.25 },
- { label: '1.5x', key: 1.5 },
- { label: '2.0x', key: 2.0 }
-];
-
-
-const handlePlaybackRateChange = (rate: number) => {
- playbackRate.value = rate;
- audioService.setPlaybackRate(rate);
-};
-
+const {playbackRate} = storeToRefs(playerStore);
// 切换播放模式
const togglePlayMode = () => {
playerStore.togglePlayMode();
@@ -434,8 +386,6 @@ const handleArtistClick = (id: number) => {
navigateToArtist(id);
};
-const isEQVisible = ref(false);
-
// 打开播放列表抽屉
const openPlayListDrawer = () => {
playerStore.setPlayListDrawerVisible(true);
@@ -464,7 +414,7 @@ const openPlayListDrawer = () => {
}
.music-content {
- width: 160px;
+ width: 200px;
@apply ml-4;
&-title {
@@ -756,4 +706,11 @@ const openPlayListDrawer = () => {
.speed-button:hover {
background: var(--hover-color-dark);
}
+
+
+.playback-rate-badge {
+ @apply ml-2 px-1.5 h-4 flex items-center text-xs rounded bg-green-500 bg-opacity-15 text-green-600 dark:text-green-400;
+ font-weight: 500;
+ vertical-align: 1px;
+}
diff --git a/src/renderer/components/player/SleepTimer.vue b/src/renderer/components/player/SleepTimer.vue
new file mode 100644
index 0000000..15c6ea8
--- /dev/null
+++ b/src/renderer/components/player/SleepTimer.vue
@@ -0,0 +1,342 @@
+
+
+
{{ t('player.sleepTimer.title') }}
+
+
+
+
+ {{ formattedRemainingTime }}
+
+
+ {{ remainingSongs }}
+ {{ t('player.sleepTimer.songsRemaining', { count: remainingSongs }) }}
+
+
+ {{ t('player.sleepTimer.activeUntilEnd') }}
+ {{ t('player.sleepTimer.afterPlaylist') }}
+
+
+
+
+ {{ t('player.sleepTimer.cancel') }}
+
+
+
+
+
+
+
{{ t('player.sleepTimer.timeMode') }}
+
+
+ {{ minutes }}{{ t('player.sleepTimer.minutes') }}
+
+
+
+
+ {{ t('player.sleepTimer.set') }}
+
+
+
+
+
+
+
+
{{ t('player.sleepTimer.songsMode') }}
+
+
+ {{ songs }}{{ t('player.sleepTimer.songs') }}
+
+
+
+
+ {{ t('player.sleepTimer.set') }}
+
+
+
+
+
+
+
+
+ {{ t('player.sleepTimer.playlistEnd') }}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/renderer/components/player/SleepTimerPopover.vue b/src/renderer/components/player/SleepTimerPopover.vue
deleted file mode 100644
index e39bdcc..0000000
--- a/src/renderer/components/player/SleepTimerPopover.vue
+++ /dev/null
@@ -1,478 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ t('player.sleepTimer.title') }}
-
-
-
-
-
-
-
{{ t('player.sleepTimer.title') }}
-
-
-
-
- {{ formattedRemainingTime }}
- {{ t('player.sleepTimer.minutesRemaining', { minutes: Math.ceil(remainingMinutes/60) }) }}
-
-
- {{ remainingSongs }}
- {{ t('player.sleepTimer.songsRemaining', { count: remainingSongs }) }}
-
-
- {{ t('player.sleepTimer.activeUntilEnd') }}
- {{ t('player.sleepTimer.afterPlaylist') }}
-
-
-
-
- {{ t('player.sleepTimer.cancel') }}
-
-
-
-
-
-
-
{{ t('player.sleepTimer.timeMode') }}
-
-
- {{ minutes }}{{ t('player.sleepTimer.minutes') }}
-
-
-
-
- {{ t('player.sleepTimer.set') }}
-
-
-
-
-
-
-
-
{{ t('player.sleepTimer.songsMode') }}
-
-
- {{ songs }}{{ t('player.sleepTimer.songs') }}
-
-
-
-
- {{ t('player.sleepTimer.set') }}
-
-
-
-
-
-
-
-
- {{ t('player.sleepTimer.playlistEnd') }}
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/renderer/components/player/SleepTimerTop.vue b/src/renderer/components/player/SleepTimerTop.vue
new file mode 100644
index 0000000..c83422c
--- /dev/null
+++ b/src/renderer/components/player/SleepTimerTop.vue
@@ -0,0 +1,124 @@
+
+
+
+
+
+ {{ formattedRemainingTime }}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/renderer/layout/AppLayout.vue b/src/renderer/layout/AppLayout.vue
index 074de88..dbdb175 100644
--- a/src/renderer/layout/AppLayout.vue
+++ b/src/renderer/layout/AppLayout.vue
@@ -52,6 +52,7 @@
+
@@ -69,6 +70,7 @@ import { useMenuStore } from '@/store/modules/menu';
import { usePlayerStore } from '@/store/modules/player';
import { useSettingsStore } from '@/store/modules/settings';
import { isElectron, isMobile } from '@/utils';
+import SleepTimerTop from '@/components/player/SleepTimerTop.vue';
const keepAliveInclude = computed(() => {
const allRoutes = [...homeRouter, ...otherRouter];
diff --git a/src/renderer/store/modules/player.ts b/src/renderer/store/modules/player.ts
index 852b30d..285424b 100644
--- a/src/renderer/store/modules/player.ts
+++ b/src/renderer/store/modules/player.ts
@@ -389,7 +389,7 @@ export const usePlayerStore = defineStore('player', () => {
const musicFull = ref(false);
const favoriteList = ref