fix: some bugs

master
qier222 4 years ago
parent 6c9cb56c78
commit 8c17b70f3c
No known key found for this signature in database
GPG Key ID: 9C85007ED905F14D

@ -115,6 +115,7 @@ button {
a { a {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
cursor: pointer;
&:hover { &:hover {
text-decoration: underline; text-decoration: underline;
} }

@ -1,8 +1,9 @@
<template> <template>
<span class="artist-in-line"> <span class="artist-in-line">
<span v-for="(ar, index) in slicedArtists" :key="ar.id"> {{ computedPrefix }}
<span v-for="(ar, index) in filteredArtists" :key="ar.id">
<router-link :to="`/artist/${ar.id}`">{{ ar.name }}</router-link> <router-link :to="`/artist/${ar.id}`">{{ ar.name }}</router-link>
<span v-if="index !== slicedArtists.length - 1">, </span> <span v-if="index !== filteredArtists.length - 1">, </span>
</span> </span>
</span> </span>
</template> </template>
@ -15,16 +16,22 @@ export default {
type: Array, type: Array,
required: true, required: true,
}, },
showFirstArtist: { exclude: {
type: Boolean, type: String,
default: true, default: "",
},
prefix: {
type: String,
default: "",
}, },
}, },
computed: { computed: {
slicedArtists() { filteredArtists() {
return this.showFirstArtist return this.artists.filter((a) => a.name !== this.exclude);
? this.artists },
: this.artists.slice(1, this.artists.length); computedPrefix() {
if (this.filteredArtists.length !== 0) return this.prefix;
else return "";
}, },
}, },
}; };

