From 1496a8a0d0adaf0da4a2464f4604d1464334d9a1 Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Sun, 19 Jun 2022 20:51:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AD=8C=E5=90=8D=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E4=BD=8D=E7=BD=AE=20&=20FMCard=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E9=A2=9C=E8=89=B2=20(#1650)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 歌名翻译文本位置 * fix: 使FMCard的背景颜色永远随着歌曲改变 --- src/components/FMCard.vue | 12 ++++++------ src/components/TrackList.vue | 11 ++++++++--- src/components/TrackListItem.vue | 9 +++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/components/FMCard.vue b/src/components/FMCard.vue index c78b597..1f0d28b 100644 --- a/src/components/FMCard.vue +++ b/src/components/FMCard.vue @@ -67,6 +67,11 @@ export default { )}?param=512y512`; }, }, + watch: { + track() { + this.getColor(); + }, + }, created() { this.getColor(); window.ok = this.getColor; @@ -76,11 +81,7 @@ export default { this.player.playPersonalFM(); }, next() { - this.player.playNextFMTrack().then(result => { - if (result) { - this.getColor(); - } - }); + this.player.playNextFMTrack(); }, goToAlbum() { if (this.track.album.id === 0) return; @@ -88,7 +89,6 @@ export default { }, moveToFMTrash() { this.player.moveToFMTrash(); - this.getColor(); }, getColor() { if (!this.player.personalFMTrack?.album?.picUrl) return; diff --git a/src/components/TrackList.vue b/src/components/TrackList.vue index 2b5bbb1..6743f3f 100644 --- a/src/components/TrackList.vue +++ b/src/components/TrackList.vue @@ -272,10 +272,15 @@ export default { } }, copyLink() { - navigator.clipboard.writeText( + this.$copyText( `https://music.163.com/song?id=${this.rightClickedTrack.id}` - ); - this.showToast(locale.t('toast.copied')); + ) + .then(() => { + this.showToast(locale.t('toast.copied')); + }) + .catch(err => { + this.showToast(`${locale.t('toast.copyFailed')}${err}`); + }); }, removeTrackFromQueue() { this.$store.state.player.removeTrackFromQueue( diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue index c735dfd..907e884 100644 --- a/src/components/TrackListItem.vue +++ b/src/components/TrackListItem.vue @@ -33,6 +33,9 @@
{{ track.name }} + + ({{ subTitle }}) + - - ({{ subTitle }}) -