开始开发"正在播放"

This commit is contained in:
zilong
2021-10-20 23:12:51 +08:00
parent 17c34faa18
commit 8448b293a9
8 changed files with 128 additions and 30 deletions

View File

@@ -50,6 +50,7 @@ const createColumns = ({ play ,singerInfo }) => {
title: "音乐标题",
key: "name",
align: "left",
ellipsis: true,
render(row){
return h(
NButton,
@@ -70,6 +71,7 @@ const createColumns = ({ play ,singerInfo }) => {
{
title: "歌手",
key: "artists",
ellipsis: true,
render(row) {
const ars = row.artists.map((ar, idx) => {
let r = h(

View File

@@ -149,7 +149,7 @@ onUnmounted(() => {
id="songCtrl"
align="center"
:size="[6]"
style="padding-top: 2px"
style="padding-top: 2px;margin: 0 4px"
>
<n-button circle @click="favorite">
<template #icon>

View File

@@ -98,6 +98,7 @@ export default {};
</script>
<style lang="less" scoped>
@import "@/assets/css/common.less";
#songInfo {
flex: 3;
display: flex;
@@ -111,11 +112,14 @@ export default {};
.w-song {
display: flex;
align-items: center;
.song-name{
.text-el-line();
}
.song-author {
margin-left: 4px;
color: #aaa;
font-size: 13px;
.text-el-line();
}
}
.song-time {

View File

@@ -7,6 +7,7 @@ import RepeatOutline from "@/assets/svgs/RepeatOutline.svg";
import RepeatOne from "@/assets/svgs/RepeatOne.svg";
import Playlist from "@/assets/svgs/Playlist.svg";
import Random from "@/assets/svgs/Random.svg";
import pubsub from 'pubsub-js';
//播放模式0-3顺序循环单曲随机。
@@ -51,7 +52,7 @@ const playMode = ref(0)
</n-icon>
</template>
</n-button>
<n-button circle>
<n-button circle @click="pubsub.publish('zp.togglePlaying',)">
<template #icon>
<n-icon>
<PlaylistMusic />

View File

@@ -1,5 +1,6 @@
<template>
<div class="lmt-width">
<!-- 轮播 -->
<n-carousel
show-arrow
trigger="hover"
@@ -11,7 +12,7 @@
v-for="(b, idx) in banners"
:key="idx"
>
<img class="carousel-img" :src="b.imageUrl" />
<img class="carousel-img" :src="b.imageUrl" @click="clickBanner(b.targetId, b.targetType)" />
<span class="title">{{ b.typeTitle }}</span>
</div>
</n-carousel>
@@ -224,7 +225,6 @@ const play = (id) => {
pubsub.publish("zp.play", { id, im: true });
};
//#region 轮播图片
let banners = ref([]);
banners.value = store.getters.cache('banners')
@@ -240,6 +240,13 @@ getBanner(0)
console.log("getBanner err", err);
});
const clickBanner = (id, type) => {
switch(type){
case 1: //新歌首发...
pubsub.publish('zp.play', {id, im: true})
break;
}
}
//#endregion
//#region 最新音乐
@@ -322,6 +329,7 @@ getPersonalizedMV()
.carousel-img {
width: 100%;
border-radius: 6px;
cursor: pointer;
}
.title {
position: absolute;