feat: prettier task supported (#40)

* feat: add config to resolve path alias.

* feat: use vue-i18n for language switch

* feat: add .editorconfig for ide

* fix: add no-referrer to avoid CROB

* fix: setCookie and fix typo

* feat: integrate vue-i18n

* feat: player component i18n support

* fix: duplicate key warning in explore page

* fix: like songs number changed in library page

* fire: remove todo

* fix: same text search on enter will cause error

* fix: scrobble error params type

* feat: prettier task supported

* fix: prettier ignore config update

* fix: conflict
This commit is contained in:
Hawtim Zhang 2020-10-22 21:44:34 +08:00 committed by GitHub
parent 56fe497db9
commit c042faa001
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 1755 additions and 1445 deletions

View file

@ -13,31 +13,29 @@
<div class="artist">
Playlist by
<span
style="font-weight:600"
style="font-weight: 600"
v-if="
[
5277771961,
5277965913,
5277969451,
5277778542,
5278068783
5278068783,
].includes(playlist.id)
"
>Apple Music</span
>
<a
v-else
:href="
`https://music.163.com/#/user/home?id=${playlist.creator.userId}`
"
:href="`https://music.163.com/#/user/home?id=${playlist.creator.userId}`"
target="blank"
>{{ playlist.creator.nickname }}</a
>
</div>
<div class="date-and-count">
{{ $t("playlist.updatedAt") }}
{{ playlist.updateTime | formatDate }} ·
{{ playlist.trackCount }} {{ $t("common.songs") }}
{{ playlist.updateTime | formatDate }} · {{ playlist.trackCount }}
{{ $t("common.songs") }}
</div>
<div class="description" @click="showFullDescription = true">
{{ playlist.description }}
@ -80,7 +78,7 @@
<div class="description-full" @click.stop>
<span>{{ playlist.description }}</span>
<span class="close" @click="showFullDescription = false">
{{ $t('modal.close') }}
{{ $t("modal.close") }}
</span>
</div>
</div>
@ -105,7 +103,7 @@ export default {
components: {
Cover,
ButtonTwoTone,
TrackList
TrackList,
},
data() {
return {
@ -113,14 +111,14 @@ export default {
playlist: {
coverImgUrl: "",
creator: {
userId: ""
userId: "",
},
trackIds: []
trackIds: [],
},
showFullDescription: false,
tracks: [],
loadingMore: false,
lastLoadedTrackIndex: 9
lastLoadedTrackIndex: 9,
};
},
created() {
@ -140,23 +138,23 @@ export default {
},
isLikeSongsPage() {
return this.$route.name === "likedSongs";
}
},
},
methods: {
...mapMutations(["appendTrackToPlayerList"]),
...mapActions(["playFirstTrackOnList", "playTrackOnListByID"]),
playPlaylistByID(trackID = "first") {
let trackIDs = this.playlist.trackIds.map(t => t.id);
let trackIDs = this.playlist.trackIds.map((t) => t.id);
playAList(trackIDs, this.playlist.id, "playlist", trackID);
},
likePlaylist() {
subscribePlaylist({
id: this.playlist.id,
t: this.playlist.subscribed ? 2 : 1
}).then(data => {
t: this.playlist.subscribed ? 2 : 1,
}).then((data) => {
if (data.code === 200)
this.playlist.subscribed = !this.playlist.subscribed;
getPlaylistDetail(this.id, true).then(data => {
getPlaylistDetail(this.id, true).then((data) => {
this.playlist = data.playlist;
});
});
@ -164,7 +162,7 @@ export default {
loadData(id, next = undefined) {
this.id = id;
getPlaylistDetail(this.id, true)
.then(data => {
.then((data) => {
this.playlist = data.playlist;
this.tracks = data.playlist.tracks;
NProgress.done();
@ -191,8 +189,8 @@ export default {
)
return t;
});
trackIDs = trackIDs.map(t => t.id);
getTrackDetail(trackIDs.join(",")).then(data => {
trackIDs = trackIDs.map((t) => t.id);
getTrackDetail(trackIDs.join(",")).then((data) => {
this.tracks.push(...data.songs);
this.lastLoadedTrackIndex += trackIDs.length;
this.loadingMore = false;
@ -213,8 +211,8 @@ export default {
this.loadingMore = true;
this.loadMore();
}
}
}
},
},
};
</script>