fix: 解决云盘和听歌排行歌曲变灰的问题 (#1215)

This commit is contained in:
chen310 2022-01-11 19:07:35 +08:00 committed by GitHub
parent 76a8742d61
commit d4ca9d6dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,15 +14,13 @@
@click="goToAlbum" @click="goToAlbum"
/> />
<div v-if="showOrderNumber" class="no"> <div v-if="showOrderNumber" class="no">
<button v-show="focus && track.playable && !isPlaying" @click="playTrack"> <button v-show="focus && playable && !isPlaying" @click="playTrack">
<svg-icon <svg-icon
icon-class="play" icon-class="play"
style="height: 14px; width: 14px" style="height: 14px; width: 14px"
></svg-icon> ></svg-icon>
</button> </button>
<span v-show="(!focus || !track.playable) && !isPlaying">{{ <span v-show="(!focus || !playable) && !isPlaying">{{ track.no }}</span>
track.no
}}</span>
<button v-show="isPlaying"> <button v-show="isPlaying">
<svg-icon <svg-icon
icon-class="volume" icon-class="volume"
@ -114,6 +112,9 @@ export default {
? this.trackProp.simpleSong ? this.trackProp.simpleSong
: this.trackProp; : this.trackProp;
}, },
playable() {
return this.track?.privilege?.pl > 0 || this.track?.playable;
},
imgUrl() { imgUrl() {
let image = let image =
this.track?.al?.picUrl ?? this.track?.al?.picUrl ??
@ -170,7 +171,7 @@ export default {
}, },
trackClass() { trackClass() {
let trackClass = [this.type]; let trackClass = [this.type];
if (!this.track.playable && this.showUnavailableSongInGreyStyle) if (!this.playable && this.showUnavailableSongInGreyStyle)
trackClass.push('disable'); trackClass.push('disable');
if (this.isPlaying && this.highlightPlayingTrack) if (this.isPlaying && this.highlightPlayingTrack)
trackClass.push('playing'); trackClass.push('playing');