From 70ef845572fb266efba7edf27671ffffaca60c9e Mon Sep 17 00:00:00 2001 From: qier222 Date: Thu, 17 Dec 2020 19:27:08 +0800 Subject: [PATCH] fix: ask before remove track from playlist --- src/components/TrackList.vue | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/TrackList.vue b/src/components/TrackList.vue index 1fcc25d..a505b9c 100644 --- a/src/components/TrackList.vue +++ b/src/components/TrackList.vue @@ -11,19 +11,20 @@
{{ $t("contextMenu.play") }}
{{ $t("contextMenu.playNext") }}
+
{{ $t("contextMenu.saveToMyLikedSongs") }}
{{ $t("contextMenu.removeFromMyLikedSongs") }}
-
添加到歌单
从歌单中删除
+
添加到歌单
{ - this.showToast( - data.body.code === 200 ? "已从歌单中删除" : data.body.message - ); - this.$parent.removeTrack(trackID); - }); + if (confirm(`确定要从歌单删除 ${this.rightClickedTrack.name}?`)) { + let trackID = this.rightClickedTrack.id; + addOrRemoveTrackFromPlaylist({ + op: "del", + pid: this.id, + tracks: trackID, + }).then((data) => { + this.showToast( + data.body.code === 200 ? "已从歌单中删除" : data.body.message + ); + this.$parent.removeTrack(trackID); + }); + } }, }, };