diff --git a/src/renderer/components/player/PlayBar.vue b/src/renderer/components/player/PlayBar.vue index e05a02e..e7d9dd5 100644 --- a/src/renderer/components/player/PlayBar.vue +++ b/src/renderer/components/player/PlayBar.vue @@ -96,11 +96,12 @@
-
+
+
{{ Math.round(volumeSlider) }}%
@@ -276,6 +277,14 @@ const mute = () => { } }; +// 鼠标滚轮调整音量 +const handleVolumeWheel = (e: WheelEvent) => { + // 向上滚动增加音量,向下滚动减少音量 + const delta = e.deltaY < 0 ? 5 : -5; + const newValue = Math.min(Math.max(volumeSlider.value + delta, 0), 100); + volumeSlider.value = newValue; +}; + // 播放模式 const playMode = computed(() => playerStore.playMode); const playModeIcon = computed(() => { @@ -476,6 +485,12 @@ const openPlayListDrawer = () => { @apply absolute opacity-0 invisible transition-all duration-300 bottom-[30px] left-1/2 -translate-x-1/2 h-[180px] px-2 py-4 rounded-xl; @apply bg-light dark:bg-gray-800; @apply border border-gray-200 dark:border-gray-700; + + .volume-percentage { + @apply absolute -top-6 left-1/2 -translate-x-1/2 text-xs font-medium bg-light dark:bg-gray-800 px-2 py-1 rounded-md; + @apply border border-gray-200 dark:border-gray-700; + white-space: nowrap; + } } }