fix: bugs

This commit is contained in:
qier222 2021-06-08 00:09:30 +08:00
parent 22c9691a73
commit c506dea02b
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
18 changed files with 79 additions and 32 deletions

View file

@ -111,7 +111,7 @@ export default {
}
}
let img = item.img1v1Url || item.picUrl || item.coverImgUrl;
return `${img}?param=512y512`;
return `${img?.replace('http://', 'https://')}?param=512y512`;
},
},
};

View file

@ -1,5 +1,6 @@
<template>
<div class="fm" :style="{ background }" data-theme="dark">
<img :src="nextTrackCover" style="display: none" />
<img
class="cover"
:src="track.album && track.album.picUrl | resizeImage(512)"
@ -57,6 +58,12 @@ export default {
artists() {
return this.track.artists || this.track.ar || [];
},
nextTrackCover() {
return `${this.player._personalFMNextTrack?.album?.picUrl.replace(
'http://',
'https://'
)}?param=512y512`;
},
},
created() {
this.getColor();
@ -76,9 +83,13 @@ export default {
},
moveToFMTrash() {
this.player.moveToFMTrash();
this.getColor();
},
getColor() {
const cover = `${this.player.personalFMTrack.album.picUrl}?param=512y512`;
const cover = `${this.player.personalFMTrack.album.picUrl.replace(
'http://',
'https://'
)}?param=512y512`;
Vibrant.from(cover, { colorCount: 1 })
.getPalette()
.then(palette => {
@ -104,9 +115,11 @@ export default {
background: var(--color-secondary-bg);
border-radius: 1rem;
display: flex;
height: 198px;
box-sizing: border-box;
}
.cover {
height: 164px;
height: 100%;
clip-path: border-box;
border-radius: 0.75rem;
margin-right: 1.2rem;

View file

@ -104,7 +104,7 @@
<button-icon
:title="$t('player.nextUp')"
:class="{
active: this.$route.name === 'next',
active: $route.name === 'next',
disabled: player.isPersonalFM,
}"
@click.native="goToNextTracksPage"
@ -154,7 +154,7 @@
:interval="0.01"
:drag-on-click="true"
:duration="0"
:tooltip="`none`"
tooltip="none"
:dot-size="12"
></vue-slider>
</div>
@ -164,7 +164,7 @@
class="lyrics-button"
title="歌词"
style="margin-left: 12px"
@click.native.stop="toggleLyrics"
@click.native="toggleLyrics"
><svg-icon icon-class="arrow-up"
/></button-icon>
</div>

View file

@ -35,6 +35,9 @@ export default {
hideTimer: null,
isOnDrag: false,
onDragClientY: 0,
positions: {
home: { scrollTop: 0, params: {} },
},
};
},
computed: {
@ -73,6 +76,11 @@ export default {
if (!this.show && clintHeight !== thumbHeight) this.show = true;
this.setScrollbarHideTimeout();
const route = this.$route;
if (route.meta.savePosition) {
this.positions[route.name] = { scrollTop, params: route.params };
}
},
handleMouseenter() {
this.active = true;
@ -121,6 +129,17 @@ export default {
this.hideTimer = null;
}, 4000);
},
restorePosition() {
const route = this.$route;
if (
!route.meta.savePosition ||
this.positions[route.name] === undefined ||
this.main === undefined
) {
return;
}
this.main.scrollTo({ top: this.positions[route.name].scrollTop });
},
},
};
</script>

View file

@ -127,7 +127,6 @@ export default {
translate() {
let t;
if (this.track?.tns?.length > 0) t = this.track.tns[0];
else if (this.track.al?.tns?.length > 0) t = this.track.al.tns[0];
else t = this.track.alia[0];
return t;
},
@ -138,11 +137,7 @@ export default {
return this.type === 'album';
},
isTranslate() {
return (
this.track?.tns?.length > 0 ||
this.track.al?.tns?.length > 0 ||
this.track.alia?.length > 0
);
return this.track?.tns?.length > 0 || this.track.alia?.length > 0;
},
isPlaylist() {
return this.type === 'playlist';
@ -301,6 +296,7 @@ button {
}
.translate {
color: #aeaeae;
margin-left: 4px;
}
}
.artist {
@ -401,7 +397,8 @@ button {
color: var(--color-primary);
.title,
.album,
.time {
.time,
.title-and-artist .translate {
color: var(--color-primary);
}
.title .featured,