-
{{ currentTrack.name }}
+
+ {{ currentTrack.name }}
-
- {{ ar.name }}
+
+ {{ ar.name }}
,
@@ -175,7 +174,6 @@ export default {
},
methods: {
...mapMutations([
- "updatePlayerList",
"turnOnShuffleMode",
"turnOffShuffleMode",
"updatePlayerState",
@@ -263,6 +261,20 @@ export default {
}
});
},
+ goToList() {
+ if (this.player.listInfo.id === this.settings.user.likedSongPlaylistID)
+ this.$router.push({ path: "/library/liked-songs" });
+ else
+ this.$router.push({
+ path: "/" + this.player.listInfo.type + "/" + this.player.listInfo.id,
+ });
+ },
+ goToAlbum() {
+ this.$router.push({ path: "/album/" + this.currentTrack.al.id });
+ },
+ goToArtist(id) {
+ this.$router.push({ path: "/artist/" + id });
+ },
},
};
@@ -307,6 +319,7 @@ export default {
height: 46px;
border-radius: 5px;
box-shadow: 0 6px 8px -2px rgba(0, 0, 0, 0.16);
+ cursor: pointer;
}
.track-info {
height: 46px;
@@ -337,7 +350,7 @@ export default {
-webkit-line-clamp: 1;
overflow: hidden;
word-break: break-all;
- a {
+ span {
cursor: pointer;
&:hover {
text-decoration: underline;
diff --git a/src/router/index.js b/src/router/index.js
index 7d3056d..5135fef 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -93,7 +93,7 @@ const routes = [
{
path: "/library/liked-songs",
name: "likedSongs",
- component: () => import("@/views/likedSongs"),
+ component: () => import("@/views/playlist"),
meta: {
requireLogin: true,
},
diff --git a/src/views/likedSongs.vue b/src/views/likedSongs.vue
deleted file mode 100644
index 335576f..0000000
--- a/src/views/likedSongs.vue
+++ /dev/null
@@ -1,235 +0,0 @@
-
-
-
- {{
- settings.user.nickname
- }}'s Liked Songs
-
-
-
-
-
-
-
-
-
diff --git a/src/views/playlist.vue b/src/views/playlist.vue
index 2e4b851..1c72214 100644
--- a/src/views/playlist.vue
+++ b/src/views/playlist.vue
@@ -1,6 +1,6 @@
-
+
+
+
+ {{
+ settings.user.nickname
+ }}'s Liked Songs
+
+
+
@@ -114,7 +122,11 @@ export default {
};
},
created() {
- this.loadData(this.$route.params.id);
+ if (this.$route.name === "likedSongs") {
+ this.loadData(this.settings.user.likedSongPlaylistID);
+ } else {
+ this.loadData(this.$route.params.id);
+ }
},
destroyed() {
window.removeEventListener("scroll", this.handleScroll, true);
@@ -124,13 +136,12 @@ export default {
isLoggedIn() {
return isLoggedIn();
},
+ isLikeSongsPage() {
+ return this.$route.name === "likedSongs";
+ },
},
methods: {
- ...mapMutations([
- "updatePlayerList",
- "appendTrackToPlayerList",
- "shuffleTheList",
- ]),
+ ...mapMutations(["appendTrackToPlayerList"]),
...mapActions(["playFirstTrackOnList", "playTrackOnListByID"]),
playPlaylistByID(trackID = "first") {
let trackIDs = this.playlist.trackIds.map((t) => t.id);
@@ -291,6 +302,19 @@ export default {
}
}
+.user-info {
+ h1 {
+ font-size: 42px;
+ .avatar {
+ height: 44px;
+ margin-right: 12px;
+ vertical-align: -7px;
+ border-radius: 50%;
+ border: rgba(0, 0, 0, 0.2);
+ }
+ }
+}
+
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s;