-
{{ $t('artist.latestRelease') }}
+
{{ $t("artist.latestRelease") }}
-
{{ $t('artist.popularSongs') }}
+
{{ $t("artist.popularSongs") }}
-
{{ $t('artist.album') }}
+
{{ $t("artist.albums") }}
-
{{ $t('artist.EPSingle') }}
+
{{ $t("artist.EPsSingles") }}
a.type === "专辑");
+ return this.albumsData.filter(a => a.type === "专辑");
},
eps() {
- return this.albumsData.filter((a) =>
+ return this.albumsData.filter(a =>
["EP/Single", "EP", "Single"].includes(a.type)
);
- },
+ }
},
methods: {
...mapMutations(["appendTrackToPlayerList"]),
...mapActions(["playFirstTrackOnList", "playTrackOnListByID"]),
loadData(id, next = undefined) {
- getArtist(id).then((data) => {
+ getArtist(id).then(data => {
this.artist = data.artist;
this.popularTracks = data.hotSongs;
this.popularTracks = mapTrackPlayableStatus(this.popularTracks);
@@ -151,24 +151,24 @@ export default {
NProgress.done();
this.show = true;
});
- getArtistAlbum({ id: id, limit: 200 }).then((data) => {
+ getArtistAlbum({ id: id, limit: 200 }).then(data => {
this.albumsData = data.hotAlbums;
this.latestRelease = data.hotAlbums[0];
});
- artistMv(id).then((data) => {
+ artistMv(id).then(data => {
this.mvs = data.mvs;
});
},
goToAlbum(id) {
this.$router.push({
name: "album",
- params: { id },
+ params: { id }
});
},
playPopularSongs(trackID = "first") {
- let trackIDs = this.popularTracks.map((t) => t.id);
+ let trackIDs = this.popularTracks.map(t => t.id);
playAList(trackIDs, this.artist.id, "artist", trackID);
- },
+ }
},
created() {
this.loadData(this.$route.params.id);
@@ -187,7 +187,7 @@ export default {
this.artist.img1v1Url =
"https://p1.music.126.net/VnZiScyynLG7atLIZ2YPkw==/18686200114669622.jpg";
this.loadData(to.params.id, next);
- },
+ }
};
diff --git a/src/views/loginAccount.vue b/src/views/loginAccount.vue
index b6cc11a..8e1aead 100644
--- a/src/views/loginAccount.vue
+++ b/src/views/loginAccount.vue
@@ -11,7 +11,9 @@
-
+
-
+
@@ -100,7 +102,7 @@ export default {
email: "",
password: "",
smsCode: "",
- inputFocus: "",
+ inputFocus: ""
};
},
created() {
@@ -116,11 +118,11 @@ export default {
Cookies.set("loginMode", "account", { expires: 3650 });
userPlaylist({
uid: this.$store.state.settings.user.userId,
- limit: 1,
- }).then((data) => {
+ limit: 1
+ }).then(data => {
this.updateUserInfo({
key: "likedSongPlaylistID",
- value: data.playlist[0].id,
+ value: data.playlist[0].id
});
this.$router.push({ path: "/library" });
});
@@ -133,44 +135,55 @@ export default {
this.phone === "" ||
this.password === ""
) {
- alert("请输入完整的信息");
+ alert("国家区号、手机或密码不正确");
this.processing = false;
return;
}
loginWithPhone({
- countrycode: this.countryCode.replace("+", "").replace(/\s/g, ''),
- phone: this.phoneNumber.replace(/\s/g, ''),
+ countrycode: this.countryCode.replace("+", "").replace(/\s/g, ""),
+ phone: this.phoneNumber.replace(/\s/g, ""),
password: "fakePassword",
- md5_password: md5(this.password).toString(),
+ md5_password: md5(this.password).toString()
})
- .then((data) => {
- this.updateUser(data.profile);
- this.afterLogin();
+ .then(data => {
+ if (data.code !== 502) {
+ this.updateUser(data.profile);
+ this.afterLogin();
+ }
})
- .catch(() => {
+ .catch(error => {
this.processing = false;
+ alert(error);
});
} else {
- if (this.email === "" || this.password === "") {
- alert("请输入完整的信息");
+ let emailReg = /^[A-Za-z0-9]+([_][A-Za-z0-9]+)*@([A-Za-z0-9]+\.)+[A-Za-z]{2,6}$/;
+ if (
+ this.email === "" ||
+ this.password === "" ||
+ !emailReg.test(this.email)
+ ) {
+ alert("邮箱或密码不正确");
this.processing = false;
return;
}
loginWithEmail({
- email: this.email.replace(/\s/g, ''),
+ email: this.email.replace(/\s/g, ""),
password: "fakePassword",
- md5_password: md5(this.password).toString(),
+ md5_password: md5(this.password).toString()
})
- .then((data) => {
- this.updateUser(data.profile);
- this.afterLogin();
+ .then(data => {
+ if (data.code !== 502) {
+ this.updateUser(data.profile);
+ this.afterLogin();
+ }
})
- .catch(() => {
+ .catch(error => {
this.processing = false;
+ alert(error);
});
}
- },
- },
+ }
+ }
};
@@ -235,13 +248,14 @@ export default {
.inputs {
display: flex;
+ width: 85%;
}
input {
font-size: 20px;
border: none;
background: transparent;
- width: 96%;
+ width: 100%;
font-weight: 600;
margin-top: -1px;
color: rgba(0, 0, 0, 0.88);
@@ -251,7 +265,7 @@ export default {
flex: 2;
}
input#phoneNumber {
- flex: 14;
+ flex: 12;
}
.active {
diff --git a/src/views/next.vue b/src/views/next.vue
index ce8620b..f18ebf8 100644
--- a/src/views/next.vue
+++ b/src/views/next.vue
@@ -24,11 +24,11 @@ import TrackList from "@/components/TrackList.vue";
export default {
name: "Next",
components: {
- TrackList,
+ TrackList
},
data() {
return {
- tracks: [],
+ tracks: []
};
},
computed: {
@@ -48,50 +48,51 @@ export default {
};
}
return this.tracks
- .filter((t) => t.sort > this.player.currentTrack.sort)
+ .filter(t => this.player.list.find(t2 => t2.id === t.id) !== undefined)
+ .filter(t => t.sort > this.player.currentTrack.sort)
.sort(compare("sort"));
- },
+ }
},
watch: {
currentTrack() {
this.loadTracks();
},
playerShuffle() {
- this.tracks = this.tracks.map((t) => {
- t.sort = this.player.list.find((t2) => t.id === t2.id).sort;
+ this.tracks = this.tracks.map(t => {
+ t.sort = this.player.list.find(t2 => t.id === t2.id).sort;
return t;
});
- },
+ }
},
methods: {
...mapActions(["playTrackOnListByID"]),
loadTracks() {
console.time("loadTracks");
- let loadedTrackIDs = this.tracks.map((t) => t.id);
+ let loadedTrackIDs = this.tracks.map(t => t.id);
let basicTracks = this.player.list
.filter(
- (t) =>
+ t =>
t.sort > this.player.currentTrack.sort &&
t.sort <= this.player.currentTrack.sort + 100
)
- .filter((t) => loadedTrackIDs.includes(t.id) === false);
+ .filter(t => loadedTrackIDs.includes(t.id) === false);
- let trackIDs = basicTracks.map((t) => t.id);
+ let trackIDs = basicTracks.map(t => t.id);
if (trackIDs.length > 0) {
- getTrackDetail(trackIDs.join(",")).then((data) => {
- let newTracks = data.songs.map((t) => {
- t.sort = this.player.list.find((t2) => t2.id == t.id).sort;
+ getTrackDetail(trackIDs.join(",")).then(data => {
+ let newTracks = data.songs.map(t => {
+ t.sort = this.player.list.find(t2 => t2.id == t.id).sort;
return t;
});
this.tracks.push(...newTracks);
});
}
console.timeEnd("loadTracks");
- },
+ }
},
activated() {
this.loadTracks();
- },
+ }
};