import { defineComponent } from 'vue' import iconTeacher from '@/common/images/icon_teacher.png' import { ElButton, ElDialog, ElTag } from 'element-plus' import { state } from '@/state' import { getUserType } from '@/helpers/utils' import styles from './index.module.less' import OpenMember from '@/views/user-info/components/open-member' export const getAssetsHomeFile = (fileName: string) => { const path = `../../../user-info/images/${fileName}` const modules = import.meta.globEager('../../../user-info/images/*') return modules[path].default } export default defineComponent({ name: 'users', computed: { userInfo() { return state.user.data } }, data() { return { memberStatus: false } }, methods: { // 检验是否有对应徽章 checkBadge(type: string) { // tag : 老师点亮图标 // STYLE:个人风采 // VIDEO:视频课 // LIVE:直播课, // MUSIC:曲目 逗号隔开 let status = false const { userInfo } = this console.log(userInfo, 'userInfo') switch (type) { case 'STYLE': case 'VIDEO': case 'LIVE': case 'MUSIC': if (userInfo.tag) { status = userInfo.tag.indexOf(type) > -1 } break case 'VIP': status = userInfo.userVip?.vipType === 'VIP' break case 'SVIP': status = userInfo.userVip?.vipType === 'SVIP' || userInfo.userVip?.vipType === 'PERMANENT_SVIP' break default: status = false break } return status } }, render() { return (
学生

{this.userInfo.username} {(this.checkBadge('SVIP') || this.checkBadge('VIP')) && ( )} {/* */}

{this.userInfo.isVip !== 1 && ( { this.memberStatus = true }} > 开通会员 )}
{ this.$router.push('/studentInfo/myFollow') }} > {this.userInfo.starTeacherNum || 0} 关注
(this.memberStatus = val)} closeOnClickModal={false} closeOnPressEscape={false} >
) } })