fix: bugs

This commit is contained in:
qier222 2021-01-29 21:36:10 +08:00
parent de7d008c0b
commit 967a7165ac
8 changed files with 39 additions and 27 deletions

View file

@ -16,7 +16,7 @@
<Toast />
<ModalAddTrackToPlaylist v-if="isAccountLoggedIn" />
<ModalNewPlaylist v-if="isAccountLoggedIn" />
<transition name="slide-up">
<transition name="slide-up" v-if="this.$store.state.player.enabled">
<Lyrics v-show="this.$store.state.showLyrics" />
</transition>
</div>

View file

@ -50,9 +50,12 @@ export default {
},
computed: {
imageStyles() {
let styles = {};
let styles = {
objectFit: "cover",
};
if (this.fixedSize !== 0) {
styles.width = this.fixedSize + "px";
styles.height = this.fixedSize + "px";
}
if (this.type === "artist") styles.borderRadius = "50%";
return styles;

View file

@ -150,7 +150,6 @@ export default {
return {
interval: null,
progress: 0,
oldVolume: 0.5,
};
},
mounted() {

View file

@ -174,7 +174,20 @@ export default {
});
},
activated() {
this.loadData();
if (!this.data.likedSongPlaylistID) {
userPlaylist({
uid: this.data.user.userId,
limit: 1,
}).then((data) => {
this.updateData({
key: "likedSongPlaylistID",
value: data.playlist[0].id,
});
this.loadData();
});
} else {
this.loadData();
}
dailyTask();
},
computed: {
@ -204,7 +217,7 @@ export default {
},
methods: {
...mapActions(["showToast"]),
...mapMutations(["updateModal"]),
...mapMutations(["updateModal", "updateData"]),
playLikedSongs() {
this.$store.state.player.playPlaylistByID(
this.playlists[0].id,

View file

@ -95,7 +95,6 @@ import NProgress from "nprogress";
import { loginWithPhone, loginWithEmail } from "@/api/auth";
import md5 from "crypto-js/md5";
import { mapMutations } from "vuex";
import { userPlaylist } from "@/api/user";
export default {
name: "Login",
@ -124,19 +123,6 @@ export default {
},
methods: {
...mapMutations(["updateData"]),
afterLogin() {
this.updateData({ key: "loginMode", value: "account" });
userPlaylist({
uid: this.$store.state.data.user.userId,
limit: 1,
}).then((data) => {
this.updateData({
key: "likedSongPlaylistID",
value: data.playlist[0].id,
});
this.$router.push({ path: "/library" });
});
},
validatePhone() {
if (
this.countryCode === "" ||
@ -198,7 +184,8 @@ export default {
}
if (data.code === 200) {
this.updateData({ key: "user", value: data.profile });
this.afterLogin();
this.updateData({ key: "loginMode", value: "account" });
this.$router.push({ path: "/library" });
} else {
this.processing = false;
alert(data.msg ?? data.message);

View file

@ -543,7 +543,7 @@ export default {
transition: all 0.5s ease;
}
.slide-fade-leave-active {
transition: all 0.5s cubic-bezier(1, 0.5, 0.8, 1);
transition: all 0.5s cubic-bezier(0.2, 0.2, 0, 1);
}
.slide-fade-enter,
.slide-fade-leave-to {