mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
Merge branch 'master' of github.com:qier222/YesPlayMusic
This commit is contained in:
commit
bd0a99c46d
13 changed files with 108 additions and 62 deletions
|
|
@ -1,12 +1,16 @@
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
import { mapTrackPlayableStatus } from "@/utils/common";
|
||||||
|
|
||||||
export function getArtist(id) {
|
export function getArtist(id) {
|
||||||
return request({
|
return request({
|
||||||
url: "/artists",
|
url: "/artists",
|
||||||
method: "get",
|
method: "get",
|
||||||
params: {
|
params: {
|
||||||
id,
|
id
|
||||||
},
|
}
|
||||||
|
}).then(data => {
|
||||||
|
data.hotSongs = mapTrackPlayableStatus(data.hotSongs);
|
||||||
|
return data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -17,7 +21,7 @@ export function getArtistAlbum(params) {
|
||||||
return request({
|
return request({
|
||||||
url: "/artist/album",
|
url: "/artist/album",
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,8 +35,8 @@ export function toplistOfArtists(type = null) {
|
||||||
url: "/toplist/artist",
|
url: "/toplist/artist",
|
||||||
method: "get",
|
method: "get",
|
||||||
params: {
|
params: {
|
||||||
type,
|
type
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,7 +45,7 @@ export function artistMv(id) {
|
||||||
url: "/artist/mv",
|
url: "/artist/mv",
|
||||||
method: "get",
|
method: "get",
|
||||||
params: {
|
params: {
|
||||||
id,
|
id
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
import { mapTrackPlayableStatus } from "@/utils/common";
|
||||||
|
|
||||||
export function recommendPlaylist(params) {
|
export function recommendPlaylist(params) {
|
||||||
// limit: 取出数量 , 默认为 30
|
// limit: 取出数量 , 默认为 30
|
||||||
return request({
|
return request({
|
||||||
url: "/personalized",
|
url: "/personalized",
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
export function dailyRecommendPlaylist(params) {
|
export function dailyRecommendPlaylist(params) {
|
||||||
|
|
@ -13,7 +14,7 @@ export function dailyRecommendPlaylist(params) {
|
||||||
return request({
|
return request({
|
||||||
url: "/recommend/resource",
|
url: "/recommend/resource",
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23,7 +24,10 @@ export function getPlaylistDetail(id, noCache = false) {
|
||||||
return request({
|
return request({
|
||||||
url: "/playlist/detail",
|
url: "/playlist/detail",
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
|
}).then(data => {
|
||||||
|
data.playlist.tracks = mapTrackPlayableStatus(data.playlist.tracks);
|
||||||
|
return data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,7 +38,7 @@ export function highQualityPlaylist(params) {
|
||||||
return request({
|
return request({
|
||||||
url: "/top/playlist/highquality",
|
url: "/top/playlist/highquality",
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,21 +50,21 @@ export function topPlaylist(params) {
|
||||||
return request({
|
return request({
|
||||||
url: "/top/playlist",
|
url: "/top/playlist",
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function playlistCatlist() {
|
export function playlistCatlist() {
|
||||||
return request({
|
return request({
|
||||||
url: "/playlist/catlist",
|
url: "/playlist/catlist",
|
||||||
method: "get",
|
method: "get"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toplists() {
|
export function toplists() {
|
||||||
return request({
|
return request({
|
||||||
url: "/toplist",
|
url: "/toplist",
|
||||||
method: "get",
|
method: "get"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,6 +74,6 @@ export function subscribePlaylist(params) {
|
||||||
return request({
|
return request({
|
||||||
url: "/playlist/subscribe",
|
url: "/playlist/subscribe",
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ export default {
|
||||||
else this.$router.go(1);
|
else this.$router.go(1);
|
||||||
},
|
},
|
||||||
goToSearchPage() {
|
goToSearchPage() {
|
||||||
|
if(!this.keywords) return;
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: "search",
|
name: "search",
|
||||||
query: { keywords: this.keywords },
|
query: { keywords: this.keywords },
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,12 @@
|
||||||
<ContextMenu ref="menu">
|
<ContextMenu ref="menu">
|
||||||
<div class="item" @click="play">Play</div>
|
<div class="item" @click="play">Play</div>
|
||||||
<div class="item" @click="playNext">Play Next</div>
|
<div class="item" @click="playNext">Play Next</div>
|
||||||
|
<div class="item" @click="like" v-show="!isRightClickedTrackLiked">
|
||||||
|
Save to my Liked Songs
|
||||||
|
</div>
|
||||||
|
<div class="item" @click="like" v-show="isRightClickedTrackLiked">
|
||||||
|
Remove from my Liked Songs
|
||||||
|
</div>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
<TrackListItem
|
<TrackListItem
|
||||||
v-for="track in tracks"
|
v-for="track in tracks"
|
||||||
|
|
@ -15,12 +21,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions, mapState } from "vuex";
|
import { mapActions, mapMutations, mapState } from "vuex";
|
||||||
|
import { likeATrack } from "@/api/track";
|
||||||
import {
|
import {
|
||||||
playPlaylistByID,
|
playPlaylistByID,
|
||||||
playAlbumByID,
|
playAlbumByID,
|
||||||
playAList,
|
playAList,
|
||||||
appendTrackToPlayerList,
|
appendTrackToPlayerList
|
||||||
} from "@/utils/play";
|
} from "@/utils/play";
|
||||||
|
|
||||||
import TrackListItem from "@/components/TrackListItem.vue";
|
import TrackListItem from "@/components/TrackListItem.vue";
|
||||||
|
|
@ -30,7 +37,7 @@ export default {
|
||||||
name: "TrackList",
|
name: "TrackList",
|
||||||
components: {
|
components: {
|
||||||
TrackListItem,
|
TrackListItem,
|
||||||
ContextMenu,
|
ContextMenu
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
tracks: Array,
|
tracks: Array,
|
||||||
|
|
@ -38,17 +45,17 @@ export default {
|
||||||
id: Number,
|
id: Number,
|
||||||
itemWidth: {
|
itemWidth: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: -1,
|
default: -1
|
||||||
},
|
},
|
||||||
dbclickTrackFunc: {
|
dbclickTrackFunc: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "default",
|
default: "default"
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
clickTrack: null,
|
rightClickedTrack: null,
|
||||||
listStyles: {},
|
listStyles: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -57,14 +64,18 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["liked"]),
|
...mapState(["liked"]),
|
||||||
|
isRightClickedTrackLiked() {
|
||||||
|
return this.liked.songs.includes(this.rightClickedTrack?.id);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapMutations(["updateLikedSongs"]),
|
||||||
...mapActions(["nextTrack", "playTrackOnListByID"]),
|
...mapActions(["nextTrack", "playTrackOnListByID"]),
|
||||||
openMenu(e, track) {
|
openMenu(e, track) {
|
||||||
if (!track.playable) {
|
if (!track.playable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.clickTrack = track;
|
this.rightClickedTrack = track;
|
||||||
this.$refs.menu.openMenu(e);
|
this.$refs.menu.openMenu(e);
|
||||||
},
|
},
|
||||||
playThisList(trackID) {
|
playThisList(trackID) {
|
||||||
|
|
@ -84,7 +95,7 @@ export default {
|
||||||
} else if (this.type === "album") {
|
} else if (this.type === "album") {
|
||||||
playAlbumByID(this.id, trackID);
|
playAlbumByID(this.id, trackID);
|
||||||
} else if (this.type === "tracklist") {
|
} else if (this.type === "tracklist") {
|
||||||
let trackIDs = this.tracks.map((t) => t.id);
|
let trackIDs = this.tracks.map(t => t.id);
|
||||||
playAList(trackIDs, this.tracks[0].ar[0].id, "artist", trackID);
|
playAList(trackIDs, this.tracks[0].ar[0].id, "artist", trackID);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -94,7 +105,24 @@ export default {
|
||||||
playNext() {
|
playNext() {
|
||||||
appendTrackToPlayerList(this.clickTrack.id);
|
appendTrackToPlayerList(this.clickTrack.id);
|
||||||
},
|
},
|
||||||
},
|
like() {
|
||||||
|
this.likeASong(this.rightClickedTrack.id);
|
||||||
|
},
|
||||||
|
likeASong(id) {
|
||||||
|
let like = true;
|
||||||
|
let likedSongs = this.liked.songs;
|
||||||
|
if (likedSongs.includes(id)) like = false;
|
||||||
|
likeATrack({ id, like }).then(data => {
|
||||||
|
if (data.code !== 200) return;
|
||||||
|
if (like === false) {
|
||||||
|
this.updateLikedSongs(likedSongs.filter(d => d !== id));
|
||||||
|
} else {
|
||||||
|
likedSongs.push(id);
|
||||||
|
this.updateLikedSongs(likedSongs);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
class="track"
|
class="track"
|
||||||
:class="trackClass"
|
:class="trackClass"
|
||||||
:style="trackStyle"
|
:style="trackStyle"
|
||||||
|
:title="track.reason"
|
||||||
@mouseover="focus = true"
|
@mouseover="focus = true"
|
||||||
@mouseleave="focus = false"
|
@mouseleave="focus = false"
|
||||||
>
|
>
|
||||||
|
|
@ -15,7 +16,7 @@
|
||||||
>
|
>
|
||||||
<svg-icon icon-class="play"></svg-icon>
|
<svg-icon icon-class="play"></svg-icon>
|
||||||
</button>
|
</button>
|
||||||
<span v-show="!focus">{{ track.no }}</span>
|
<span v-show="!focus || !track.playable">{{ track.no }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="title-and-artist">
|
<div class="title-and-artist">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
@ -66,7 +67,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { isLoggedIn } from "@/utils/auth";
|
import { isLoggedIn } from "@/utils/auth";
|
||||||
import { likeATrack } from "@/api/track";
|
|
||||||
|
|
||||||
import ArtistsInLine from "@/components/ArtistsInLine.vue";
|
import ArtistsInLine from "@/components/ArtistsInLine.vue";
|
||||||
import ExplicitSymbol from "@/components/ExplicitSymbol.vue";
|
import ExplicitSymbol from "@/components/ExplicitSymbol.vue";
|
||||||
|
|
@ -127,21 +127,7 @@ export default {
|
||||||
this.$parent.playThisList(this.track.id);
|
this.$parent.playThisList(this.track.id);
|
||||||
},
|
},
|
||||||
likeThisSong() {
|
likeThisSong() {
|
||||||
let id = this.track.id;
|
this.$parent.likeASong(this.track.id);
|
||||||
let like = true;
|
|
||||||
let likedSongs = this.$parent.liked.songs;
|
|
||||||
if (likedSongs.includes(id)) like = false;
|
|
||||||
likeATrack({ id, like }).then(() => {
|
|
||||||
if (like === false) {
|
|
||||||
this.$store.commit(
|
|
||||||
"updateLikedSongs",
|
|
||||||
likedSongs.filter(d => d !== id)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
likedSongs.push(id);
|
|
||||||
this.$store.commit("updateLikedSongs", likedSongs);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
|
||||||
|
|
@ -78,5 +78,16 @@ export default {
|
||||||
pause: "Pause",
|
pause: "Pause",
|
||||||
mute: "Mute",
|
mute: "Mute",
|
||||||
nextUp: "Next Up"
|
nextUp: "Next Up"
|
||||||
|
},
|
||||||
|
modal: {
|
||||||
|
close: "Close"
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
artist: "Artists",
|
||||||
|
album: "Albums",
|
||||||
|
song: "Songs",
|
||||||
|
mv: "MVs",
|
||||||
|
playlist: "Playlists",
|
||||||
|
noResult: "No Results"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -83,5 +83,16 @@ export default {
|
||||||
pause: "暂停",
|
pause: "暂停",
|
||||||
mute: "静音",
|
mute: "静音",
|
||||||
nextUp: "播放列表"
|
nextUp: "播放列表"
|
||||||
|
},
|
||||||
|
modal: {
|
||||||
|
close: "关闭"
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
artist: "歌手",
|
||||||
|
album: "专辑",
|
||||||
|
song: "歌曲",
|
||||||
|
mv: "视频",
|
||||||
|
playlist: "歌单",
|
||||||
|
noResult: "暂无结果"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export default {
|
||||||
|
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
getMP3(track.id).then(data => {
|
getMP3(track.id).then(data => {
|
||||||
commitMP3(data.data[0].url);
|
commitMP3(data.data[0].url.replace(/^http:/, "https:"));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
commitMP3(`https://music.163.com/song/media/outer/url?id=${track.id}`);
|
commitMP3(`https://music.163.com/song/media/outer/url?id=${track.id}`);
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,9 @@
|
||||||
>
|
>
|
||||||
<div class="description-full" @click.stop>
|
<div class="description-full" @click.stop>
|
||||||
<span>{{ album.description }}</span>
|
<span>{{ album.description }}</span>
|
||||||
<span class="close" @click="showFullDescription = false">Close</span>
|
<span class="close" @click="showFullDescription = false">
|
||||||
|
{{ $t('modal.close') }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { mapMutations, mapActions, mapState } from "vuex";
|
import { mapMutations, mapActions, mapState } from "vuex";
|
||||||
import { getArtist, getArtistAlbum, artistMv } from "@/api/artist";
|
import { getArtist, getArtistAlbum, artistMv } from "@/api/artist";
|
||||||
import { mapTrackPlayableStatus } from "@/utils/common";
|
|
||||||
import { playAList } from "@/utils/play";
|
import { playAList } from "@/utils/play";
|
||||||
import NProgress from "nprogress";
|
import NProgress from "nprogress";
|
||||||
|
|
||||||
|
|
@ -146,7 +145,6 @@ export default {
|
||||||
getArtist(id).then(data => {
|
getArtist(id).then(data => {
|
||||||
this.artist = data.artist;
|
this.artist = data.artist;
|
||||||
this.popularTracks = data.hotSongs;
|
this.popularTracks = data.hotSongs;
|
||||||
this.popularTracks = mapTrackPlayableStatus(this.popularTracks);
|
|
||||||
if (next !== undefined) next();
|
if (next !== undefined) next();
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
this.show = true;
|
this.show = true;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
import { mapState } from "vuex";
|
import { mapState } from "vuex";
|
||||||
import { getTrackDetail, getLyric } from "@/api/track";
|
import { getTrackDetail, getLyric } from "@/api/track";
|
||||||
import { userDetail, userPlaylist } from "@/api/user";
|
import { userDetail, userPlaylist } from "@/api/user";
|
||||||
import { mapTrackPlayableStatus, randomNum } from "@/utils/common";
|
import { randomNum } from "@/utils/common";
|
||||||
import { getPlaylistDetail } from "@/api/playlist";
|
import { getPlaylistDetail } from "@/api/playlist";
|
||||||
import { playPlaylistByID } from "@/utils/play";
|
import { playPlaylistByID } from "@/utils/play";
|
||||||
import NProgress from "nprogress";
|
import NProgress from "nprogress";
|
||||||
|
|
@ -149,17 +149,16 @@ export default {
|
||||||
this.playlists.push(...data.playlist);
|
this.playlists.push(...data.playlist);
|
||||||
}
|
}
|
||||||
this.hasMorePlaylists = data.more;
|
this.hasMorePlaylists = data.more;
|
||||||
this.likedSongsPlaylist = this.playlists[0];
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getLikedSongs(getLyric = true) {
|
getLikedSongs(getLyric = true) {
|
||||||
getPlaylistDetail(this.settings.user.likedSongPlaylistID, true).then(
|
getPlaylistDetail(this.settings.user.likedSongPlaylistID, true).then(
|
||||||
data => {
|
data => {
|
||||||
|
this.likedSongsPlaylist = data.playlist;
|
||||||
let TrackIDs = data.playlist.trackIds.slice(0, 20).map(t => t.id);
|
let TrackIDs = data.playlist.trackIds.slice(0, 20).map(t => t.id);
|
||||||
this.likedSongIDs = TrackIDs;
|
this.likedSongIDs = TrackIDs;
|
||||||
getTrackDetail(this.likedSongIDs.join(",")).then(data => {
|
getTrackDetail(this.likedSongIDs.join(",")).then(data => {
|
||||||
this.likedSongs = data.songs;
|
this.likedSongs = data.songs;
|
||||||
this.likedSongs = mapTrackPlayableStatus(this.likedSongs);
|
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
this.show = true;
|
this.show = true;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,9 @@
|
||||||
>
|
>
|
||||||
<div class="description-full" @click.stop>
|
<div class="description-full" @click.stop>
|
||||||
<span>{{ playlist.description }}</span>
|
<span>{{ playlist.description }}</span>
|
||||||
<span class="close" @click="showFullDescription = false">Close</span>
|
<span class="close" @click="showFullDescription = false">
|
||||||
|
{{ $t('modal.close') }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
@ -92,7 +94,6 @@ import NProgress from "nprogress";
|
||||||
import { getPlaylistDetail, subscribePlaylist } from "@/api/playlist";
|
import { getPlaylistDetail, subscribePlaylist } from "@/api/playlist";
|
||||||
import { playAList } from "@/utils/play";
|
import { playAList } from "@/utils/play";
|
||||||
import { getTrackDetail } from "@/api/track";
|
import { getTrackDetail } from "@/api/track";
|
||||||
import { mapTrackPlayableStatus } from "@/utils/common";
|
|
||||||
import { isLoggedIn } from "@/utils/auth";
|
import { isLoggedIn } from "@/utils/auth";
|
||||||
|
|
||||||
import ButtonTwoTone from "@/components/ButtonTwoTone.vue";
|
import ButtonTwoTone from "@/components/ButtonTwoTone.vue";
|
||||||
|
|
@ -166,7 +167,6 @@ export default {
|
||||||
.then(data => {
|
.then(data => {
|
||||||
this.playlist = data.playlist;
|
this.playlist = data.playlist;
|
||||||
this.tracks = data.playlist.tracks;
|
this.tracks = data.playlist.tracks;
|
||||||
this.tracks = mapTrackPlayableStatus(this.tracks);
|
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
if (next !== undefined) next();
|
if (next !== undefined) next();
|
||||||
this.show = true;
|
this.show = true;
|
||||||
|
|
@ -194,7 +194,6 @@ export default {
|
||||||
trackIDs = trackIDs.map(t => t.id);
|
trackIDs = trackIDs.map(t => t.id);
|
||||||
getTrackDetail(trackIDs.join(",")).then(data => {
|
getTrackDetail(trackIDs.join(",")).then(data => {
|
||||||
this.tracks.push(...data.songs);
|
this.tracks.push(...data.songs);
|
||||||
this.tracks = mapTrackPlayableStatus(this.tracks);
|
|
||||||
this.lastLoadedTrackIndex += trackIDs.length;
|
this.lastLoadedTrackIndex += trackIDs.length;
|
||||||
this.loadingMore = false;
|
this.loadingMore = false;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="search" v-show="show">
|
<div class="search" v-show="show">
|
||||||
<h1><span>Search for</span> "{{ keywords }}"</h1>
|
<h1><span>Search for</span> "{{ keywords }}"</h1>
|
||||||
<div class="result" v-if="result !== undefined">
|
<div class="result" v-if="isExistResult">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="artists" v-if="result.hasOwnProperty('artist')">
|
<div class="artists" v-if="result.hasOwnProperty('artist')">
|
||||||
<div class="section-title">Artists</div>
|
<div class="section-title">{{ $t("search.artist") }}</div>
|
||||||
<div class="artists-list">
|
<div class="artists-list">
|
||||||
<div
|
<div
|
||||||
class="artist"
|
class="artist"
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="albums" v-if="result.hasOwnProperty('album')">
|
<div class="albums" v-if="result.hasOwnProperty('album')">
|
||||||
<div class="section-title">Albums</div>
|
<div class="section-title">{{ $t("search.album") }}</div>
|
||||||
<div class="albums-list">
|
<div class="albums-list">
|
||||||
<div
|
<div
|
||||||
class="album"
|
class="album"
|
||||||
|
|
@ -69,17 +69,17 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tracks" v-if="result.hasOwnProperty('song')">
|
<div class="tracks" v-if="result.hasOwnProperty('song')">
|
||||||
<div class="section-title">Songs</div>
|
<div class="section-title">{{ $t("search.song") }}</div>
|
||||||
<TrackList :tracks="tracks" :type="'tracklist'" />
|
<TrackList :tracks="tracks" :type="'tracklist'" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mvs" v-if="mvs !== null && mvs.length > 0">
|
<div class="mvs" v-if="mvs !== null && mvs.length > 0">
|
||||||
<div class="section-title">MVs</div>
|
<div class="section-title">{{ $t("search.mv") }}</div>
|
||||||
<MvRow class="mv-row" :mvs="mvs.slice(0, 5)" />
|
<MvRow class="mv-row" :mvs="mvs.slice(0, 5)" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="playlists" v-if="result.hasOwnProperty('playList')">
|
<div class="playlists" v-if="result.hasOwnProperty('playList')">
|
||||||
<div class="section-title">{{ $t("playlist.playlist") }}</div>
|
<div class="section-title">{{ $t("search.playlist") }}</div>
|
||||||
<div class="albums-list">
|
<div class="albums-list">
|
||||||
<div
|
<div
|
||||||
class="album"
|
class="album"
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="no-results" v-else>
|
<div class="no-results" v-else>
|
||||||
No Results
|
{{ $t("search.noResult") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -150,7 +150,10 @@ export default {
|
||||||
tracks() {
|
tracks() {
|
||||||
let tracks = this.result.song.songs.slice(0, 12);
|
let tracks = this.result.song.songs.slice(0, 12);
|
||||||
return tracks;
|
return tracks;
|
||||||
}
|
},
|
||||||
|
isExistResult() {
|
||||||
|
return Object.keys(this.result).length;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goToAlbum(id) {
|
goToAlbum(id) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue