|
|
|
@ -29,7 +29,6 @@ export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
tracks: [],
|
|
|
|
|
showTracks: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
@ -37,6 +36,9 @@ export default {
|
|
|
|
|
currentTrack() {
|
|
|
|
|
return this.player.currentTrack;
|
|
|
|
|
},
|
|
|
|
|
playerShuffle() {
|
|
|
|
|
return this.player.shuffle;
|
|
|
|
|
},
|
|
|
|
|
sortedTracks() {
|
|
|
|
|
function compare(property) {
|
|
|
|
|
return function(obj1, obj2) {
|
|
|
|
@ -45,16 +47,21 @@ export default {
|
|
|
|
|
return value1 - value2;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
let tracks = this.tracks
|
|
|
|
|
return this.tracks
|
|
|
|
|
.filter((t) => t.sort > this.player.currentTrack.sort)
|
|
|
|
|
.sort(compare("sort"));
|
|
|
|
|
return tracks;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
currentTrack() {
|
|
|
|
|
this.loadTracks();
|
|
|
|
|
},
|
|
|
|
|
playerShuffle() {
|
|
|
|
|
this.tracks = this.tracks.map((t) => {
|
|
|
|
|
t.sort = this.player.list.find((t2) => t.id === t2.id).sort;
|
|
|
|
|
return t;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
...mapActions(["playTrackOnListByID"]),
|
|
|
|
@ -97,101 +104,4 @@ h1 {
|
|
|
|
|
margin-bottom: 18px;
|
|
|
|
|
cursor: default;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.track-list {
|
|
|
|
|
user-select: none;
|
|
|
|
|
.track {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
padding: 8px;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
img {
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
height: 56px;
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
}
|
|
|
|
|
.title-and-artist {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
.container {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
.title {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: rgba(0, 0, 0, 0.88);
|
|
|
|
|
cursor: default;
|
|
|
|
|
}
|
|
|
|
|
.artist {
|
|
|
|
|
margin-top: 2px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: rgba(0, 0, 0, 0.68);
|
|
|
|
|
a {
|
|
|
|
|
span {
|
|
|
|
|
margin-right: 3px;
|
|
|
|
|
color: rgba(0, 0, 0, 0.8);
|
|
|
|
|
}
|
|
|
|
|
&:hover {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.album {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
.container {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
&:hover {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
color: rgba(0, 0, 0, 0.88);
|
|
|
|
|
}
|
|
|
|
|
.time {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
width: 50px;
|
|
|
|
|
cursor: default;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
font-variant-numeric: tabular-nums;
|
|
|
|
|
}
|
|
|
|
|
&:hover {
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
background: #f5f5f7;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.track.playing {
|
|
|
|
|
background: #eaeffd;
|
|
|
|
|
.title,
|
|
|
|
|
.time,
|
|
|
|
|
.album {
|
|
|
|
|
color: #335eea;
|
|
|
|
|
}
|
|
|
|
|
.artist {
|
|
|
|
|
color: rgba(51, 94, 234, 0.88);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.track.disable {
|
|
|
|
|
img {
|
|
|
|
|
filter: grayscale(1) opacity(0.6);
|
|
|
|
|
}
|
|
|
|
|
.title,
|
|
|
|
|
.artist,
|
|
|
|
|
.time,
|
|
|
|
|
.album {
|
|
|
|
|
color: rgba(0, 0, 0, 0.28);
|
|
|
|
|
}
|
|
|
|
|
&:hover {
|
|
|
|
|
background: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|