|
@@ -3,9 +3,9 @@ import { defineComponent } from 'vue'
|
|
import styles from './teacher-header.module.less'
|
|
import styles from './teacher-header.module.less'
|
|
import { postMessage } from '@/helpers/native-message'
|
|
import { postMessage } from '@/helpers/native-message'
|
|
import iconTeacher from '@common/images/icon_teacher.png'
|
|
import iconTeacher from '@common/images/icon_teacher.png'
|
|
-// import musicCert from '@common/images/music_cert.png'
|
|
|
|
-// import teacherCert from '@common/images/teacher_cert.png'
|
|
|
|
import request from '@/helpers/request'
|
|
import request from '@/helpers/request'
|
|
|
|
+import IconXueli from '@common/images/icon-xueli.png'
|
|
|
|
+import IconJiaozi from '@common/images/icon-jiaozi.png'
|
|
|
|
|
|
export const getAssetsHomeFile = (fileName: string) => {
|
|
export const getAssetsHomeFile = (fileName: string) => {
|
|
const path = `../images/${fileName}`
|
|
const path = `../images/${fileName}`
|
|
@@ -39,6 +39,10 @@ export default defineComponent({
|
|
starGrade() {
|
|
starGrade() {
|
|
const { starGrade } = this.userInfo as any
|
|
const { starGrade } = this.userInfo as any
|
|
return Number(starGrade) || 0
|
|
return Number(starGrade) || 0
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ tags() {
|
|
|
|
+ return this.userInfo.tag?.split(',') || []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -120,133 +124,41 @@ export default defineComponent({
|
|
<>
|
|
<>
|
|
<div class={styles.headerContent}>
|
|
<div class={styles.headerContent}>
|
|
<div class={styles.headerCount}>
|
|
<div class={styles.headerCount}>
|
|
- <Cell
|
|
|
|
- class={styles['open-teacher-info']}
|
|
|
|
- border={false}
|
|
|
|
- center
|
|
|
|
- v-slots={{
|
|
|
|
- icon: () => (
|
|
|
|
- <div
|
|
|
|
- style={{ position: 'relative', lineHeight: 0 }}
|
|
|
|
- onClick={() => {
|
|
|
|
- // 判断是否在直播中
|
|
|
|
- if (this.userInfo.liveing === 1) {
|
|
|
|
- postMessage({
|
|
|
|
- api: 'joinLiveRoom',
|
|
|
|
- content: {
|
|
|
|
- roomId: this.userInfo.roomUid,
|
|
|
|
- teacherId: this.userInfo.userId
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ <div class={styles.teacherContent}>
|
|
|
|
+ <div
|
|
|
|
+ class={styles.teacherIcon}
|
|
|
|
+ onClick={() => {
|
|
|
|
+ // 判断是否在直播中
|
|
|
|
+ if (this.userInfo.liveing === 1) {
|
|
|
|
+ postMessage({
|
|
|
|
+ api: 'joinLiveRoom',
|
|
|
|
+ content: {
|
|
|
|
+ roomId: this.userInfo.roomUid,
|
|
|
|
+ teacherId: this.userInfo.userId
|
|
}
|
|
}
|
|
- }}
|
|
|
|
- >
|
|
|
|
- <Image
|
|
|
|
- class={styles.userLogo}
|
|
|
|
- src={this.userInfo.heardUrl || iconTeacher}
|
|
|
|
- fit="cover"
|
|
|
|
- />
|
|
|
|
- {this.userInfo.liveing === 1 && (
|
|
|
|
- <p class={styles.liveTag}>直播中</p>
|
|
|
|
- )}
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- <div class={styles['teacher-info']}>
|
|
|
|
- <div class={styles['teacher-name']}>
|
|
|
|
- <div class={styles.teacherCert}>
|
|
|
|
- <span class={styles.teacherLast}>
|
|
|
|
- {this.userInfo.username ||
|
|
|
|
- `游客${this.userInfo.userId || ''}`}
|
|
|
|
- </span>
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ <Image
|
|
|
|
+ class={[styles.avatar, this.checkBadge('VIP') && styles.avatarActive]}
|
|
|
|
+ round
|
|
|
|
+ src={this.userInfo.heardUrl || iconTeacher}
|
|
|
|
+ fit="cover"
|
|
|
|
+ />
|
|
|
|
|
|
- <Image
|
|
|
|
- class={styles.iconVip}
|
|
|
|
- src={
|
|
|
|
- this.checkBadge('VIP')
|
|
|
|
- ? getAssetsHomeFile('vip_active.png')
|
|
|
|
- : getAssetsHomeFile('vip_default.png')
|
|
|
|
- }
|
|
|
|
- />
|
|
|
|
- <div
|
|
|
|
- class={styles.teacherIcons}
|
|
|
|
- onClick={this.openTeacherIcon}
|
|
|
|
- >
|
|
|
|
- <Image
|
|
|
|
- class={styles.iconOther}
|
|
|
|
- src={
|
|
|
|
- this.checkBadge('STYLE')
|
|
|
|
- ? getAssetsHomeFile('cert_active.png')
|
|
|
|
- : getAssetsHomeFile('cert_default.png')
|
|
|
|
- }
|
|
|
|
- />
|
|
|
|
- <Image
|
|
|
|
- class={styles.iconOther}
|
|
|
|
- src={
|
|
|
|
- this.checkBadge('VIDEO')
|
|
|
|
- ? getAssetsHomeFile('video_active.png')
|
|
|
|
- : getAssetsHomeFile('video_default.png')
|
|
|
|
- }
|
|
|
|
- />
|
|
|
|
- <Image
|
|
|
|
- class={styles.iconOther}
|
|
|
|
- src={
|
|
|
|
- this.checkBadge('LIVE')
|
|
|
|
- ? getAssetsHomeFile('live_active.png')
|
|
|
|
- : getAssetsHomeFile('live_default.png')
|
|
|
|
- }
|
|
|
|
- />
|
|
|
|
- <Image
|
|
|
|
- class={styles.iconOther}
|
|
|
|
- src={
|
|
|
|
- this.checkBadge('MUSIC')
|
|
|
|
- ? getAssetsHomeFile('music_active.png')
|
|
|
|
- : getAssetsHomeFile('music_default.png')
|
|
|
|
- }
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class={styles.level}>
|
|
|
|
- {this.starGrade ? (
|
|
|
|
- <Rate
|
|
|
|
- readonly
|
|
|
|
- modelValue={this.starGrade}
|
|
|
|
- iconPrefix="iconfont"
|
|
|
|
- color="#FFC459"
|
|
|
|
- void-icon="star_default"
|
|
|
|
- icon="star_active"
|
|
|
|
- size={15}
|
|
|
|
- />
|
|
|
|
- ) : (
|
|
|
|
- <span style={{ fontSize: '12px', color: '#999999' }}>
|
|
|
|
- 暂无评分
|
|
|
|
- </span>
|
|
|
|
- )}
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </Cell>
|
|
|
|
- <p class={styles.piNameSubject}>
|
|
|
|
- <Image
|
|
|
|
- class={styles.subjectSection}
|
|
|
|
- src={getAssetsHomeFile('icon_subject.png')}
|
|
|
|
- fit="contain"
|
|
|
|
- />
|
|
|
|
- <div class={styles.subjectList}>
|
|
|
|
- {this.subjectNameList.map((item: any) => (
|
|
|
|
- <span class={styles.subject}>{item}</span>
|
|
|
|
- ))}
|
|
|
|
- </div>
|
|
|
|
- </p>
|
|
|
|
- <div class={styles['teacher-bottom']}>
|
|
|
|
- <div class={styles['teacher-data']}>
|
|
|
|
- <div class={styles['teacher-data_item']}>
|
|
|
|
- 粉丝 <span>{this.userInfo.fansNum || 0}</span>
|
|
|
|
- </div>
|
|
|
|
- <div class={styles['teacher-data_item']}>
|
|
|
|
- 已上课时 <span>{this.userInfo.expTime || 0}</span>
|
|
|
|
- </div>
|
|
|
|
|
|
+ {this.userInfo.liveing === 1 && (
|
|
|
|
+ <p class={styles.liveTag}>直播中</p>
|
|
|
|
+ )}
|
|
|
|
+
|
|
|
|
+ <Image
|
|
|
|
+ class={styles.teacherIconVip}
|
|
|
|
+ src={
|
|
|
|
+ this.checkBadge('VIP')
|
|
|
|
+ ? getAssetsHomeFile('vip_active.png')
|
|
|
|
+ : getAssetsHomeFile('vip_default.png')
|
|
|
|
+ }
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
<div class={styles.teacherOperation}>
|
|
<div class={styles.teacherOperation}>
|
|
<Button
|
|
<Button
|
|
@@ -282,6 +194,90 @@ export default defineComponent({
|
|
</Button>
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class={styles.teacherInfo}>
|
|
|
|
+ <div class={styles.teacherInfoName}>
|
|
|
|
+ {this.userInfo.username || `游客${this.userInfo.userId || ''}`}
|
|
|
|
+ </div>
|
|
|
|
+ {this.tags.includes('TEACHER') && <img src={IconXueli} />}
|
|
|
|
+ {this.tags.includes('DEGREE') && <img src={IconJiaozi} />}
|
|
|
|
+ </div>
|
|
|
|
+ <div class={styles.teacherHonor}>
|
|
|
|
+ <div>勋章:</div>
|
|
|
|
+ <div class={styles.teacherIcons} onClick={this.openTeacherIcon}>
|
|
|
|
+ <Image
|
|
|
|
+ class={styles.iconOther}
|
|
|
|
+ src={
|
|
|
|
+ this.checkBadge('STYLE')
|
|
|
|
+ ? getAssetsHomeFile('cert_active.png')
|
|
|
|
+ : getAssetsHomeFile('cert_default.png')
|
|
|
|
+ }
|
|
|
|
+ />
|
|
|
|
+ <Image
|
|
|
|
+ class={styles.iconOther}
|
|
|
|
+ src={
|
|
|
|
+ this.checkBadge('VIDEO')
|
|
|
|
+ ? getAssetsHomeFile('video_active.png')
|
|
|
|
+ : getAssetsHomeFile('video_default.png')
|
|
|
|
+ }
|
|
|
|
+ />
|
|
|
|
+ <Image
|
|
|
|
+ class={styles.iconOther}
|
|
|
|
+ src={
|
|
|
|
+ this.checkBadge('LIVE')
|
|
|
|
+ ? getAssetsHomeFile('live_active.png')
|
|
|
|
+ : getAssetsHomeFile('live_default.png')
|
|
|
|
+ }
|
|
|
|
+ />
|
|
|
|
+ <Image
|
|
|
|
+ class={styles.iconOther}
|
|
|
|
+ src={
|
|
|
|
+ this.checkBadge('MUSIC')
|
|
|
|
+ ? getAssetsHomeFile('music_active.png')
|
|
|
|
+ : getAssetsHomeFile('music_default.png')
|
|
|
|
+ }
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div class={styles.score}>评分:</div>
|
|
|
|
+ <div class={styles.level}>
|
|
|
|
+ {this.starGrade ? (
|
|
|
|
+ <Rate
|
|
|
|
+ readonly
|
|
|
|
+ modelValue={this.starGrade}
|
|
|
|
+ iconPrefix="iconfont"
|
|
|
|
+ color="#FFC459"
|
|
|
|
+ void-icon="star_default"
|
|
|
|
+ icon="star_active"
|
|
|
|
+ size={15}
|
|
|
|
+ />
|
|
|
|
+ ) : (
|
|
|
|
+ <span style={{ fontSize: '12px', color: '#999999' }}>
|
|
|
|
+ 暂无评分
|
|
|
|
+ </span>
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class={styles.piNameSubject}>
|
|
|
|
+ <Image
|
|
|
|
+ class={styles.subjectSection}
|
|
|
|
+ src={getAssetsHomeFile('icon_subject.png')}
|
|
|
|
+ fit="contain"
|
|
|
|
+ />
|
|
|
|
+ <div class={styles.subjectList}>
|
|
|
|
+ {this.subjectNameList.map((item: any) => (
|
|
|
|
+ <span class={styles.subject}>{item}</span>
|
|
|
|
+ ))}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class={styles['teacher-bottom']}>
|
|
|
|
+ <div class={styles['teacher-data']}>
|
|
|
|
+ <div class={styles['teacher-data_item']}>
|
|
|
|
+ 粉丝 <span>{this.userInfo.fansNum || 0}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class={styles['teacher-data_item']}>
|
|
|
|
+ 已上课时 <span>{this.userInfo.expTime || 0}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<Popup class={styles['teaherPopup']} v-model:show={this.iconShow}>
|
|
<Popup class={styles['teaherPopup']} v-model:show={this.iconShow}>
|