|
@@ -21,6 +21,19 @@ import changeIcon from '../images/changeIcon.png'
|
|
|
import backIcon from '../images/backIcon.png'
|
|
|
import peopleIcon from '../images/peopleIcon.png'
|
|
|
import planIcon from '../images/planIcon.png'
|
|
|
+import ablumIcon from '../images/ablumIcon.png'
|
|
|
+import noAblumIcon from '../images/ablumIcon.png'
|
|
|
+import memberIcon from '../images/memberIcon.png'
|
|
|
+import noMemberIcon from '../images/noMemberIcon.png'
|
|
|
+import onlineIcon from '../images/onlineIcon.png'
|
|
|
+import noOnlineIcon from '../images/onlineIcon.png'
|
|
|
+import styleIcon from '../images/styleIcon.png'
|
|
|
+import nostyleIcon from '../images/styleIcon.png'
|
|
|
+import videoIcon from '../images/videoIcon.png'
|
|
|
+import noVideoIcon from '../images/videoIcon.png'
|
|
|
+import vipIcon from '../images/vipIcon.png'
|
|
|
+import noVipIcon from '../images/vipIcon.png'
|
|
|
+
|
|
|
import { getUserInfo, getUserType, getAuth, setAuth } from '@/helpers/utils'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import request from '@/helpers/request'
|
|
@@ -39,7 +52,8 @@ export default defineComponent({
|
|
|
title: props.title,
|
|
|
user: {} as any,
|
|
|
userType: '',
|
|
|
- showChange: false
|
|
|
+ showChange: false,
|
|
|
+ iconList:[] as any
|
|
|
})
|
|
|
mitt.on('mittFn',()=>{
|
|
|
console.log('mittFn')
|
|
@@ -65,6 +79,34 @@ export default defineComponent({
|
|
|
states.showChange = false
|
|
|
}
|
|
|
}
|
|
|
+ // iconList
|
|
|
+
|
|
|
+ if(states.userType == 'TEACHER'){
|
|
|
+ states.iconList = []
|
|
|
+ if(states.user.tag.indexOf('STYLE') != -1){
|
|
|
+ states.iconList.push(styleIcon)
|
|
|
+ }else{
|
|
|
+ states.iconList.push(nostyleIcon)
|
|
|
+ }
|
|
|
+ if(states.user.tag.indexOf('VIDEO') != -1){
|
|
|
+ states.iconList.push(videoIcon)
|
|
|
+ }else{
|
|
|
+ states.iconList.push(noVideoIcon)
|
|
|
+ }
|
|
|
+ if(states.user.tag.indexOf('LIVE') != -1){
|
|
|
+ states.iconList.push(onlineIcon)
|
|
|
+ }else{
|
|
|
+ states.iconList.push(noOnlineIcon)
|
|
|
+ }
|
|
|
+ if(states.user.tag.indexOf('MUSIC') != -1){
|
|
|
+ states.iconList.push(ablumIcon)
|
|
|
+ }else{
|
|
|
+ states.iconList.push(noAblumIcon)
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ states.iconList = []
|
|
|
+ }
|
|
|
+ console.log('查看用户登录态',states.user)
|
|
|
}
|
|
|
const gotoPage = (val: string) => {
|
|
|
router.push({ path: val })
|
|
@@ -140,13 +182,15 @@ export default defineComponent({
|
|
|
<>
|
|
|
<ElDropdown
|
|
|
onCommand={val => this.changeState(val)}
|
|
|
+ popper-class='loginPopper'
|
|
|
+ trigger="click"
|
|
|
v-slots={{
|
|
|
dropdown: () => (
|
|
|
<>
|
|
|
<div class={classes.dropdownWrap}>
|
|
|
<div class={classes.dropdownWrapUser}>
|
|
|
- <div class={classes.userInfoWrap}>
|
|
|
- <img
|
|
|
+ <div class={classes.userInfoWrap1}>
|
|
|
+ {/* <img
|
|
|
src={
|
|
|
this.user.heardUrl
|
|
|
? this.user.heardUrl
|
|
@@ -154,10 +198,18 @@ export default defineComponent({
|
|
|
}
|
|
|
class={classes.userHeader}
|
|
|
alt=""
|
|
|
- />
|
|
|
+ /> */}
|
|
|
+ <div class={classes.titleWrap}>
|
|
|
<p class={classes.title}>{this.user.username}</p>
|
|
|
+ <img class={classes.vipLogo} src={this.user.isVip?vipIcon:noVipIcon} alt="" />
|
|
|
+ </div>
|
|
|
+ <div class={classes.iconList}>
|
|
|
+ {this.userType == 'TEACHER'? <p class={classes.teacherTag}>{'老师'}</p>: <p class={classes.studentTag}>{'学生'}</p>}
|
|
|
+ {this.iconList.map(item=><img class={classes.icon} src={item} alt="" /> )}
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
- <img src={userBanner} alt="" />
|
|
|
+ {/* <img src={userBanner} alt="" /> */}
|
|
|
</div>
|
|
|
|
|
|
{this.userType == 'TEACHER' ? (
|
|
@@ -230,7 +282,7 @@ export default defineComponent({
|
|
|
}}
|
|
|
>
|
|
|
<div class={classes.userInfoWrap}>
|
|
|
- <p class={classes.title}>{this.user.username}</p>
|
|
|
+ {/* <p class={classes.title}>{this.user.username}</p> */}
|
|
|
<img
|
|
|
src={this.user.heardUrl ? this.user.heardUrl : teacherHeader}
|
|
|
class={classes.userHeader}
|