feat: 增加心动模式/智能播放 (#323) (#1206)

This commit is contained in:
Rick 2022-01-09 18:33:42 +08:00 committed by GitHub
parent b501214c02
commit a87686098c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 2 deletions

View file

@ -24,7 +24,7 @@
{{ liked.songs.length }} {{ $t('common.songs') }}
</div>
</div>
<button @click.stop="playLikedSongs">
<button @click.stop="openPlayModeTabMenu">
<svg-icon icon-class="play" />
</button>
</div>
@ -186,6 +186,14 @@
$t('contextMenu.likedPlaylists')
}}</div>
</ContextMenu>
<ContextMenu ref="playModeTabMenu">
<div class="item" @click="playLikedSongs">{{
$t('library.likedSongs')
}}</div>
<hr />
<div class="item" @click="playIntelligenceList"> 心动模式 </div>
</ContextMenu>
</div>
</template>
@ -318,6 +326,13 @@ export default {
true
);
},
playIntelligenceList() {
this.$store.state.player.playIntelligenceListById(
this.liked.playlists[0].id,
'first',
true
);
},
updateCurrentTab(tab) {
if (!isAccountLoggedIn() && tab !== 'playlists') {
this.showToast(locale.t('toast.needToLogin'));
@ -358,6 +373,9 @@ export default {
openPlaylistTabMenu(e) {
this.$refs.playlistTabMenu.openMenu(e);
},
openPlayModeTabMenu(e) {
this.$refs.playModeTabMenu.openMenu(e);
},
changePlaylistFilter(type) {
this.updateData({ key: 'libraryPlaylistFilter', value: type });
window.scrollTo({ top: 375, behavior: 'smooth' });