index.tsx 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import Pagination from '@/components/pagination'
  2. import { state } from '@/state'
  3. import { ElButton, ElMessage, ElTabPane, ElTabs } from 'element-plus'
  4. import { defineComponent } from 'vue'
  5. import Item from '../components/item'
  6. import styles from './index.module.less'
  7. import List from './list'
  8. export default defineComponent({
  9. name: 'live-class',
  10. data() {
  11. return {
  12. activeName: 'ING'
  13. }
  14. },
  15. render() {
  16. return (
  17. <div class={[styles.liveClass, 'relative px-[25px]']}>
  18. <ElButton
  19. round
  20. type="primary"
  21. class="absolute right-11 top-3 z-10"
  22. onClick={() => {
  23. // 直播课需要达人认证和开通直播
  24. if (state.user.data?.entryFlag && state.user.data?.liveFlag) {
  25. this.$router.push({
  26. path: '/userInfo/liveOperation',
  27. query: {
  28. type: 'create'
  29. }
  30. })
  31. } else {
  32. if (!state.user.data?.entryFlag) {
  33. ElMessage.error('您还未完成达人认证,认证后才可创建视频课')
  34. return
  35. }
  36. if (!state.user.data?.liveFlag) {
  37. ElMessage.error('您尚未开通直播服务,开通后即可创建直播课程')
  38. return
  39. }
  40. }
  41. }}
  42. >
  43. 新建课程
  44. </ElButton>
  45. <ElTabs v-model={this.activeName}>
  46. <ElTabPane label="进行中" name="ING">
  47. {this.activeName === 'ING' && <List groupStatus="ING" />}
  48. </ElTabPane>
  49. <ElTabPane label="未上架" name="NOT_SALE">
  50. {this.activeName === 'NOT_SALE' && <List groupStatus="NOT_SALE" />}
  51. </ElTabPane>
  52. <ElTabPane label="销售中" name="APPLY">
  53. {this.activeName === 'APPLY' && <List groupStatus="APPLY" />}
  54. </ElTabPane>
  55. <ElTabPane label="已完成" name="COMPLETE">
  56. {this.activeName === 'COMPLETE' && <List groupStatus="COMPLETE" />}
  57. </ElTabPane>
  58. <ElTabPane label="已取消" name="CANCEL">
  59. {this.activeName === 'CANCEL' && <List groupStatus="CANCEL" />}
  60. </ElTabPane>
  61. </ElTabs>
  62. {/* 课程组状态 ING(进行中) NOT_SALE(未开售,未上架) APPLY(报名中,销售中)
  63. COMPLETE(已完成) CANCEL(已取消) */}
  64. </div>
  65. )
  66. }
  67. })