Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ declare module 'vue' {
ArtistList: typeof import('./src/components/List/ArtistList.vue')['default']
AutoClose: typeof import('./src/components/Modal/AutoClose.vue')['default']
BackgroundRender: typeof import('./src/components/Special/BackgroundRender.vue')['default']
BatchList: typeof import('./src/components/Modal/BatchList.vue')['default']
BatchList: typeof import('./src/components/Modal/Playlist/BatchList.vue')['default']
ChangeRate: typeof import('./src/components/Modal/ChangeRate.vue')['default']
CloudMatch: typeof import('./src/components/Modal/CloudMatch.vue')['default']
CloudMatch: typeof import('./src/components/Modal/Song/CloudMatch.vue')['default']
CommentList: typeof import('./src/components/List/CommentList.vue')['default']
CopyLyrics: typeof import('./src/components/Modal/CopyLyrics.vue')['default']
CopyLyrics: typeof import('./src/components/Modal/Song/CopyLyrics.vue')['default']
CountDown: typeof import('./src/components/Player/CountDown.vue')['default']
CoverList: typeof import('./src/components/List/CoverList.vue')['default']
CoverMenu: typeof import('./src/components/Menu/CoverMenu.vue')['default']
CreatePlaylist: typeof import('./src/components/Modal/CreatePlaylist.vue')['default']
CreatePlaylist: typeof import('./src/components/Modal/Playlist/CreatePlaylist.vue')['default']
DownloadModal: typeof import('./src/components/Modal/DownloadModal.vue')['default']
Equalizer: typeof import('./src/components/Modal/Equalizer.vue')['default']
ExcludeLyrics: typeof import('./src/components/Modal/Setting/ExcludeLyrics.vue')['default']
Expand Down Expand Up @@ -139,7 +139,7 @@ declare module 'vue' {
PlayerRightMenu: typeof import('./src/components/Player/PlayerRightMenu.vue')['default']
PlayerSlider: typeof import('./src/components/Player/PlayerSlider.vue')['default']
PlayerSpectrum: typeof import('./src/components/Player/PlayerSpectrum.vue')['default']
PlaylistAdd: typeof import('./src/components/Modal/PlaylistAdd.vue')['default']
PlaylistAdd: typeof import('./src/components/Modal/Playlist/PlaylistAdd.vue')['default']
PlaySetting: typeof import('./src/components/Setting/PlaySetting.vue')['default']
Provider: typeof import('./src/components/Global/Provider.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
Expand All @@ -154,7 +154,7 @@ declare module 'vue' {
SInput: typeof import('./src/components/UI/s-input.vue')['default']
SongCard: typeof import('./src/components/Card/SongCard.vue')['default']
SongDataCard: typeof import('./src/components/Card/SongDataCard.vue')['default']
SongInfoEditor: typeof import('./src/components/Modal/SongInfoEditor.vue')['default']
SongInfoEditor: typeof import('./src/components/Modal/Song/SongInfoEditor.vue')['default']
SongList: typeof import('./src/components/List/SongList.vue')['default']
SongListCard: typeof import('./src/components/Card/SongListCard.vue')['default']
SongListMenu: typeof import('./src/components/Menu/SongListMenu.vue')['default']
Expand All @@ -163,7 +163,7 @@ declare module 'vue' {
TextContainer: typeof import('./src/components/Global/TextContainer.vue')['default']
ThirdSetting: typeof import('./src/components/Setting/ThirdSetting.vue')['default']
UpdateApp: typeof import('./src/components/Modal/UpdateApp.vue')['default']
UpdatePlaylist: typeof import('./src/components/Modal/UpdatePlaylist.vue')['default']
UpdatePlaylist: typeof import('./src/components/Modal/Playlist/UpdatePlaylist.vue')['default']
User: typeof import('./src/components/Layout/User.vue')['default']
UserAgreement: typeof import('./src/components/Modal/UserAgreement.vue')['default']
VirtualScroll: typeof import('./src/components/UI/VirtualScroll.vue')['default']
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"pinia-plugin-persistedstate": "^4.7.1",
"plyr": "^3.8.3",
"sortablejs": "^1.15.6",
"vue-i18n": "^11.2.7",
"ws": "^8.18.3"
},
"devDependencies": {
Expand Down
48 changes: 44 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 30 additions & 13 deletions src/components/Layout/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import {
NAvatar,
NBadge,
} from "naive-ui";
import { useI18n } from "vue-i18n";

import type { CoverType } from "@/types/main";
import { useStatusStore, useSettingStore, useDataStore, useMusicStore } from "@/stores";
import { useRouter, RouterLink } from "vue-router";
Expand All @@ -43,6 +45,8 @@ const musicStore = useMusicStore();
const statusStore = useStatusStore();
const settingStore = useSettingStore();
const player = usePlayerController();
const { t } = useI18n();


// 菜单数据
const menuRef = ref<MenuInst | null>(null);
Expand All @@ -55,7 +59,8 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
{
key: "home",
link: "home",
label: "为我推荐",
label: t("menu.recommend"),

icon: renderIcon("Home", {
style: {
transform: "translateY(-1px)",
Expand All @@ -65,7 +70,8 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
{
key: "discover",
link: "discover",
label: "发现音乐",
label: t("menu.discover"),

show: !settingStore.hideDiscover,
icon: renderIcon("Discover", {
style: {
Expand All @@ -75,7 +81,8 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
},
{
key: "personal-fm",
label: "私人漫游",
label: t("menu.roaming"),

show: isLogin() !== 0 && !settingStore.hidePersonalFM,
icon: renderIcon("Radio", {
style: {
Expand All @@ -86,7 +93,8 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
{
key: "radio-hot",
link: "radio-hot",
label: "播客电台",
label: t("menu.podcast"),

show: !settingStore.hideRadioHot,
icon: renderIcon("Record", {
style: {
Expand All @@ -102,8 +110,9 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
key: "like-songs",
label: () =>
h("div", { class: "user-liked" }, [
h(NText, null, () => "我喜欢的音乐"),
h(NText, null, () => t("menu.myLikeSongs")),
!settingStore.hideHeartbeatMode

? h(NButton, {
type: statusStore.playHeartbeatMode ? "primary" : "default",
round: true,
Expand All @@ -122,14 +131,16 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
{
key: "like",
link: "like",
label: "我的收藏",
label: t("menu.myCollection"),

show: !settingStore.hideLike,
icon: renderIcon("Star"),
},
{
key: "cloud",
link: "cloud",
label: "我的云盘",
label: t("menu.myCloud"),

show: isLogin() === 1 && !settingStore.hideCloud,
icon: renderIcon("Cloud"),
},
Expand All @@ -143,22 +154,25 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
value: dataStore.downloadingSongs.length,
offset: [22, 13],
},
() => "下载管理",
() => t("menu.download"),
),

show: statusStore.isDeveloperMode && isElectron && !settingStore.hideDownload,
icon: renderIcon("Download"),
},
{
key: "local",
link: "local",
label: "本地歌曲",
label: t("menu.local"),

show: isElectron && !settingStore.hideLocal,
icon: renderIcon("FolderMusic"),
},
{
key: "history",
link: "history",
label: "最近播放",
label: t("menu.recent"),

show: !settingStore.hideHistory,
icon: renderIcon("History"),
},
Expand All @@ -173,8 +187,9 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
icon: statusStore.menuCollapsed ? renderIcon("PlaylistAdd") : undefined,
label: () =>
h("div", { class: "user-list" }, [
h(NText, { depth: 3 }, () => ["创建的歌单"]),
h(NText, { depth: 3 }, () => [t("menu.createdList")]),
h(NButton, {

type: "tertiary",
round: true,
strong: true,
Expand All @@ -197,16 +212,18 @@ const menuOptions = computed<MenuOption[] | MenuGroupOption[]>(() => {
h(
"div",
{ class: "user-list" },
h(NText, { depth: 3 }, () => ["收藏的歌单"]),
h(NText, { depth: 3 }, () => [t("menu.collectedList")]),
),

children: [...likedPlaylist.value],
},
]
: [
{
key: "local",
link: "local",
label: "本地歌曲",
label: t("menu.local"),

show: isElectron,
icon: renderIcon("FolderMusic"),
},
Expand Down
Loading