import { CellGroup, Cell, Icon, Image, Popup, Tag, Toast } from 'vant' import { computed, defineComponent, PropType, ref } from 'vue' import styles from './index.module.less' // import IconPlay from '@/common/images/icon-play.png' import IconPlay from '../images/icon-play.png' import { useRouter } from 'vue-router' import { state } from '@/state' export const getAssetsHomeFile = (fileName: string) => { const path = `../images/${fileName}` const modules = import.meta.globEager('../images/*') return modules[path].default } export default defineComponent({ name: 'TheSong', props: { list: { type: Array as PropType, default: () => [] }, // showMore: { // type: Boolean, // default: true // }, showPlay: { type: Boolean, default: true }, musicNameClass: { type: String as PropType }, authorClass: { type: String as PropType }, showNumber: { type: Boolean, default: false }, showTitleImg: { type: Boolean, default: false } }, emits: ['detail'], setup(props, { emit }) { // const isMore = ref(false) // const moreData = ref({}) // const router = useRouter() // const colors: any = { // FREE: { // color: '#01B84F', // text: '免费' // }, // VIP: { // color: '#CD863E', // text: '会员' // }, // CHARGE: { // color: '#3591CE', // text: '点播' // } // } const list = computed(() => { return props.list.map(n => { // if (typeof n.paymentType === 'string') // n.paymentType = n.paymentType.split(',') n.subjectNames = n.musicSubjectName return { ...n } }) }) return () => { return (
{list.value.map((n: any, index: number) => (
emit('detail', n)}> {props.showNumber &&
{index + 1}
} {props.showTitleImg && (
)}
{/* -{n.composer} */}
{n.exquisiteFlag === 1 && (
精选
)}
{n.subjectNames?.split(',').map((name: any) => ( {name} ))}
{/* {n.addName ? `上传者:${n.addName}` : `作曲:${n.composer}`} */} {n.addName ? `${n.addName}` : `${n.composer}`}
{props.showPlay && } {/* {props.showMore && ( { e.stopPropagation() isMore.value = true moreData.value = n }} /> )} */}
))}
) } } })