import { defineComponent } from 'vue' import iconTeacher from '@/common/images/icon_teacher.png' import { ElButton, ElDialog, ElTag } from 'element-plus' import { state } from '@/state' import styles from './index.module.less' import OpenMember from '../open-member' // import musicDefault from '../../images/music_default.png' // import musicActive from '../../images/music_active.png' // import entryDefault from '../../images/entry_default.png' // import entryActive from '../../images/entry_active.png' export const getAssetsHomeFile = (fileName: string) => { const path = `../../images/${fileName}` const modules = import.meta.globEager('../../images/*') return modules[path].default } export default defineComponent({ name: 'users', computed: { userInfo() { return state.user.data } }, data() { return { memberStatus: false } }, methods: { onDetail(type: string) { if (type === 'entry') { this.$router.push({ path: '/teacherAuth' }) } else if (type === 'music') { this.$router.push({ path: '/musicAuth' }) } }, // 检验是否有对应徽章 checkBadge(type: string) { // tag : 老师点亮图标 // STYLE:个人风采 // VIDEO:视频课 // LIVE:直播课, // MUSIC:曲目 逗号隔开 let status = false const { userInfo } = this switch (type) { case 'STYLE': case 'VIDEO': case 'LIVE': case 'MUSIC': if (userInfo.tag) { status = userInfo.tag.indexOf(type) > -1 } break case 'VIP': status = userInfo.isVip > 0 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.entryFlag === 1 ? ( { this.onDetail('entry') }} /> ) : ( { this.onDetail('entry') }} /> )} {this.userInfo.musicianFlag === 1 ? ( { this.onDetail('music') }} /> ) : ( { this.onDetail('music') }} /> )}
*/}
{this.userInfo.entryFlag !== 1 && ( { this.onDetail('entry') }} > 达人认证 )} {!this.checkBadge('VIP') && ( (this.memberStatus = true)} > 开通会员 )}
{ this.$router.push('/userInfo/myFans') }} > {this.userInfo.fansNum || 0} 粉丝 { this.$router.push('/userInfo/musicClass') }} > {this.userInfo.musicSheetNum || 0} 乐谱
(this.memberStatus = val)} closeOnClickModal={false} closeOnPressEscape={false} >
) } })