fix: bugs

This commit is contained in:
qier222 2021-04-25 14:24:04 +08:00
parent 7d580e7113
commit 5355caa4e4
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
7 changed files with 72 additions and 59 deletions

View file

@ -169,9 +169,6 @@ export default {
title: "",
};
},
created() {
this.loadData(this.$route.params.id);
},
computed: {
...mapState(["player", "data"]),
albumTime() {
@ -197,6 +194,9 @@ export default {
}
},
},
created() {
this.loadData(this.$route.params.id);
},
methods: {
...mapMutations(["appendTrackToPlayerList"]),
...mapActions(["playFirstTrackOnList", "playTrackOnListByID", "showToast"]),
@ -211,15 +211,20 @@ export default {
likeAAlbum({
id: this.album.id,
t: this.dynamicDetail.isSub ? 0 : 1,
}).then((data) => {
if (data.code === 200) {
this.dynamicDetail.isSub = !this.dynamicDetail.isSub;
if (toast === true)
this.showToast(
this.dynamicDetail.isSub ? "已保存到音乐库" : "已从音乐库删除"
);
}
});
})
.then((data) => {
if (data.code === 200) {
this.dynamicDetail.isSub = !this.dynamicDetail.isSub;
if (toast === true)
this.showToast(
this.dynamicDetail.isSub ? "已保存到音乐库" : "已从音乐库删除"
);
}
console.log(data);
})
.catch((error) => {
this.showToast(`${error.response.data.message || error}`);
});
},
formatTitle() {
let splitTitle = splitSoundtrackAlbumTitle(this.album.name);