mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
fix: ask before remove track from playlist
This commit is contained in:
parent
80a324524a
commit
70ef845572
1 changed files with 15 additions and 12 deletions
|
|
@ -11,19 +11,20 @@
|
||||||
<hr />
|
<hr />
|
||||||
<div class="item" @click="play">{{ $t("contextMenu.play") }}</div>
|
<div class="item" @click="play">{{ $t("contextMenu.play") }}</div>
|
||||||
<div class="item" @click="playNext">{{ $t("contextMenu.playNext") }}</div>
|
<div class="item" @click="playNext">{{ $t("contextMenu.playNext") }}</div>
|
||||||
|
<hr />
|
||||||
<div class="item" @click="like" v-show="!isRightClickedTrackLiked">
|
<div class="item" @click="like" v-show="!isRightClickedTrackLiked">
|
||||||
{{ $t("contextMenu.saveToMyLikedSongs") }}
|
{{ $t("contextMenu.saveToMyLikedSongs") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="item" @click="like" v-show="isRightClickedTrackLiked">
|
<div class="item" @click="like" v-show="isRightClickedTrackLiked">
|
||||||
{{ $t("contextMenu.removeFromMyLikedSongs") }}
|
{{ $t("contextMenu.removeFromMyLikedSongs") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="item" @click="addTrackToPlaylist">添加到歌单</div>
|
|
||||||
<div
|
<div
|
||||||
v-if="extraContextMenuItem.includes('removeTrackFromPlaylist')"
|
v-if="extraContextMenuItem.includes('removeTrackFromPlaylist')"
|
||||||
class="item"
|
class="item"
|
||||||
@click="removeTrackFromPlaylist"
|
@click="removeTrackFromPlaylist"
|
||||||
>从歌单中删除</div
|
>从歌单中删除</div
|
||||||
>
|
>
|
||||||
|
<div class="item" @click="addTrackToPlaylist">添加到歌单</div>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
<TrackListItem
|
<TrackListItem
|
||||||
v-for="track in tracks"
|
v-for="track in tracks"
|
||||||
|
|
@ -195,17 +196,19 @@ export default {
|
||||||
this.showToast("此操作需要登录网易云账号");
|
this.showToast("此操作需要登录网易云账号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let trackID = this.rightClickedTrack.id;
|
if (confirm(`确定要从歌单删除 ${this.rightClickedTrack.name}?`)) {
|
||||||
addOrRemoveTrackFromPlaylist({
|
let trackID = this.rightClickedTrack.id;
|
||||||
op: "del",
|
addOrRemoveTrackFromPlaylist({
|
||||||
pid: this.id,
|
op: "del",
|
||||||
tracks: trackID,
|
pid: this.id,
|
||||||
}).then((data) => {
|
tracks: trackID,
|
||||||
this.showToast(
|
}).then((data) => {
|
||||||
data.body.code === 200 ? "已从歌单中删除" : data.body.message
|
this.showToast(
|
||||||
);
|
data.body.code === 200 ? "已从歌单中删除" : data.body.message
|
||||||
this.$parent.removeTrack(trackID);
|
);
|
||||||
});
|
this.$parent.removeTrack(trackID);
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue