歌手链接
This commit is contained in:
@@ -12,6 +12,7 @@ import { getSongDetial } from "@/network/song";
|
||||
import dayjs from 'dayjs'
|
||||
import 'dayjs/locale/zh-cn'
|
||||
import duration from 'dayjs/plugin/duration'
|
||||
import ArtistsSpan from "../../components/ArtistsSpan.vue";
|
||||
|
||||
const showInfo = ref(true);
|
||||
const info = reactive({
|
||||
@@ -26,7 +27,7 @@ const songInfo = (id) => {
|
||||
.then((res) => {
|
||||
showInfo.value = true;
|
||||
info.name = res.data.songs[0].name;
|
||||
info.artists = res.data.songs[0].ar[0].name;
|
||||
info.artists = res.data.songs[0].ar;
|
||||
info.albumPicUrl = res.data.songs[0].al.picUrl;
|
||||
})
|
||||
.catch((err) => {});
|
||||
@@ -44,7 +45,7 @@ function zpTime(time) {
|
||||
// totalTime.value = zpTime(12345)
|
||||
const psToken = pubsub.subscribe("zp", (msg, data) => {
|
||||
switch (msg) {
|
||||
case "zp.play":
|
||||
case "zp.getSongInfo":
|
||||
songInfo(data.id);
|
||||
break;
|
||||
case "zp.progress":
|
||||
@@ -70,7 +71,9 @@ onUnmounted(() => {
|
||||
<div class="song" v-show="showInfo">
|
||||
<div class="w-song">
|
||||
<div class="song-name">{{ info.name }}</div>
|
||||
<div class="song-author">{{ info.artists }}</div>
|
||||
<div class="song-author">
|
||||
<ArtistsSpan :artists="info.artists" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="song-time">
|
||||
|
||||
Reference in New Issue
Block a user