import { defineComponent, PropType } from 'vue' import { Image } from 'vant' import styles from './video-item.module.less' import iconTeacher from '@common/images/icon_teacher.png' interface VideoItemProps { id?: number teacherId?: number lessonName: string userName: string avatar: string lessonCoverUrl: string lessonCount: number lessonPrice: number countStudent: number lessonSubjectName: string auditVersion: number } export default defineComponent({ name: 'VideoItem', props: { item: Object as PropType, onClick: { type: Function as PropType<(item: any) => void>, default: (item: any) => {} } }, render() { const item: any = this.item return (
{ this.onClick(item) }} >
{item?.lessonSubjectName}
{item?.lessonName}
{item?.userName || item?.username || `游客${item?.teacherId || ''}`} {item?.countStudent}人已 {item?.lessonPrice <= 0 && item.auditVersion === 0 ? '领取' : '购买'}
{item?.lessonPrice > 0 && <>¥{item?.lessonPrice}/} {item?.lessonPrice <= 0 && item.auditVersion !== 0 && <>¥{0}/} {item?.lessonPrice <= 0 && item.auditVersion === 0 && <>免费/} {item?.lessonCount}课时
) } })