import { defineComponent, PropType } from 'vue' import { Image, CellGroup, Cell, Icon } from 'vant' import styles from './live-item.module.less' import dayjs from 'dayjs' import iconSuccess from '@common/images/icon_success.png' import iconTeacher from '@common/images/icon_teacher.png' interface IProps { backgroundPic: string courseGroupId: number courseGroupName: string courseNum: string courseStartTime: number coursePrice: number teacherName: string teacherId: number avatar?: string studentCount: number existBuy: number subjectName: string } export default defineComponent({ name: 'liveItem', props: { onClick: { type: Function, default: (item?: any) => {} }, liveInfo: { type: Object as PropType, default: {} } }, render() { return ( this.onClick(this.liveInfo)} v-slots={{ icon: () => (
{this.liveInfo.subjectName}
), title: () => (
{this.liveInfo.courseGroupName}

{/* 老师: */} {this.liveInfo.teacherName || `游客${this.liveInfo.teacherId}`}

开课时间: {dayjs(this.liveInfo.courseStartTime).format( 'MM月DD日 HH:mm' )}

{this.liveInfo.coursePrice > 0 && ( ¥ {this.liveInfo.coursePrice} )} {this.liveInfo.courseNum}课时

{this.liveInfo.existBuy === 1 && ( {/* */} 学习 )} {/* : ( {this.liveInfo.studentCount}人学习 ) */}
) }} /> ) } })