|
@@ -1,16 +1,17 @@
|
|
|
-import { defineComponent } from "vue";
|
|
|
-import { Button, Cell, Icon, Image, Rate, Sticky, Toast } from "vant";
|
|
|
-import ColHeader from "@/components/col-header";
|
|
|
-import styles from './index.module.less';
|
|
|
-import { state } from '@/state';
|
|
|
+import { defineComponent } from 'vue'
|
|
|
+import { Button, Cell, Icon, Image, Rate, Sticky, Toast } from 'vant'
|
|
|
+import ColHeader from '@/components/col-header'
|
|
|
+import styles from './index.module.less'
|
|
|
+import { state } from '@/state'
|
|
|
|
|
|
-import tips from './images/icon_tips.png';
|
|
|
-import banner1 from './images/1.png';
|
|
|
-import banner2 from './images/2.png';
|
|
|
-import banner3 from './images/3.png';
|
|
|
-import iconTeacher from '@common/images/icon_teacher.png';
|
|
|
+import tips from './images/icon_tips.png'
|
|
|
+import banner1 from './images/1.png'
|
|
|
+import banner2 from './images/2.png'
|
|
|
+import banner3 from './images/3.png'
|
|
|
+import iconTeacher from '@common/images/icon_teacher.png'
|
|
|
|
|
|
-import request from "@/helpers/request";
|
|
|
+import request from '@/helpers/request'
|
|
|
+import ColResult from '@/components/col-result'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'live-cert',
|
|
@@ -26,12 +27,17 @@ export default defineComponent({
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|
|
|
+ const liveFlag = state.user.data?.liveFlag
|
|
|
+ state.openLiveStatus = liveFlag === 1 ? true : false
|
|
|
try {
|
|
|
- const res = await request.get('/api-teacher/sysConfig/list', {
|
|
|
- params: {
|
|
|
- group: 'OTHER'
|
|
|
+ const res = await request.get(
|
|
|
+ '/api-teacher/sysConfig/queryByParamNameList',
|
|
|
+ {
|
|
|
+ params: {
|
|
|
+ paramNames: 'open_live_fans_num,open_list_over_class'
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+ )
|
|
|
const result = res.data
|
|
|
result.forEach((item: any) => {
|
|
|
if (item.paramName === 'open_live_fans_num') {
|
|
@@ -39,7 +45,7 @@ export default defineComponent({
|
|
|
} else if (item.paramName === 'open_list_over_class') {
|
|
|
this.overClassNum = item.paramValue
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -51,7 +57,7 @@ export default defineComponent({
|
|
|
Toast('开通成功')
|
|
|
setTimeout(() => {
|
|
|
postMessage({ api: 'back' })
|
|
|
- }, 1000);
|
|
|
+ }, 1000)
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -59,68 +65,127 @@ export default defineComponent({
|
|
|
},
|
|
|
render() {
|
|
|
return (
|
|
|
- <div class={styles['open-live']}>
|
|
|
- <ColHeader v-slots={{
|
|
|
- content: () => (
|
|
|
- <Sticky>
|
|
|
- <div class={styles['header-content']}>
|
|
|
- <Button round plain size="small" disabled={!this.users.liveFlag} class={styles.openBtn} onClick={this.onOpenLive}>开通直播</Button>
|
|
|
+ <>
|
|
|
+ {state.openLiveStatus ? (
|
|
|
+ <ColResult
|
|
|
+ classImgSize="CERT"
|
|
|
+ type="liveCert"
|
|
|
+ style={{ paddingTop: '60px' }}
|
|
|
+ tips={'开通成功,快去开启直播或创建直播课吧'}
|
|
|
+ />
|
|
|
+ ) : (
|
|
|
+ <div class={styles['open-live']}>
|
|
|
+ <ColHeader
|
|
|
+ v-slots={{
|
|
|
+ content: (navBarHeight: any) => (
|
|
|
+ <Sticky offsetTop={navBarHeight}>
|
|
|
+ <div class={styles['header-content']}>
|
|
|
+ <Button
|
|
|
+ round
|
|
|
+ plain
|
|
|
+ size="small"
|
|
|
+ disabled={!this.users.liveFlag}
|
|
|
+ class={styles.openBtn}
|
|
|
+ onClick={this.onOpenLive}
|
|
|
+ >
|
|
|
+ 开通直播
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </Sticky>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ ></ColHeader>
|
|
|
+
|
|
|
+ <Cell
|
|
|
+ class={styles['open-teacher-info']}
|
|
|
+ border={false}
|
|
|
+ v-slots={{
|
|
|
+ icon: () => (
|
|
|
+ <Image
|
|
|
+ class={styles.userLogo}
|
|
|
+ src={this.users?.headUrl || iconTeacher}
|
|
|
+ fit="cover"
|
|
|
+ />
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <div class={styles['teacher-info']}>
|
|
|
+ <div class={styles['teacher-name']}>{this.users?.username}</div>
|
|
|
+ <div class={styles.level}>
|
|
|
+ <Rate
|
|
|
+ modelValue={this.users?.starGrade}
|
|
|
+ iconPrefix="iconfont"
|
|
|
+ color="#FFC459"
|
|
|
+ void-icon="star_default"
|
|
|
+ icon="star_active"
|
|
|
+ size={15}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </Sticky>
|
|
|
- )
|
|
|
- }}>
|
|
|
- </ColHeader>
|
|
|
+ <div class={styles['teacher-desc']}>
|
|
|
+ <div class={styles.teacherItem}>
|
|
|
+ <div class={styles.title}>
|
|
|
+ {this.users?.fansNum}/{this.fansNum}
|
|
|
+ </div>
|
|
|
+ <div class={styles.content}>粉丝</div>
|
|
|
+ </div>
|
|
|
+ <div class={styles.teacherItem} style={{ textAlign: 'right' }}>
|
|
|
+ <div class={styles.title}>
|
|
|
+ {this.users?.expTime}/{this.overClassNum}
|
|
|
+ </div>
|
|
|
+ <div class={styles.content}>已上课时</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Cell>
|
|
|
|
|
|
- <Cell class={styles['open-teacher-info']} border={false} v-slots={{
|
|
|
- icon: () => (<Image class={styles.userLogo} src={this.users?.headUrl || iconTeacher} fit="cover" />)
|
|
|
- }}>
|
|
|
- <div class={styles['teacher-info']}>
|
|
|
- <div class={styles['teacher-name']}>{this.users?.username}</div>
|
|
|
- <div class={styles.level}>
|
|
|
- <Rate modelValue={this.users?.starGrade} iconPrefix="iconfont" color="#FFC459" void-icon="star_default" icon="star_active" size={15} />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class={styles['teacher-desc']}>
|
|
|
- <div class={styles.teacherItem}>
|
|
|
- <div class={styles.title}>{this.users?.fansNum}/{this.fansNum}</div>
|
|
|
- <div class={styles.content}>粉丝</div>
|
|
|
- </div>
|
|
|
- <div class={styles.teacherItem} style={{ textAlign: 'right' }}>
|
|
|
- <div class={styles.title}>{this.users?.expTime}/{this.overClassNum}</div>
|
|
|
- <div class={styles.content}>已上课时</div>
|
|
|
+ {!this.users.liveFlag ? (
|
|
|
+ <div class={styles['open-tips']}>
|
|
|
+ <Icon name={tips} size="16" />
|
|
|
+ <p>你尚未达到开通直播的条件</p>
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ <div class={styles['open-content']}>
|
|
|
+ <h2>开通直播能为您带来什么?</h2>
|
|
|
+ <p class={styles['cert-text']}>
|
|
|
+ 酷乐秀对平台入驻的优秀老师开放直播及直播课程的功能,帮助老师拓展获客渠道及教学场景。
|
|
|
+ </p>
|
|
|
+ <p class={styles['cert-img']}>
|
|
|
+ <Image
|
|
|
+ src={banner1}
|
|
|
+ width="100%"
|
|
|
+ height="150px"
|
|
|
+ fit="contain"
|
|
|
+ />
|
|
|
+ </p>
|
|
|
+ <h2>直播</h2>
|
|
|
+ <p class={styles['cert-text']}>
|
|
|
+ 开通直播功能后,您可以创建自己的直播间开启直播。
|
|
|
+ </p>
|
|
|
+ <p class={styles['cert-img']}>
|
|
|
+ <Image
|
|
|
+ src={banner2}
|
|
|
+ width="100%"
|
|
|
+ height="150px"
|
|
|
+ fit="contain"
|
|
|
+ />
|
|
|
+ </p>
|
|
|
+ <h2>直播课</h2>
|
|
|
+ <p class={styles['cert-text']}>
|
|
|
+ 您可制定教学方案设置直播课程,学员购买后,您可在直播间对购买直播课的学员进行直播教学,直播课程无人数上限,可极大的提高课程收入。
|
|
|
+ </p>
|
|
|
+ <p class={styles['cert-img']}>
|
|
|
+ <Image
|
|
|
+ src={banner3}
|
|
|
+ width="100%"
|
|
|
+ height="150px"
|
|
|
+ fit="contain"
|
|
|
+ />
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </Cell>
|
|
|
-
|
|
|
- {!this.users.liveFlag ? <div class={styles['open-tips']}>
|
|
|
- <Icon name={tips} size="16" />
|
|
|
- <p>你尚未达到开通直播的条件</p>
|
|
|
- </div> : null}
|
|
|
-
|
|
|
- <div class={styles['open-content']}>
|
|
|
- <h2>开通直播能为您带来什么?</h2>
|
|
|
- <p class={styles['cert-text']}>
|
|
|
- 酷乐秀对平台入驻的优秀老师开放直播及直播课程的功能,帮助老师拓展获客渠道及教学场景。
|
|
|
- </p>
|
|
|
- <p class={styles['cert-img']}>
|
|
|
- <Image src={banner1} width="100%" height="150px" fit="contain" />
|
|
|
- </p>
|
|
|
- <h2>直播</h2>
|
|
|
- <p class={styles['cert-text']}>
|
|
|
- 开通直播功能后,您可以创建自己的直播间开启直播。
|
|
|
- </p>
|
|
|
- <p class={styles['cert-img']}>
|
|
|
- <Image src={banner2} width="100%" height="150px" fit="contain" />
|
|
|
- </p>
|
|
|
- <h2>直播课</h2>
|
|
|
- <p class={styles['cert-text']}>
|
|
|
- 您可制定教学方案设置直播课程,学员购买后,您可在直播间对购买直播课的学员进行直播教学,直播课程无人数上限,可极大的提高课程收入。
|
|
|
- </p>
|
|
|
- <p class={styles['cert-img']}>
|
|
|
- <Image src={banner3} width="100%" height="150px" fit="contain" />
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ )}
|
|
|
+ </>
|
|
|
)
|
|
|
}
|
|
|
-})
|
|
|
+})
|