Browse Source

更新状态等

lex-xin 2 years ago
parent
commit
67b9d7bb24

+ 9 - 0
README.md

@@ -62,6 +62,15 @@ postMessage({ api: 'chooseFile', content: {
   <!-- fileUrl。 如果是视频 firstFrameImg -->
 })
 
+### 获取某个目录下面的图片对象
+export const getAssetsHomeFile = (fileName: string) => {
+  const path = `../images/${fileName}`
+  const modules = import.meta.globEager('../images/*')
+  return modules[path].default
+}
+- 需要带上图片后辍
+getAssetsHomeFile('xxx.png')
+
 ### Rem Unit (default)
 
 Vant uses `px` unit by default,You can use tools such as `postcss-pxtorem` to transform `px` unit to `rem` unit.

+ 2 - 2
index.html

@@ -38,8 +38,8 @@
 
 <body>
   <div id="app"></div>
-  <script type="module" src="/src/student/main.ts"></script>
-  <!-- <script type="module" src="/src/teacher/main.ts"></script> -->
+  <!-- <script type="module" src="/src/student/main.ts"></script> -->
+  <script type="module" src="/src/teacher/main.ts"></script>
 </body>
 
 </html>

+ 18 - 15
package-lock.json

@@ -3047,16 +3047,22 @@
       }
     },
     "browserslist": {
-      "version": "4.17.5",
-      "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.17.5.tgz",
-      "integrity": "sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA==",
-      "dev": true,
+      "version": "4.20.2",
+      "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.20.2.tgz",
+      "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==",
       "requires": {
-        "caniuse-lite": "^1.0.30001271",
-        "electron-to-chromium": "^1.3.878",
+        "caniuse-lite": "^1.0.30001317",
+        "electron-to-chromium": "^1.4.84",
         "escalade": "^3.1.1",
-        "node-releases": "^2.0.1",
+        "node-releases": "^2.0.2",
         "picocolors": "^1.0.0"
+      },
+      "dependencies": {
+        "caniuse-lite": {
+          "version": "1.0.30001332",
+          "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001332.tgz",
+          "integrity": "sha512-10T30NYOEQtN6C11YGg411yebhvpnC6Z102+B95eAsN0oB6KUs01ivE8u+G6FMIRtIrVlYXhL+LUwQ3/hXwDWw=="
+        }
       }
     },
     "buffer": {
@@ -3560,8 +3566,7 @@
     "electron-to-chromium": {
       "version": "1.4.85",
       "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.85.tgz",
-      "integrity": "sha512-K9AsQ41WS2bjZUFpRWfvaS4RjEcRCamEkBJN1Z1TQILBfP1H8QnJ9ti0wiLiMv0sRjX3EHKzgs9jDnmGFx2jXg==",
-      "dev": true
+      "integrity": "sha512-K9AsQ41WS2bjZUFpRWfvaS4RjEcRCamEkBJN1Z1TQILBfP1H8QnJ9ti0wiLiMv0sRjX3EHKzgs9jDnmGFx2jXg=="
     },
     "emmet": {
       "version": "2.3.6",
@@ -3775,8 +3780,7 @@
     "escalade": {
       "version": "3.1.1",
       "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.1.1.tgz",
-      "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
-      "dev": true
+      "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
     },
     "escape-string-regexp": {
       "version": "1.0.5",
@@ -5448,10 +5452,9 @@
       }
     },
     "node-releases": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.1.tgz",
-      "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
-      "dev": true
+      "version": "2.0.3",
+      "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.3.tgz",
+      "integrity": "sha512-maHFz6OLqYxz+VQyCAtA3PTX4UP/53pa05fyDNc9CwjvJ0yEh6+xBwKsgCxMNhS8taUKBFYxfuiaD9U/55iFaw=="
     },
     "normalize-path": {
       "version": "3.0.0",

+ 1 - 0
package.json

@@ -22,6 +22,7 @@
   },
   "dependencies": {
     "@vant/use": "^1.3.6",
+    "browserslist": "^4.20.2",
     "clean-deep": "^3.4.0",
     "dayjs": "^1.10.7",
     "loaders.css": "^0.1.2",

+ 17 - 16
src/business-components/user-detail/index.tsx

@@ -55,22 +55,23 @@ export default defineComponent({
             title={this.userInfo.lessonName}
             titleClass={styles.userTitle}
             v-slots={{
-              label: () => (
-                <span
-                  style={{
-                    display: 'flex',
-                    alignItems: 'center',
-                    fontSize: '13px'
-                  }}
-                >
-                  <Icon
-                    name={iconTimer}
-                    size="16"
-                    style={{ marginRight: '5px' }}
-                  />
-                  2022年4月18日13:58:55
-                </span>
-              )
+              label: () =>
+                this.userInfo.startTime && (
+                  <span
+                    style={{
+                      display: 'flex',
+                      alignItems: 'center',
+                      fontSize: '13px'
+                    }}
+                  >
+                    <Icon
+                      name={iconTimer}
+                      size="16"
+                      style={{ marginRight: '5px' }}
+                    />
+                    {this.userInfo.startTime}
+                  </span>
+                )
             }}
           />
           <Cell

BIN
src/common/images/404.png


BIN
src/common/images/icon_nodata.png


+ 1 - 0
src/components/col-header/index.module.less

@@ -12,4 +12,5 @@
 
 .headerSection {
   min-height: var(--van-nav-bar-height);
+  position: relative;
 }

+ 1 - 1
src/components/col-header/index.tsx

@@ -101,7 +101,7 @@ export default defineComponent({
             style={{ paddingTop: `${this.navBarHeight}px` }}
             class={styles.headerSection}
           >
-            {this.$slots.content()}
+            {this.$slots.content(this.navBarHeight)}
           </div>
         ) : (
           <>

BIN
src/components/col-result/images/empty.png


BIN
src/components/col-result/images/emptyContent.png


BIN
src/components/col-result/images/liveCert.png


BIN
src/components/col-result/images/musicCert.png


BIN
src/components/col-result/images/network.png


BIN
src/components/col-result/images/teacherCert.png


+ 13 - 1
src/components/col-result/index.module.less

@@ -11,4 +11,16 @@
     width: 90%;
     margin: 0 auto;
   }
-}
+
+  .CERT {
+    :global {
+      .van-empty__image {
+        width: 260px;
+        height: 230px;
+      }
+      .van-empty__description {
+        padding: 0 30px;
+      }
+    }
+  }
+}

+ 81 - 12
src/components/col-result/index.tsx

@@ -1,9 +1,14 @@
-import { defineComponent } from "vue";
-import styles from './index.module.less';
-import empty from '@common/images/icon_nodata.png';
-import { Button, Empty, Image } from "vant";
-import { postMessage } from "@/helpers/native-message";
+import { defineComponent, PropType } from 'vue'
+import styles from './index.module.less'
+import empty from '@common/images/icon_nodata.png'
+import { Button, Empty, Image } from 'vant'
+import { postMessage } from '@/helpers/native-message'
 
+export const getAssetsHomeFile = (fileName: string) => {
+  const path = `./images/${fileName}`
+  const modules = import.meta.globEager('./images/*')
+  return modules[path].default
+}
 
 export default defineComponent({
   name: 'col-result',
@@ -11,9 +16,27 @@ export default defineComponent({
     tips: {
       type: String
     },
-    img: {
-      type: String,
-      default: empty
+    type: {
+      // 空 | 老师认证 | 音乐人认证 | 直播认证
+      type: String as PropType<
+        | 'empty'
+        | 'teacherCert'
+        | 'musicCert'
+        | 'liveCert'
+        | 'error'
+        | 'network'
+        | 'search'
+        | 'emptyContent'
+      >,
+      default: 'empty'
+    },
+    classImgSize: {
+      type: String as PropType<'CERT'>,
+      default: ''
+    },
+    imageSize: {
+      type: [String, Number],
+      default: ''
     },
     btnStatus: {
       type: Boolean,
@@ -27,23 +50,69 @@ export default defineComponent({
   },
   methods: {
     onResult() {
-      if(this.onClick) {
+      if (this.onClick) {
         this.onClick()
       } else {
         postMessage({ api: 'back', content: {} })
       }
     }
   },
+  computed: {
+    image() {
+      let image = null as any
+      switch (this.type) {
+        case 'teacherCert':
+          image = getAssetsHomeFile('teacherCert.png')
+          break
+        case 'musicCert':
+          image = getAssetsHomeFile('musicCert.png')
+          break
+        case 'liveCert':
+          image = getAssetsHomeFile('liveCert.png')
+          break
+        case 'emptyContent':
+          image = getAssetsHomeFile('emptyContent.png')
+          break
+        case 'error':
+          image = 'error'
+          break
+        case 'network':
+          image = getAssetsHomeFile('network.png')
+          break
+        case 'search':
+          image = 'search'
+          break
+        default:
+          image = getAssetsHomeFile('empty.png')
+          break
+      }
+      return image
+    }
+  },
   render() {
     return (
       <div class={styles['col-result']}>
         {/* <Image fit="cover" width="100%" src={this.img} /> */}
-        <Empty description={this.tips } />
+        <Empty
+          image={this.image}
+          class={styles[this.classImgSize]}
+          description={this.tips}
+        />
 
         {/* { this.tips && <p class={styles.tips}>{ this.tips }</p> } */}
 
-        { this.btnStatus ? <Button class={styles.btn} round block type="primary" onClick={this.onResult}>{this.buttonText}</Button> : null }
+        {this.btnStatus ? (
+          <Button
+            class={styles.btn}
+            round
+            block
+            type="primary"
+            onClick={this.onResult}
+          >
+            {this.buttonText}
+          </Button>
+        ) : null}
       </div>
     )
   }
-})
+})

+ 1 - 1
src/router/routes-teacher.ts

@@ -99,7 +99,7 @@ export default [
         name: 'liveCreate',
         component: () => import('@/teacher/live-class/create'),
         meta: {
-          title: '视频课详情'
+          title: '创建直播课'
         }
       }
     ]

+ 17 - 16
src/state.ts

@@ -1,31 +1,32 @@
-import { reactive } from 'vue';
+import { reactive } from 'vue'
 
-type status = 'init' | 'login' | 'logout' | 'error';
+type status = 'init' | 'login' | 'logout' | 'error'
 
 export const state = reactive({
   user: {
     status: 'init' as status,
     data: {} as any
   },
-  musicCertStatus: false as boolean // 是否音乐认证
-});
+  musicCertStatus: false as boolean, // 是否音乐认证
+  openLiveStatus: false as boolean // 是否开通直播
+})
 
 export const setLoginInit = () => {
-  state.user.status = 'init';
-  state.user.data = null;
-};
+  state.user.status = 'init'
+  state.user.data = null
+}
 
 export const setLogin = (data: any) => {
-  state.user.status = 'login';
-  state.user.data = data;
-};
+  state.user.status = 'login'
+  state.user.data = data
+}
 
 export const setLogout = () => {
-  state.user.status = 'logout';
-  state.user.data = null;
-};
+  state.user.status = 'logout'
+  state.user.data = null
+}
 
 export const setLoginError = () => {
-  state.user.status = 'error';
-  state.user.data = null;
-};
+  state.user.status = 'error'
+  state.user.data = null
+}

