|
|
@ -10,7 +10,15 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<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="addToQueue">{{
|
|
|
|
|
|
|
|
$t('contextMenu.addToQueue')
|
|
|
|
|
|
|
|
}}</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-if="extraContextMenuItem.includes('removeTrackFromQueue')"
|
|
|
|
|
|
|
|
class="item"
|
|
|
|
|
|
|
|
@click="removeTrackFromQueue"
|
|
|
|
|
|
|
|
>从队列删除</div
|
|
|
|
|
|
|
|
>
|
|
|
|
<hr />
|
|
|
|
<hr />
|
|
|
|
<div v-show="!isRightClickedTrackLiked" class="item" @click="like">
|
|
|
|
<div v-show="!isRightClickedTrackLiked" class="item" @click="like">
|
|
|
|
{{ $t('contextMenu.saveToMyLikedSongs') }}
|
|
|
|
{{ $t('contextMenu.saveToMyLikedSongs') }}
|
|
|
@ -33,7 +41,7 @@
|
|
|
|
:track="track"
|
|
|
|
:track="track"
|
|
|
|
:highlight-playing-track="highlightPlayingTrack"
|
|
|
|
:highlight-playing-track="highlightPlayingTrack"
|
|
|
|
@dblclick.native="playThisList(track.id)"
|
|
|
|
@dblclick.native="playThisList(track.id)"
|
|
|
|
@click.right.native="openMenu($event, track)"
|
|
|
|
@click.right.native="openMenu($event, track, index)"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -74,7 +82,10 @@ export default {
|
|
|
|
extraContextMenuItem: {
|
|
|
|
extraContextMenuItem: {
|
|
|
|
type: Array,
|
|
|
|
type: Array,
|
|
|
|
default: () => {
|
|
|
|
default: () => {
|
|
|
|
return []; // 'removeTrackFromPlaylist'
|
|
|
|
return [
|
|
|
|
|
|
|
|
// 'removeTrackFromPlaylist'
|
|
|
|
|
|
|
|
// 'removeTrackFromQueue'
|
|
|
|
|
|
|
|
];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
columnNumber: {
|
|
|
|
columnNumber: {
|
|
|
@ -98,11 +109,12 @@ export default {
|
|
|
|
ar: [{ name: '' }],
|
|
|
|
ar: [{ name: '' }],
|
|
|
|
al: { picUrl: '' },
|
|
|
|
al: { picUrl: '' },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
rightClickedTrackIndex: -1,
|
|
|
|
listStyles: {},
|
|
|
|
listStyles: {},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
...mapState(['liked']),
|
|
|
|
...mapState(['liked', 'player']),
|
|
|
|
isRightClickedTrackLiked() {
|
|
|
|
isRightClickedTrackLiked() {
|
|
|
|
return this.liked.songs.includes(this.rightClickedTrack?.id);
|
|
|
|
return this.liked.songs.includes(this.rightClickedTrack?.id);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -119,8 +131,9 @@ export default {
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
...mapMutations(['updateModal']),
|
|
|
|
...mapMutations(['updateModal']),
|
|
|
|
...mapActions(['nextTrack', 'showToast', 'likeATrack']),
|
|
|
|
...mapActions(['nextTrack', 'showToast', 'likeATrack']),
|
|
|
|
openMenu(e, track) {
|
|
|
|
openMenu(e, track, index = -1) {
|
|
|
|
this.rightClickedTrack = track;
|
|
|
|
this.rightClickedTrack = track;
|
|
|
|
|
|
|
|
this.rightClickedTrackIndex = index;
|
|
|
|
this.$refs.menu.openMenu(e);
|
|
|
|
this.$refs.menu.openMenu(e);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
closeMenu() {
|
|
|
|
closeMenu() {
|
|
|
@ -130,6 +143,7 @@ export default {
|
|
|
|
ar: [{ name: '' }],
|
|
|
|
ar: [{ name: '' }],
|
|
|
|
al: { picUrl: '' },
|
|
|
|
al: { picUrl: '' },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
this.rightClickedTrackIndex = -1;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
playThisList(trackID) {
|
|
|
|
playThisList(trackID) {
|
|
|
|
if (this.dbclickTrackFunc === 'default') {
|
|
|
|
if (this.dbclickTrackFunc === 'default') {
|
|
|
@ -137,50 +151,32 @@ export default {
|
|
|
|
} else if (this.dbclickTrackFunc === 'none') {
|
|
|
|
} else if (this.dbclickTrackFunc === 'none') {
|
|
|
|
// do nothing
|
|
|
|
// do nothing
|
|
|
|
} else if (this.dbclickTrackFunc === 'playTrackOnListByID') {
|
|
|
|
} else if (this.dbclickTrackFunc === 'playTrackOnListByID') {
|
|
|
|
this.$store.state.player.playTrackOnListByID(trackID);
|
|
|
|
this.player.playTrackOnListByID(trackID);
|
|
|
|
} else if (this.dbclickTrackFunc === 'playPlaylistByID') {
|
|
|
|
} else if (this.dbclickTrackFunc === 'playPlaylistByID') {
|
|
|
|
this.$store.state.player.playPlaylistByID(this.id, trackID);
|
|
|
|
this.player.playPlaylistByID(this.id, trackID);
|
|
|
|
} else if (this.dbclickTrackFunc === 'playAList') {
|
|
|
|
} else if (this.dbclickTrackFunc === 'playAList') {
|
|
|
|
let trackIDs = this.tracks.map(t => t.id);
|
|
|
|
let trackIDs = this.tracks.map(t => t.id);
|
|
|
|
this.$store.state.player.replacePlaylist(
|
|
|
|
this.player.replacePlaylist(trackIDs, this.id, 'artist', trackID);
|
|
|
|
trackIDs,
|
|
|
|
|
|
|
|
this.id,
|
|
|
|
|
|
|
|
'artist',
|
|
|
|
|
|
|
|
trackID
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else if (this.dbclickTrackFunc === 'dailyTracks') {
|
|
|
|
} else if (this.dbclickTrackFunc === 'dailyTracks') {
|
|
|
|
let trackIDs = this.tracks.map(t => t.id);
|
|
|
|
let trackIDs = this.tracks.map(t => t.id);
|
|
|
|
this.$store.state.player.replacePlaylist(
|
|
|
|
this.player.replacePlaylist(trackIDs, '/daily/songs', 'url', trackID);
|
|
|
|
trackIDs,
|
|
|
|
|
|
|
|
'/daily/songs',
|
|
|
|
|
|
|
|
'url',
|
|
|
|
|
|
|
|
trackID
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
playThisListDefault(trackID) {
|
|
|
|
playThisListDefault(trackID) {
|
|
|
|
if (this.type === 'playlist') {
|
|
|
|
if (this.type === 'playlist') {
|
|
|
|
this.$store.state.player.playPlaylistByID(this.id, trackID);
|
|
|
|
this.player.playPlaylistByID(this.id, trackID);
|
|
|
|
} else if (this.type === 'album') {
|
|
|
|
} else if (this.type === 'album') {
|
|
|
|
this.$store.state.player.playAlbumByID(this.id, trackID);
|
|
|
|
this.player.playAlbumByID(this.id, trackID);
|
|
|
|
} else if (this.type === 'tracklist') {
|
|
|
|
} else if (this.type === 'tracklist') {
|
|
|
|
let trackIDs = this.tracks.map(t => t.id);
|
|
|
|
let trackIDs = this.tracks.map(t => t.id);
|
|
|
|
this.$store.state.player.replacePlaylist(
|
|
|
|
this.player.replacePlaylist(trackIDs, this.id, 'artist', trackID);
|
|
|
|
trackIDs,
|
|
|
|
|
|
|
|
this.id,
|
|
|
|
|
|
|
|
'artist',
|
|
|
|
|
|
|
|
trackID
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
play() {
|
|
|
|
play() {
|
|
|
|
this.$store.state.player.addTrackToPlayNext(
|
|
|
|
this.player.addTrackToPlayNext(this.rightClickedTrack.id, true);
|
|
|
|
this.rightClickedTrack.id,
|
|
|
|
|
|
|
|
true
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
playNext() {
|
|
|
|
addToQueue() {
|
|
|
|
this.$store.state.player.addTrackToPlayNext(this.rightClickedTrack.id);
|
|
|
|
this.player.addTrackToPlayNext(this.rightClickedTrack.id);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
like() {
|
|
|
|
like() {
|
|
|
|
this.likeATrack(this.rightClickedTrack.id);
|
|
|
|
this.likeATrack(this.rightClickedTrack.id);
|
|
|
@ -220,6 +216,11 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
removeTrackFromQueue() {
|
|
|
|
|
|
|
|
this.$store.state.player.removeTrackFromQueue(
|
|
|
|
|
|
|
|
this.rightClickedTrackIndex
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|