Merge pull request #708 from jiang-LJ/main

feat(player): 在播放栏添加下载当前歌曲按钮
This commit is contained in:
alger
2026-07-05 13:55:34 +08:00
6 changed files with 23 additions and 0 deletions
+1
View File
@@ -59,6 +59,7 @@ export default {
eq: 'Equalizer',
playList: 'Play List',
reparse: 'Reparse',
download: 'Download',
miniPlayBar: 'Mini Play Bar',
playMode: {
sequence: 'Sequence',
+1
View File
@@ -59,6 +59,7 @@ export default {
eq: 'イコライザー',
playList: 'プレイリスト',
reparse: '再解析',
download: 'ダウンロード',
playMode: {
sequence: '順次再生',
loop: 'ループ再生',
+1
View File
@@ -59,6 +59,7 @@ export default {
eq: '이퀄라이저',
playList: '재생 목록',
reparse: '재분석',
download: '다운로드',
playMode: {
sequence: '순차 재생',
loop: '반복 재생',
+1
View File
@@ -58,6 +58,7 @@ export default {
eq: '均衡器',
playList: '播放列表',
reparse: '重新解析',
download: '下载',
playMode: {
sequence: '顺序播放',
loop: '循环播放',
+1
View File
@@ -58,6 +58,7 @@ export default {
eq: '等化器',
playList: '播放清單',
reparse: '重新解析',
download: '下載',
playMode: {
sequence: '順序播放',
loop: '循環播放',
@@ -151,6 +151,16 @@
</template>
{{ t('player.playBar.reparse') }}
</n-tooltip>
<n-tooltip v-if="playMusic?.id" trigger="hover" :z-index="9999999">
<template #trigger>
<i
class="iconfont ri-download-line"
:class="{ 'disabled-icon': isDownloading }"
@click="playMusic?.id && handleDownload()"
/>
</template>
{{ isDownloading ? t('songItem.message.downloading') : t('player.playBar.download') }}
</n-tooltip>
<!-- 高级控制菜单按钮整合了 EQ定时关闭播放速度 -->
<advanced-controls-popover />
@@ -189,6 +199,7 @@ import {
textColors
} from '@/hooks/MusicHook';
import { useArtist } from '@/hooks/useArtist';
import { useDownload } from '@/hooks/useDownload';
import { useFavorite } from '@/hooks/useFavorite';
import { usePlaybackControl } from '@/hooks/usePlaybackControl';
import { usePlayMode } from '@/hooks/usePlayMode';
@@ -217,6 +228,13 @@ const {
// 收藏
const { isFavorite, toggleFavorite } = useFavorite();
// 下载
const { downloadMusic, isDownloading } = useDownload();
const handleDownload = () => {
if (!playMusic.value || isDownloading.value) return;
downloadMusic(playMusic.value);
};
// 播放模式
const { playMode, playModeIcon, playModeText, togglePlayMode } = usePlayMode();