From 109098c1eb2d0d9ab524c7116d583b7cf5c1160e Mon Sep 17 00:00:00 2001 From: qier222 <68148142+qier222@users.noreply.github.com> Date: Thu, 29 Oct 2020 21:13:42 +0800 Subject: [PATCH 1/8] feat: add see more mv button in artist page --- src/api/artist.js | 10 ++--- src/components/MvRow.vue | 8 ++-- src/router/index.js | 8 ++++ src/views/artist.vue | 18 +++++++- src/views/artistMV.vue | 96 ++++++++++++++++++++++++++++++++++++++++ src/views/library.vue | 6 +++ 6 files changed, 136 insertions(+), 10 deletions(-) create mode 100644 src/views/artistMV.vue diff --git a/src/api/artist.js b/src/api/artist.js index 023f35d..08428b1 100644 --- a/src/api/artist.js +++ b/src/api/artist.js @@ -61,15 +61,15 @@ export function toplistOfArtists(type = null) { /** * 获取歌手 mv * 说明 : 调用此接口 , 传入歌手 id, 可获得歌手 mv 信息 , 具体 mv 播放地址可调 用/mv传入此接口获得的 mvid 来拿到 , 如 : /artist/mv?id=6452,/mv?mvid=5461064 - * @param {number} id 歌手 id, 可由搜索接口获得 + * @param {number} params.id 歌手 id, 可由搜索接口获得 + * @param {number} params.offset + * @param {number} params.limit */ -export function artistMv(id) { +export function artistMv(params) { return request({ url: "/artist/mv", method: "get", - params: { - id, - }, + params, }); } diff --git a/src/components/MvRow.vue b/src/components/MvRow.vue index 477ca9c..80b6001 100644 --- a/src/components/MvRow.vue +++ b/src/components/MvRow.vue @@ -51,9 +51,11 @@ export default { this.$router.push({ path: "/mv/" + id, query }); }, getUrl(mv) { - if (mv.cover !== undefined) return mv.cover; - if (mv.imgurl16v9 !== undefined) return mv.imgurl16v9; - if (mv.coverUrl !== undefined) return mv.coverUrl; + if (mv.cover !== undefined) return mv.cover.replace(/^http:/, "https:"); + if (mv.imgurl16v9 !== undefined) + return mv.imgurl16v9.replace(/^http:/, "https:"); + if (mv.coverUrl !== undefined) + return mv.coverUrl.replace(/^http:/, "https:"); }, getID(mv) { if (mv.id !== undefined) return mv.id; diff --git a/src/router/index.js b/src/router/index.js index 6355f3e..3825258 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -49,6 +49,14 @@ const routes = [ keepAlive: true, }, }, + { + path: "/artist/:id/mv", + name: "artistMV", + component: () => import("@/views/artistMV.vue"), + meta: { + keepAlive: true, + }, + }, { path: "/mv/:id", name: "mv", diff --git a/src/views/artist.vue b/src/views/artist.vue index f32f03e..3bcb39f 100644 --- a/src/views/artist.vue +++ b/src/views/artist.vue @@ -81,7 +81,12 @@ />
-
MVs
+
MVs + {{ + $t("home.seeMore") + }} +
@@ -163,7 +168,7 @@ export default { this.albumsData = data.hotAlbums; this.latestRelease = data.hotAlbums[0]; }); - artistMv(id).then((data) => { + artistMv({ id }).then((data) => { this.mvs = data.mvs; }); }, @@ -256,6 +261,15 @@ export default { color: var(--color-text); margin-bottom: 16px; margin-top: 46px; + + display: flex; + justify-content: space-between; + align-items: flex-end; + a { + font-size: 13px; + font-weight: 600; + opacity: 0.68; + } } .latest-release { diff --git a/src/views/artistMV.vue b/src/views/artistMV.vue new file mode 100644 index 0000000..e7fcf01 --- /dev/null +++ b/src/views/artistMV.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/views/library.vue b/src/views/library.vue index 30fbfb2..33a391d 100644 --- a/src/views/library.vue +++ b/src/views/library.vue @@ -253,18 +253,24 @@ export default { }); }, loadLikedAlbums() { + NProgress.start(); likedAlbums().then((data) => { this.albums = data.data; + NProgress.done(); }); }, loadLikedArtists() { + NProgress.start(); likedArtists().then((data) => { this.artists = data.data; + NProgress.done(); }); }, loadLikedMVs() { + NProgress.start(); likedMVs().then((data) => { this.mvs = data.data; + NProgress.done(); }); }, }, From fda5f99c1532c77ed6f158e1ced2b0e40ecef5c9 Mon Sep 17 00:00:00 2001 From: qier222 Date: Fri, 30 Oct 2020 14:58:02 +0800 Subject: [PATCH 2/8] fix: bugs --- src/api/user.js | 1 + src/locale/lang/en.js | 2 +- src/locale/lang/zh-CN.js | 2 +- src/views/library.vue | 12 +++--------- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/api/user.js b/src/api/user.js index 34601f0..aeeb719 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -64,6 +64,7 @@ export function dailySignin(type = 0) { method: "post", params: { type, + timestamp: new Date().getTime(), }, }); } diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js index 659d2f2..e11fd2c 100644 --- a/src/locale/lang/en.js +++ b/src/locale/lang/en.js @@ -36,7 +36,7 @@ export default { artist: "Artist", videos: "Music Videos", following: "Following", - follow: "Follow" + follow: "Follow", }, album: { released: "Released", diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index 4839267..b3331a5 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -33,7 +33,7 @@ export default { artist: "歌手", videos: "个MV", following: "已关注", - follow: "关注" + follow: "关注", }, album: { released: "发行于", diff --git a/src/views/library.vue b/src/views/library.vue index 33a391d..e05fc94 100644 --- a/src/views/library.vue +++ b/src/views/library.vue @@ -1,8 +1,8 @@