@ -2,7 +2,7 @@
<div class="track-list" :style="listStyles"> <div class="track-list" :style="listStyles">
<ContextMenu ref="menu"> <ContextMenu ref="menu">
<div class="item-info"> <div class="item-info">
<img :src="rightClickedTrack.al.picUrl | resizeImage(512)" /> <img :src="rightClickedTrack.al.picUrl | resizeImage(128)" />
<div class="info"> <div class="info">
<div class="title">{{ rightClickedTrack.name }}</div> <div class="title">{{ rightClickedTrack.name }}</div>
<div class="subtitle">{{ rightClickedTrack.ar[0].name }}</div> <div class="subtitle">{{ rightClickedTrack.ar[0].name }}</div>
@ -68,6 +68,16 @@ export default {
type: String, type: String,
default: "default", default: "default",
}, },
albumObject: {
type: Object,
default: () => {
return {
artist: {
name: "",
},
};
},
},
}, },
data() { data() {
return { return {

@ -34,9 +34,11 @@
<div class="container"> <div class="container">
<div class="title"> <div class="title">
{{ track.name }} {{ track.name }}
<span class="featured" v-if="isAlbum && track.ar.length > 1"> <span class="featured" v-if="isAlbum">
- <ArtistsInLine
<ArtistsInLine :artists="track.ar" :showFirstArtist="false" :artists="track.ar"
:exclude="this.$parent.albumObject.artist.name"
prefix="-"
/></span> /></span>
<span v-if="isAlbum && track.mark === 1318912" class="explicit-symbol" <span v-if="isAlbum && track.mark === 1318912" class="explicit-symbol"
><ExplicitSymbol ><ExplicitSymbol

@ -19,7 +19,7 @@ export default {
library: { library: {
sLibrary: "'s Library", sLibrary: "'s Library",
likedSongs: "Liked Songs", likedSongs: "Liked Songs",
sLikedSongs: "'s LikedSongs", sLikedSongs: "'s Liked Songs",
}, },
explore: { explore: {
explore: "Explore", explore: "Explore",
@ -91,7 +91,7 @@ export default {
artist: "Artists", artist: "Artists",
album: "Albums", album: "Albums",
song: "Songs", song: "Songs",
mv: "MVs", mv: "Music Videos",
playlist: "Playlists", playlist: "Playlists",
noResult: "No Results", noResult: "No Results",
searchFor: "Search for", searchFor: "Search for",

@ -3,7 +3,7 @@ export default {
nav: { nav: {
home: "首页", home: "首页",
explore: "发现", explore: "发现",
library: "资料库", library: "音乐库",
search: "搜索", search: "搜索",
}, },
home: { home: {
@ -14,7 +14,7 @@ export default {
charts: "排行榜", charts: "排行榜",
}, },
library: { library: {
sLibrary: "的资料库", sLibrary: "的音乐库",
likedSongs: "我喜欢的歌", likedSongs: "我喜欢的歌",
sLikedSongs: "喜欢的歌", sLikedSongs: "喜欢的歌",
}, },

@ -8,9 +8,17 @@
<div class="name">{{ artist.name }}</div> <div class="name">{{ artist.name }}</div>
<div class="artist">{{ $t("artist.artist") }}</div> <div class="artist">{{ $t("artist.artist") }}</div>
<div class="statistics"> <div class="statistics">
{{ artist.musicSize }} {{ $t("common.songs") }} · <a @click="scrollTo('popularTracks')"
{{ artist.albumSize }} {{ $t("artist.withAlbums") }} · >{{ artist.musicSize }} {{ $t("common.songs") }}</a
{{ artist.mvSize }} {{ $t("artist.videos") }} >
·
<a @click="scrollTo('seeMore', 'start')"
>{{ artist.albumSize }} {{ $t("artist.withAlbums") }}</a
>
·
<a @click="scrollTo('mvs')"
>{{ artist.mvSize }} {{ $t("artist.videos") }}</a
>
</div> </div>
<div class="buttons"> <div class="buttons">
<ButtonTwoTone @click.native="playPopularSongs()" :iconClass="`play`"> <ButtonTwoTone @click.native="playPopularSongs()" :iconClass="`play`">
@ -57,21 +65,21 @@
<div></div> <div></div>
</div> </div>
</div> </div>
<div class="popular-tracks"> <div class="popular-tracks" id="popularTracks">
<div class="section-title">{{ $t("artist.popularSongs") }}</div> <div class="section-title">{{ $t("artist.popularSongs") }}</div>
<TrackList <TrackList
:tracks="popularTracks.slice(0, showMorePopTracks ? 24 : 12)" :tracks="popularTracks.slice(0, showMorePopTracks ? 24 : 12)"
:type="'tracklist'" :type="'tracklist'"
/> />
<div class="show-more"> <div class="show-more" id="seeMore">
<button @click="showMorePopTracks = !showMorePopTracks"> <button @click="showMorePopTracks = !showMorePopTracks">
<span v-show="!showMorePopTracks">{{ $t("artist.showMore") }}</span> <span v-show="!showMorePopTracks">{{ $t("artist.showMore") }}</span>
<span v-show="showMorePopTracks">{{ $t("artist.showLess") }}</span> <span v-show="showMorePopTracks">{{ $t("artist.showLess") }}</span>
</button> </button>
</div> </div>
</div> </div>
<div class="albums" v-if="albums.length !== 0"> <div class="albums" id="albums" v-if="albums.length !== 0">
<div class="section-title">{{ $t("artist.albums") }}</div> <div class="section-title">{{ $t("artist.albums") }}</div>
<CoverRow <CoverRow
:type="'album'" :type="'album'"
@ -80,10 +88,10 @@
:showPlayButton="true" :showPlayButton="true"
/> />
</div> </div>
<div class="mvs" v-if="mvs.length !== 0"> <div class="mvs" id="mvs" v-if="mvs.length !== 0">
<div class="section-title" <div class="section-title"
>MVs >MVs
<router-link :to="`/artist/${this.artist.id}/mv`">{{ <router-link v-show="hasMoreMV" :to="`/artist/${this.artist.id}/mv`">{{
$t("home.seeMore") $t("home.seeMore")
}}</router-link> }}</router-link>
</div> </div>
@ -140,6 +148,7 @@ export default {
}, },
showMorePopTracks: false, showMorePopTracks: false,
mvs: [], mvs: [],
hasMoreMV: false,
}; };
}, },
computed: { computed: {
@ -170,6 +179,7 @@ export default {
}); });
artistMv({ id }).then((data) => { artistMv({ id }).then((data) => {
this.mvs = data.mvs; this.mvs = data.mvs;
this.hasMoreMV = data.hasMore;
}); });
}, },
goToAlbum(id) { goToAlbum(id) {
@ -190,6 +200,12 @@ export default {
if (data.code === 200) this.artist.followed = !this.artist.followed; if (data.code === 200) this.artist.followed = !this.artist.followed;
}); });
}, },
scrollTo(div, block = "center") {
document.getElementById(div).scrollIntoView({
behavior: "smooth",
block,
});
},
}, },
created() { created() {
this.loadData(this.$route.params.id); this.loadData(this.$route.params.id);
@ -216,7 +232,7 @@ export default {
.artist-info { .artist-info {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 72px; margin-bottom: 26px;
color: var(--color-text); color: var(--color-text);
img { img {
height: 192px; height: 192px;
@ -260,7 +276,7 @@ export default {
opacity: 0.88; opacity: 0.88;
color: var(--color-text); color: var(--color-text);
margin-bottom: 16px; margin-bottom: 16px;
margin-top: 46px; padding-top: 46px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

@ -121,7 +121,7 @@ export default {
}, },
created() { created() {
if (this.$route.name === "likedSongs") { if (this.$route.name === "likedSongs") {
this.loadData(this.data.user.likedSongPlaylistID); this.loadData(this.data.likedSongPlaylistID);
} else { } else {
this.loadData(this.$route.params.id); this.loadData(this.$route.params.id);
} }

Loading…
Cancel
Save