diff --git a/src/assets/icons/more.svg b/src/assets/icons/more.svg index 53c45a1..51bb992 100644 --- a/src/assets/icons/more.svg +++ b/src/assets/icons/more.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/components/ContextMenu.vue b/src/components/ContextMenu.vue index 024f533..47e50dd 100644 --- a/src/components/ContextMenu.vue +++ b/src/components/ContextMenu.vue @@ -37,7 +37,9 @@ export default { closeMenu() { this.showMenu = false; - this.$parent.closeMenu(); + if (this.$parent.closeMenu !== undefined) { + this.$parent.closeMenu(); + } }, openMenu(e) { diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index 3049a60..59b1bdf 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -125,10 +125,10 @@ export default { play: "播放", playNext: "下一首播放", saveToMyLikedSongs: "添加到我喜欢的音乐", - removeFromMyLikedSongs: "从喜欢的音乐中移除", + removeFromMyLikedSongs: "从喜欢的音乐中删除", }, toast: { savedToMyLikedSongs: "已添加到我喜欢的音乐", - removedFromMyLikedSongs: "已从喜欢的音乐中移除", + removedFromMyLikedSongs: "已从喜欢的音乐中删除", }, }; diff --git a/src/views/album.vue b/src/views/album.vue index bd64c32..c4f9b5a 100644 --- a/src/views/album.vue +++ b/src/views/album.vue @@ -9,10 +9,13 @@ :size="288" :type="'album'" :id="album.id" + @click.right.native="openMenu" />
-
{{ title }}
-
{{ subtitle }}
+
{{ title }}
+
{{ + subtitle + }}
{{ album.type | formatAlbumType(album) }} by {{ $t("common.play") }} @@ -55,6 +58,14 @@ @click.native="likeAlbum" > + +
@@ -93,8 +104,17 @@ + :showFooter="false" + title="专辑介绍" + >{{ album.description }} + +
{{ $t("contextMenu.playNext") }}
+
{{ + dynamicDetail.isSub ? "从音乐库删除" : "保存到音乐库" + }}
+
添加到歌单
+
@@ -110,6 +130,7 @@ import { isAccountLoggedIn } from "@/utils/auth"; import ExplicitSymbol from "@/components/ExplicitSymbol.vue"; import ButtonTwoTone from "@/components/ButtonTwoTone.vue"; +import ContextMenu from "@/components/ContextMenu.vue"; import TrackList from "@/components/TrackList.vue"; import CoverRow from "@/components/CoverRow.vue"; import Cover from "@/components/Cover.vue"; @@ -124,6 +145,7 @@ export default { ExplicitSymbol, CoverRow, Modal, + ContextMenu, }, data() { return { @@ -180,7 +202,7 @@ export default { } playAlbumByID(id, trackID); }, - likeAlbum() { + likeAlbum(toast = false) { if (!isAccountLoggedIn()) { this.showToast("此操作需要登录网易云账号"); return; @@ -189,8 +211,13 @@ export default { id: this.album.id, t: this.dynamicDetail.isSub ? 0 : 1, }).then((data) => { - if (data.code === 200) + if (data.code === 200) { this.dynamicDetail.isSub = !this.dynamicDetail.isSub; + if (toast === true) + this.showToast( + this.dynamicDetail.isSub ? "已保存到音乐库" : "已从音乐库删除" + ); + } }); }, formatTitle() { @@ -231,6 +258,9 @@ export default { this.dynamicDetail = data; }); }, + openMenu(e) { + this.$refs.albumMenu.openMenu(e); + }, }, beforeRouteUpdate(to, from, next) { NProgress.start(); diff --git a/src/views/playlist.vue b/src/views/playlist.vue index 0a37547..5681250 100644 --- a/src/views/playlist.vue +++ b/src/views/playlist.vue @@ -10,9 +10,10 @@ :alwaysShowShadow="true" :clickToPlay="true" :size="288" + @click.right.native="openMenu" />
-
{{ playlist.name }}
+ +
-
+
{{ specialPlaylistInfo.name }}
@@ -99,6 +112,14 @@ @click.native="likePlaylist" > + +
@@ -115,20 +136,46 @@ + :showFooter="false" + title="歌单介绍" + >{{ playlist.description }} + + +
{{ $t("contextMenu.playNext") }}
+
{{ + playlist.subscribed ? "从音乐库删除" : "保存到音乐库" + }}
+
编辑歌单信息
+
删除歌单
+