fix: some bugs

master
qier222 5 years ago
parent ce228e1243
commit 67db925bfe

@ -39,7 +39,7 @@ export default {
return { return {
borderRadius: this.shape === "round" ? "50%" : "8px", borderRadius: this.shape === "round" ? "50%" : "8px",
padding: `8px ${this.horizontalPadding}px`, padding: `8px ${this.horizontalPadding}px`,
height: "38px", // height: "38px",
width: this.shape === "round" ? "38px" : "auto", width: this.shape === "round" ? "38px" : "auto",
}; };
}, },

@ -97,10 +97,17 @@ export default {
return new Date(item.publishTime).getFullYear(); return new Date(item.publishTime).getFullYear();
if (this.subText === "artist") if (this.subText === "artist")
return `<a href="/#/artist/${item.artist.id}">${item.artist.name}</a>`; return `<a href="/#/artist/${item.artist.id}">${item.artist.name}</a>`;
if (this.subText === "albumType+releaseYear") if (this.subText === "albumType+releaseYear") {
return `${item.size === 1 ? "Single" : "EP"} · ${new Date( let albumType = item.type;
item.publishTime if (item.type === "EP/Single") {
).getFullYear()}`; albumType = item.size === 1 ? "Single" : "EP";
} else if (item.type === "Single") {
albumType = "Single";
} else if (item.type === "专辑") {
albumType = "Album";
}
return `${albumType} · ${new Date(item.publishTime).getFullYear()}`;
}
if (this.subText === "appleMusic") return "by Apple Music"; if (this.subText === "appleMusic") return "by Apple Music";
}, },
}, },

@ -56,7 +56,12 @@
</div> </div>
</div> </div>
<div class="more-by" v-if="filteredMoreAlbums.length !== 0"> <div class="more-by" v-if="filteredMoreAlbums.length !== 0">
<div class="section-title"> More by {{ album.artist.name }} </div> <div class="section-title">
More by
<router-link :to="`/artist/${album.artist.id}`"
>{{ album.artist.name }}
</router-link></div
>
<div> <div>
<CoverRow <CoverRow
type="album" type="album"
@ -134,8 +139,15 @@ export default {
filteredMoreAlbums() { filteredMoreAlbums() {
let moreAlbums = this.moreAlbums.filter((a) => a.id !== this.album.id); let moreAlbums = this.moreAlbums.filter((a) => a.id !== this.album.id);
let realAlbums = moreAlbums.filter((a) => a.type === "专辑"); let realAlbums = moreAlbums.filter((a) => a.type === "专辑");
let restItems = moreAlbums.filter((a) => a.type !== "专辑"); let eps = moreAlbums.filter(
return [...realAlbums, ...restItems].slice(0, 5); (a) => a.type === "EP" || (a.type === "EP/Single" && a.size > 1)
);
let restItems = moreAlbums.filter(
(a) =>
realAlbums.find((a1) => a1.id === a.id) === undefined &&
eps.find((a1) => a1.id === a.id) === undefined
);
return [...realAlbums, ...eps, ...restItems].slice(0, 5);
}, },
}, },
methods: { methods: {
@ -161,7 +173,7 @@ export default {
}); });
// get more album by this artist // get more album by this artist
getArtistAlbum({ id: this.album.artist.id, limit: 200 }).then( getArtistAlbum({ id: this.album.artist.id, limit: 100 }).then(
(data) => { (data) => {
this.moreAlbums = data.hotAlbums; this.moreAlbums = data.hotAlbums;
} }

Loading…
Cancel
Save