import { Cell, CellGroup, Icon, Image, Tag } from "vant"; import { defineComponent, PropType } from "vue"; import styles from "./index.module.less"; import iconUserNum from '@common/images/icon_user_num.png'; /** * @description: 视频详情 * @param {type} headUrl 头像 * @param {type} username 姓名 * @param {type} startTime 开始时间 * @param {type} buyNum 购买用户数 * @param {type} lessonPrice 价格 * @param {type} lessonCoverUrl 视频封面 * @param {type} lessonDesc 课程描述 * @param {type} lessonNum 课程数 * @param {type} lessonName 课程名称 */ interface UserType { headUrl: string; username: string; startTime?: string; buyNum?: number; lessonPrice: number; lessonNum?: number; lessonDesc?: string; lessonCoverUrl: string; lessonName: string; } export default defineComponent({ name: "user-detail", props: { userInfo: { type: Object as PropType, required: true }, showType: { type: String as PropType<"BUY" | "TIME">, default: "BUY" } }, render() { return (
, title: () => (
{this.userInfo.username} {this.showType === "TIME" ? {this.userInfo.lessonNum}课时 :
{this.userInfo.buyNum}人已购买
}
), value: () => ( this.showType === "TIME" ?
已购 {this.userInfo.buyNum} 人
:
¥{this.userInfo.lessonPrice}/{this.userInfo.lessonNum}课时
), }}>
) } })