diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index ecdea80..d2b33bd 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -1,4 +1,9 @@ export default { + server: { + netease: '网易云音乐', + tencent: 'QQ音乐', + kugou: '酷狗音乐', + }, common: { play: '播放', songs: '首歌', diff --git a/src/views/album.vue b/src/views/album.vue index ae9dee1..dc6d264 100644 --- a/src/views/album.vue +++ b/src/views/album.vue @@ -60,6 +60,7 @@ > { + console.log(data); + let playlist = data.playlist; + let tracks = playlist.tracks.filter(_track => { + return _track.playable == 1; + }); + this.$store.state.player.replacePlaylist( + tracks, + tracks[0], + 'artist', + tracks[0] + ); + }); + }, likeAlbum(toast = false) { if (!isAccountLoggedIn()) { this.showToast(locale.t('toast.needToLogin')); diff --git a/src/views/coSearch.vue b/src/views/coSearch.vue index d2b7dbe..1fb10f9 100644 --- a/src/views/coSearch.vue +++ b/src/views/coSearch.vue @@ -4,9 +4,16 @@ 搜索 @@ -81,6 +88,9 @@ export default { type() { return camelCase(this.$route.query.type || 'tracks'); }, + server() { + return camelCase(this.$route.query.server || 'tencent'); + }, typeNameTable() { return { musicVideos: locale.t('search.mv'), @@ -90,6 +100,13 @@ export default { playlists: locale.t('search.playlist'), }; }, + serverNameTable() { + return { + netease: locale.t('server.netease'), + tencent: locale.t('server.tencent'), + kugou: locale.t('server.kugou'), + }; + }, }, watch: { $route: { @@ -112,8 +129,13 @@ export default { this.player.replacePlaylist(tracks, tracks[0], 'artist', tracks[0]); }); }, - tranSearchType(type) { - this.$router.replace({ query: { ...this.$route.query, type } }); + tranSearchType(type, server) { + if (type) { + this.$router.replace({ query: { ...this.$route.query, type } }); + } + if (server) { + this.$router.replace({ query: { ...this.$route.query, server } }); + } }, playTrack(id) { this.player._replaceCurrentTrackByTrack(id, true); @@ -231,11 +253,12 @@ export default { } } .dropdown-content { + pointer-events: none; font-size: 1em; opacity: 0; transition: 0.5s; position: absolute; - background-color: #ffffff; + background-color: var(--color-body-bg); width: 100%; padding: 8px; right: 0; @@ -262,7 +285,11 @@ export default { } .dropdown:hover, .dropdown:focus { + .dropdown-content:hover { + pointer-events: auto; + } .dropdown-content { + pointer-events: auto; opacity: 1; transition: 0.5s; } @@ -281,7 +308,7 @@ button { color: var(--color-primary); } &:hover { - transform: scale(1.12); + transform: scale(1.08); } &:active { transform: scale(0.96); diff --git a/src/views/playlist.vue b/src/views/playlist.vue index f394dd7..6882a5d 100644 --- a/src/views/playlist.vue +++ b/src/views/playlist.vue @@ -68,6 +68,7 @@ > t.id); this.$store.state.player.replacePlaylist( trackIDs, @@ -428,6 +433,22 @@ export default { trackID ); }, + playThisListByTrack(id) { + this.showToast('正在进行其他平台播放'); + getPlaylistDetail(id, true, this.$route.query.server).then(data => { + console.log(data); + let playlist = data.playlist; + let tracks = playlist.tracks.filter(_track => { + return _track.playable == 1; + }); + this.$store.state.player.replacePlaylist( + tracks, + tracks[0], + 'artist', + tracks[0] + ); + }); + }, likePlaylist(toast = false) { if (!isAccountLoggedIn()) { this.showToast(locale.t('toast.needToLogin'));