|
|
@@ -6,7 +6,7 @@ import Practice from './components/practice'
|
|
|
import Live from './components/live'
|
|
|
import VideoList from './components/video'
|
|
|
import request from '@/helpers/request'
|
|
|
-import { listenerMessage } from '@/helpers/native-message'
|
|
|
+import { listenerMessage, postMessage } from '@/helpers/native-message'
|
|
|
import { useEventListener, useWindowScroll } from '@vueuse/core'
|
|
|
import TeacherHeader from './model/teacher-header'
|
|
|
import { useRect } from '@vant/use'
|
|
|
@@ -44,16 +44,18 @@ export default defineComponent({
|
|
|
fansStatus: false,
|
|
|
fansList: [],
|
|
|
chatItem: {},
|
|
|
- chatStatus: false,
|
|
|
+ chatStatus: false
|
|
|
}
|
|
|
},
|
|
|
- async mounted() {
|
|
|
+ async mounted() {
|
|
|
postMessage({
|
|
|
api: 'setStatusBarTextColor',
|
|
|
content: { statusBarTextColor: true }
|
|
|
})
|
|
|
this.$nextTick(() => {
|
|
|
- const { height } = useRect(document.querySelector('.van-tabs__wrap') as any)
|
|
|
+ const { height } = useRect(
|
|
|
+ document.querySelector('.van-tabs__wrap') as any
|
|
|
+ )
|
|
|
this.tabsHeight = height
|
|
|
this.stickyHeight()
|
|
|
})
|
|
|
@@ -68,7 +70,7 @@ export default defineComponent({
|
|
|
listenerMessage('webViewOnResume', () => {
|
|
|
this.getTeacherDetail()
|
|
|
})
|
|
|
- useEventListener(document, 'scroll', evt => {
|
|
|
+ useEventListener(document, 'scroll', () => {
|
|
|
const { y } = useWindowScroll()
|
|
|
if (y.value > 52) {
|
|
|
this.headColor = '#000'
|
|
|
@@ -85,13 +87,13 @@ export default defineComponent({
|
|
|
methods: {
|
|
|
stickyHeight() {
|
|
|
let height = 0
|
|
|
- if(this.height === 'auto') {
|
|
|
+ if (this.height === 'auto') {
|
|
|
height = this.tabsHeight
|
|
|
} else {
|
|
|
height = this.height + this.tabsHeight
|
|
|
}
|
|
|
- this.stickyHeightNum = height;
|
|
|
- (this.$refs.musicListRef as any)?.updateStickyHeight(height)
|
|
|
+ this.stickyHeightNum = height
|
|
|
+ ;(this.$refs.musicListRef as any)?.updateStickyHeight(height)
|
|
|
},
|
|
|
async getTeacherDetail() {
|
|
|
try {
|
|
|
@@ -105,12 +107,15 @@ export default defineComponent({
|
|
|
},
|
|
|
async getFansList() {
|
|
|
try {
|
|
|
- const res = await request.post('/api-student/imGroup/queryTeacherGroup', {
|
|
|
- data: {
|
|
|
- type: 'FAN',
|
|
|
- createUserId: this.teacherId
|
|
|
+ const res = await request.post(
|
|
|
+ '/api-student/imGroup/queryTeacherGroup',
|
|
|
+ {
|
|
|
+ data: {
|
|
|
+ type: 'FAN',
|
|
|
+ createUserId: this.teacherId
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+ )
|
|
|
this.fansList = res.data || []
|
|
|
} catch {}
|
|
|
},
|
|
|
@@ -123,6 +128,12 @@ export default defineComponent({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ beforeUnmount() {
|
|
|
+ postMessage({
|
|
|
+ api: 'setStatusBarTextColor',
|
|
|
+ content: { statusBarTextColor: false }
|
|
|
+ })
|
|
|
+ },
|
|
|
render() {
|
|
|
return (
|
|
|
<div class={styles['teacher-record']}>
|
|
|
@@ -156,31 +167,39 @@ export default defineComponent({
|
|
|
|
|
|
<div class={styles.singleSection}>
|
|
|
<div class={styles.btnType}>
|
|
|
- <div class={styles.btn1} onClick={() => {
|
|
|
- this.$router.push({
|
|
|
- path: '/teacher-style',
|
|
|
- query: {
|
|
|
- teacherId: this.teacherId
|
|
|
- }
|
|
|
- })
|
|
|
- }}>
|
|
|
+ <div
|
|
|
+ class={styles.btn1}
|
|
|
+ onClick={() => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/teacher-style',
|
|
|
+ query: {
|
|
|
+ teacherId: this.teacherId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ >
|
|
|
<img src={getAssetsHomeFile('icon1.png')} />
|
|
|
个人风采
|
|
|
</div>
|
|
|
- <div class={styles.btn2} onClick={async () => {
|
|
|
- if(this.fansList.length <= 0) {
|
|
|
- await this.getFansList()
|
|
|
- }
|
|
|
- this.fansStatus = true
|
|
|
- }}>
|
|
|
+ <div
|
|
|
+ class={styles.btn2}
|
|
|
+ onClick={async () => {
|
|
|
+ if (this.fansList.length <= 0) {
|
|
|
+ await this.getFansList()
|
|
|
+ }
|
|
|
+ this.fansStatus = true
|
|
|
+ }}
|
|
|
+ >
|
|
|
<img src={getAssetsHomeFile('icon2.png')} />
|
|
|
粉丝群
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- {this.userInfo.introduction && <div class={styles.singleContent}>
|
|
|
- {this.userInfo.introduction}
|
|
|
- </div>}
|
|
|
+ {this.userInfo.introduction && (
|
|
|
+ <div class={styles.singleContent}>
|
|
|
+ {this.userInfo.introduction}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
</div>
|
|
|
<Tabs
|
|
|
@@ -189,6 +208,7 @@ export default defineComponent({
|
|
|
shrink
|
|
|
lineWidth={44}
|
|
|
sticky
|
|
|
+ // swipeable
|
|
|
offsetTop={this.height}
|
|
|
v-model:active={this.tabs}
|
|
|
onChange={() => {
|
|
|
@@ -202,9 +222,7 @@ export default defineComponent({
|
|
|
</Tab> */}
|
|
|
<Tab title="VIP定制课" name="vip">
|
|
|
<div style={{ minHeight: this.homeContaiterHeight }}>
|
|
|
- {this.tabs === 'vip' && (
|
|
|
- <Vip userInfo={this.userInfo} />
|
|
|
- )}
|
|
|
+ {this.tabs === 'vip' && <Vip userInfo={this.userInfo} />}
|
|
|
</div>
|
|
|
</Tab>
|
|
|
<Tab title="趣纠课" name="practice">
|
|
|
@@ -225,10 +243,11 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</Tab>
|
|
|
<Tab title="视频课" name="video">
|
|
|
- {this.tabs === 'video' && <VideoList />}
|
|
|
+ {this.tabs === 'video' && <VideoList />}
|
|
|
</Tab>
|
|
|
<Tab title="乐谱" name="music">
|
|
|
- {this.tabs === 'music' && <MusicList
|
|
|
+ {this.tabs === 'music' && (
|
|
|
+ <MusicList
|
|
|
hideSearch
|
|
|
onlySearch
|
|
|
myself
|
|
|
@@ -237,15 +256,23 @@ export default defineComponent({
|
|
|
onItemClick={this.onItemClick}
|
|
|
teacherId={this.teacherId}
|
|
|
/>
|
|
|
- }
|
|
|
+ )}
|
|
|
</Tab>
|
|
|
</Tabs>
|
|
|
|
|
|
- <Popup show={this.fansStatus} class={styles.fansPopup} closeable onClose={() => this.fansStatus = false}>
|
|
|
- <FansList fansList={this.fansList} onConfirm={(item: any) => {
|
|
|
- this.chatStatus = true
|
|
|
- this.chatItem = item
|
|
|
- }} />
|
|
|
+ <Popup
|
|
|
+ show={this.fansStatus}
|
|
|
+ class={styles.fansPopup}
|
|
|
+ closeable
|
|
|
+ onClose={() => (this.fansStatus = false)}
|
|
|
+ >
|
|
|
+ <FansList
|
|
|
+ fansList={this.fansList}
|
|
|
+ onConfirm={(item: any) => {
|
|
|
+ this.chatStatus = true
|
|
|
+ this.chatItem = item
|
|
|
+ }}
|
|
|
+ />
|
|
|
</Popup>
|
|
|
|
|
|
<Popup
|