+ 30 - 23
src/teacher/layout/auth.tsx

@@ -1,26 +1,27 @@
-import { defineComponent } from "vue";
-import styles from './auth.module.less';
-import { state, setLogin } from '@/state';
-import { browser, setAuth } from "@/helpers/utils";
-import { postMessage } from "@/helpers/native-message";
-import { RouterView } from "vue-router";
-import { Button, Icon } from "vant";
-import request from "@/helpers/request";
+import { defineComponent } from 'vue'
+import styles from './auth.module.less'
+import { state, setLogin } from '@/state'
+import { browser, setAuth } from '@/helpers/utils'
+import { postMessage } from '@/helpers/native-message'
+import { RouterView } from 'vue-router'
+import { Button, Icon } from 'vant'
+import request from '@/helpers/request'
 
 export default defineComponent({
-  name: "Auth",
+  name: 'Auth',
   data() {
     return {
-      loading: false as boolean,
+      loading: false as boolean
     }
   },
   computed: {
     isNeedView() {
-      return state.user.status === 'login' || this.$route.path === '/login';
+      return state.user.status === 'login' || this.$route.path === '/login'
     }
   },
   mounted() {
-    this.setAuth();
+    this.setAuth()
+    // state.user.status = 'error'
   },
   methods: {
     async setAuth() {
@@ -32,11 +33,11 @@ export default defineComponent({
       if (this.loading) {
         return
       }
-      if ((state.user.status === 'init' || state.user.status === 'error')) {
+      if (state.user.status === 'init' || state.user.status === 'error') {
         this.loading = true
         try {
           let res = await request.get('/api-teacher/teacher/queryUserInfo', {
-            requestType: "form",
+            requestType: 'form',
             initRequest: true // 初始化接口
           })
           // console.log(res)
@@ -54,8 +55,8 @@ export default defineComponent({
             let route = this.$route
             let query = {
               returnUrl: this.$route.path,
-              ...this.$route.query,
-            } as any;
+              ...this.$route.query
+            } as any
             if (route.meta.isRegister) {
               query.isRegister = route.meta.isRegister
             }
@@ -63,7 +64,7 @@ export default defineComponent({
               path: '/login',
               query: query
             })
-          } catch (error) { }
+          } catch (error) {}
         }
       }
     }
@@ -71,13 +72,19 @@ export default defineComponent({
   render() {
     return (
       <>
-        {state.user.status === 'error' ? <div class={styles.error}>
-          <div class={styles.info}>
-            <Icon name="clear" size="36" color="#ee0a24" />
-            <span>加载失败,请重新尝试</span>
+        {state.user.status === 'error' ? (
+          <div class={styles.error}>
+            <div class={styles.info}>
+              <Icon name="clear" size="36" color="#ee0a24" />
+              <span>加载失败,请重新尝试</span>
+            </div>
+            <Button type="primary" round onClick={this.setAuth}>
+              重新加载
+            </Button>
           </div>
-          <Button type="primary" round onClick={this.setAuth}>重新加载</Button>
-        </div> : this.isNeedView ? <RouterView></RouterView> : null}
+        ) : this.isNeedView ? (
+          <RouterView></RouterView>
+        ) : null}
       </>
     )
   }

+ 14 - 8
src/teacher/live-class/create-components/detail.tsx

@@ -8,15 +8,26 @@ import { defineComponent } from 'vue'
 import { createState } from './createState'
 import styles from './detail.module.less'
 import dayjs from 'dayjs'
-
+import { postMessage } from '@/helpers/native-message'
+interface IProps {
+  courseTime: string
+  coursePlan: string
+  videoPosterUrl?: string
+  id?: number | string
+}
 export default defineComponent({
   name: 'detail',
   computed: {
     userInfo() {
+      const startTime = createState.live.coursePlanList[0].startTime
+      const endTime = createState.live.coursePlanList[0].endTime
       return {
         headUrl: state.user.data?.headUrl,
         username: state.user.data?.username,
-        startTime: createState.live.coursePlanList[0].startTime || '',
+        startTime:
+          `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(startTime).format(
+            'HH:mm'
+          )}~${dayjs(endTime).format('HH:mm')}` || '',
         buyNum: 0,
         lessonPrice: createState.live.coursePrice,
         lessonNum: createState.live.courseNum,
@@ -28,12 +39,6 @@ export default defineComponent({
       }
     },
     courseInfo() {
-      interface IProps {
-        courseTime: string
-        coursePlan: string
-        videoPosterUrl?: string
-        id?: number | string
-      }
       let tempArr = [] as IProps[]
       const coursePlanList = createState.live.coursePlanList || []
       coursePlanList.forEach((item: any) => {
@@ -52,6 +57,7 @@ export default defineComponent({
       try {
         const params = {
           ...createState.live,
+          startTime: createState.live.coursePlanList[0].startTime,
           backgroundPic:
             createState.live.backgroundPic ||
             createState.live.backgroundPicTemplate,

+ 70 - 6
src/teacher/live-class/live-detail.tsx

@@ -2,20 +2,84 @@ import CoursePlanStep from '@/business-components/course-plan-step'
 import SectionDetail from '@/business-components/section-detail'
 import UserDetail from '@/business-components/user-detail'
 import UserList from '@/business-components/user-list'
+import request from '@/helpers/request'
+import { state } from '@/state'
+import dayjs from 'dayjs'
 import { Tab, Tabs } from 'vant'
 import { defineComponent } from 'vue'
 import styles from './live-detail.module.less'
-
+interface IProps {
+  courseTime: string
+  coursePlan: string
+  videoPosterUrl?: string
+  id?: number | string
+}
 export default defineComponent({
   name: 'LiveDetail',
+  data() {
+    const query = this.$route.query
+    return {
+      groupId: query.groupId,
+      live: {} as any
+    }
+  },
+  computed: {
+    userInfo() {
+      const live = this.live as any
+      const planList = live.planList || []
+      const startTime = planList?.startTime || new Date()
+      const endTime = planList?.endTime || new Date()
+      return {
+        headUrl: state.user.data?.headUrl,
+        username: state.user.data?.username,
+        startTime:
+          `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(startTime).format(
+            'HH:mm'
+          )}~${dayjs(endTime).format('HH:mm')}` || '',
+        buyNum: 0,
+        lessonPrice: live.coursePrice,
+        lessonNum: live.courseNum,
+        lessonDesc: live.courseIntroduce,
+        lessonCoverUrl: live.backgroundPic || live.backgroundPicTemplate,
+        lessonName: live.courseGroupName
+      }
+    },
+    courseInfo() {
+      let tempArr = [] as IProps[]
+      const coursePlanList = this.live.planList || []
+      coursePlanList.forEach((item: any) => {
+        const startTime = item.startTime || new Date()
+        const endTime = item.endTime || new Date()
+        tempArr.push({
+          courseTime: `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(
+            startTime
+          ).format('HH:mm')}~${dayjs(endTime).format('HH:mm')}`,
+          coursePlan: item.plan
+        })
+      })
+      return tempArr || []
+    }
+  },
+  async mounted() {
+    try {
+      const res = await request.get(
+        '/api-teacher/courseGroup/queryLiveCourseInfo',
+        {
+          params: {
+            groupId: this.groupId
+          }
+        }
+      )
+      console.log(res)
+      this.live = res.data || []
+    } catch {}
+  },
   render() {
     return (
       <div class={[styles['live-detail'], 'mb12']}>
-        {/* <UserDetail /> */}
+        <UserDetail userInfo={this.userInfo} />
         <SectionDetail>
-          <p class={styles.introduction}>
-            小酷老师带您零基础学习竖笛,通过4节课的学习掌握竖笛演奏的基本方式,培养娘好的吐息习惯。
-          </p>
+          <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
         </SectionDetail>
 
         <SectionDetail
@@ -26,7 +90,7 @@ export default defineComponent({
         >
           <Tabs color="var(--van-primary)" lineWidth={20} sticky>
             <Tab title="全部课程" titleClass="van-hairline--bottom">
-              <CoursePlanStep />
+              <CoursePlanStep courseInfo={this.courseInfo} />
             </Tab>
             <Tab title="已购课程" titleClass="van-hairline--bottom">
               {[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3].map(

+ 64 - 24
src/teacher/music-cert/index.tsx

@@ -1,10 +1,10 @@
-import { postMessage } from "@/helpers/native-message";
-import { defineComponent } from "vue";
-import { Button, Image, Sticky, Toast } from 'vant';
-import styles from './index.module.less';
-import request from "@/helpers/request";
-import { state } from "@/state";
-import ColResult from "@/components/col-result";
+import { postMessage } from '@/helpers/native-message'
+import { defineComponent } from 'vue'
+import { Button, Image, Sticky, Toast } from 'vant'
+import styles from './index.module.less'
+import request from '@/helpers/request'
+import { state } from '@/state'
+import ColResult from '@/components/col-result'
 // import ColHeader from "@/components/col-header";
 
 /**
@@ -28,9 +28,16 @@ export default defineComponent({
   mounted() {
     postMessage({ api: 'setBarStatus', content: { status: 0 } })
     // 音乐人审核状态 0、未申请 UNPAALY、已申请 DOING、审核中 PASS、通过 UNPASS、不通过
-    let musicianAuthStatus = state.user.data?.musicianAuthStatus;
+    let musicianAuthStatus = state.user.data?.musicianAuthStatus
     if (musicianAuthStatus) {
-      state.musicCertStatus = musicianAuthStatus === 'DOING' || musicianAuthStatus === 'PASS' ? true : false
+      state.musicCertStatus =
+        musicianAuthStatus === 'DOING' || musicianAuthStatus === 'PASS'
+          ? true
+          : false
+    }
+    // 如果申请过,则显示标题
+    if (state.musicCertStatus) {
+      postMessage({ api: 'setBarStatus', content: { status: 1 } })
     }
   },
   unmounted() {
@@ -42,20 +49,37 @@ export default defineComponent({
         await request.post('/api-teacher/teacherAuthMusicianRecord/doApply', {})
         Toast('申请认证成功')
         state.musicCertStatus = true
-      } catch { }
+        postMessage({ api: 'setBarStatus', content: { status: 1 } })
+      } catch {}
     }
   },
   render() {
     return (
       <>
-        {
-          state.musicCertStatus ? <ColResult tips={state.user.data?.musicianAuthStatus === 'PASS' ? '您提交的音乐人认证已申请成功' : '您已成功提交音乐人认证申请我们将在2个工作日内与您取得联系'} /> : <div class={styles['music-cert']}>
+        {state.musicCertStatus ? (
+          <ColResult
+            classImgSize="CERT"
+            type="musicCert"
+            style={{ paddingTop: '60px' }}
+            tips={
+              state.user.data?.musicianAuthStatus === 'PASS'
+                ? '您提交的音乐人认证已申请成功'
+                : '您已成功提交音乐人认证申请我们将在2个工作日内与您取得联系'
+            }
+          />
+        ) : (
+          <div class={styles['music-cert']}>
             <div class={styles.certWrapper}>
               <div class={[styles['cert-section'], 'mb12']}>
                 <div class={[styles['cert-text'], styles['cert-tree']]}>
-                  <img src={getAssetsHomeFile('tip.png')} class={styles.title} />
+                  <img
+                    src={getAssetsHomeFile('tip.png')}
+                    class={styles.title}
+                  />
                   <div class={styles['cert-desc']}>
-                    <p style={{ paddingRight: 0 }}>酷乐秀对有能力编曲的音乐人开通上传曲谱权限,</p>
+                    <p style={{ paddingRight: 0 }}>
+                      酷乐秀对有能力编曲的音乐人开通上传曲谱权限,
+                    </p>
                     <p>开通后您可上传自己编曲的乐谱MIDI</p>
                     <p>让平台学员进行练习,并获取收益</p>
                   </div>
@@ -64,11 +88,17 @@ export default defineComponent({
                 <div class={[styles['cert-show'], styles['cert-text']]}>
                   <div class={[styles['cert-item']]}>
                     <div class={styles.certLogo}>
-                      <Image class={styles.logo} src={getAssetsHomeFile('logo1.png')} />
+                      <Image
+                        class={styles.logo}
+                        src={getAssetsHomeFile('logo1.png')}
+                      />
                     </div>
                     <div class={styles.certInfo}>
                       <div class={styles.certInfoHeader}>
-                        <Image class={styles.num} src={getAssetsHomeFile('1.png')} />
+                        <Image
+                          class={styles.num}
+                          src={getAssetsHomeFile('1.png')}
+                        />
                         MIDI文件上传
                       </div>
                       <div class={styles.certInfoDesc}>
@@ -79,11 +109,17 @@ export default defineComponent({
 
                   <div class={[styles['cert-item']]}>
                     <div class={styles.certLogo}>
-                      <Image class={styles.logo} src={getAssetsHomeFile('logo2.png')} />
+                      <Image
+                        class={styles.logo}
+                        src={getAssetsHomeFile('logo2.png')}
+                      />
                     </div>
                     <div class={styles.certInfo}>
                       <div class={styles.certInfoHeader}>
-                        <Image class={styles.num} src={getAssetsHomeFile('2.png')} />
+                        <Image
+                          class={styles.num}
+                          src={getAssetsHomeFile('2.png')}
+                        />
                         乐谱收益
                       </div>
                       <div class={styles.certInfoDesc}>
@@ -95,17 +131,21 @@ export default defineComponent({
               </div>
 
               <Sticky position="bottom" offsetBottom={0}>
-                <div class={styles["btn-group"]}>
+                <div class={styles['btn-group']}>
                   {/* <Button round block type="primary" disabled={this.authStatus === '1'} onClick={this.onClick}>立即认证</Button> */}
-                  <div class={[styles.btn, this.authStatus === '1' ? styles.disabled : null]} onClick={this.onClick}></div>
+                  <div
+                    class={[
+                      styles.btn,
+                      this.authStatus === '1' ? styles.disabled : null
+                    ]}
+                    onClick={this.onClick}
+                  ></div>
                 </div>
               </Sticky>
             </div>
-
           </div>
-        }
-
+        )}
       </>
     )
   }
-})
+})

+ 0 - 1
src/teacher/open-live/index.module.less

@@ -109,7 +109,6 @@
     margin: 12px 14px 40px;
     background-color: #fff;
     padding: 12px;
-    min-height: 100vh;
     position: relative;
 
     h2 {

+ 141 - 76
src/teacher/open-live/index.tsx

@@ -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>
+        )}
+      </>
     )
   }
-})
+})

+ 9 - 6
src/teacher/teacher-cert/index.tsx

@@ -27,11 +27,7 @@ export default defineComponent({
       // 老师入驻状态 0、未申请 UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过
       const entryStatus = state.user.data?.entryStatus || 0
       teacherState.authStatus =
-        entryStatus === 'DOING' ||
-        entryStatus === 'PASS' ||
-        entryStatus === 'UNPASS'
-          ? true
-          : false
+        entryStatus === 'DOING' || entryStatus === 'PASS' ? true : false
       // 如果已经认证,则不用获取声部信息
       if (teacherState.authStatus) {
         teacherState.active = teacherState.authStatus ? 4 : 1
@@ -199,7 +195,14 @@ export default defineComponent({
             ) : null}
 
             {/* 提交完数据之后显示状态页 */}
-            {teacherState.active === 4 ? <ColResult tips="开通成功" /> : null}
+            {teacherState.active === 4 ? (
+              <ColResult
+                type="teacherCert"
+                style={{ paddingTop: '60px' }}
+                classImgSize="CERT"
+                tips="感谢您的教学热情,小酷将在24小时内完成审核,请留意APP消息及短信获取审核结果。"
+              />
+            ) : null}
           </div>
         )}
       </div>

+ 9 - 4
src/views/404/index.module.less

@@ -1,6 +1,11 @@
 .f404 {
   min-height: 100vh;
   text-align: center;
+
+  p {
+    font-size: 16px;
+    color: #999;
+  }
   :global {
     .van-image {
       margin-top: 100px;
@@ -9,9 +14,9 @@
     .van-button {
       margin-top: 20px;
       background-color: transparent;
-      height: 30px;
-      line-height: 28px;
-      padding: 0 25px;
+      width: 50%;
+      // height: 30px;
+      // line-height: 28px;
     }
   }
-}
+}