lex-xin 3 years ago
parent
commit
7a7bf3851a

+ 35 - 3
src/teacher/open-live/index.tsx

@@ -1,5 +1,5 @@
 import { defineComponent } from "vue";
-import { Button, Cell, Icon, Image, NavBar, Rate, Sticky } from "vant";
+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';
@@ -18,9 +18,41 @@ export default defineComponent({
       return state.user.data
     }
   },
+  data() {
+    return {
+      fansNum: 0,
+      overClassNum: 0
+    }
+  },
+  async mounted() {
+    try {
+      const res = await request.get('/api-teacher/sysConfig/list', {
+        params: {
+          group: 'LIVE'
+        }
+      })
+      const result = res.data
+      result.forEach((item: any) => {
+        console.log(item)
+        if(item.paramName === 'open_live_fans_num') {
+          this.fansNum = item.paranValue
+        } else if(item.paramName === 'open_list_over_class') {
+          this.overClassNum = item.paranValue
+        }
+      });
+    } catch {
+      //
+    }
+  },
   methods: {
     async onOpenLive() {
       // await request('')
+      try {
+        await request.get('/api-teacher/Teacher/openLive', {})
+        Toast('开通成功')
+      } catch {
+        //
+      }
     }
   },
   render() {
@@ -48,11 +80,11 @@ export default defineComponent({
             </div>
             <div class={styles['teacher-desc']}>
               <div class={styles.teacherItem}>
-                <div class={styles.title}>{this.users?.fansNum}/20</div>
+                <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}/10</div>
+                <div class={styles.title}>{this.users?.expTime}/{this.overClassNum}</div>
                 <div class={styles.content}>已上课时</div>
               </div>
             </div>

+ 10 - 1
src/teacher/teacher-cert/index.tsx

@@ -12,6 +12,7 @@ import CertThree from "./cert-three";
 import { checkIDCard } from "@/helpers/validate";
 import request from "@/helpers/request";
 import ColResult from "@/components/col-result";
+import { state } from "@/state";
 
 export default defineComponent({
   name: 'teacherCert',
@@ -24,6 +25,13 @@ export default defineComponent({
   },
   async mounted() {
     try {
+      // 判断是否已经认证
+      teacherState.authStatus = !state.user.data?.entryStatus ? true : false
+      // 如果已经认证,则不用获取声部信息
+      if(teacherState.authStatus) {
+        teacherState.active = teacherState.authStatus ? 4 : 1
+        return
+      }
       if (teacherState.subjectList.length <= 0) {
         const res = await request.get('/api-teacher/subject/queryPageTree', {
           params: {
@@ -86,6 +94,7 @@ export default defineComponent({
           data: teacherState.teacherCert
         })
         Toast('提交成功')
+        teacherState.active = 4;
       } catch {
         //
       }
@@ -98,7 +107,7 @@ export default defineComponent({
     return (
       <div class={styles['teacher-cert']}>
         {!teacherState.authStatus ? <CertInfo authStatus={this.authStatus} /> : <div>
-          <Steps style={{ marginBottom: '12px' }} />
+          {teacherState.active != 4 ? <Steps style={{ marginBottom: '12px' }} /> : null}
           {teacherState.active === 1 ? (
             <>
               <CertOne />

+ 16 - 0
src/teacher/teacher-cert/module/subject-model.module.less

@@ -1,6 +1,22 @@
 .subjects {
   padding: 15px 15px 80px;
 
+  .title {
+    padding: 12px 0;
+    color: #333;
+    font-size: 16px;
+    &::before {
+      content: ' ';
+      display: inline-block;
+      width: 3px;
+      height: 16px;
+      background: #2DC7AA;
+      border-radius: 3px;
+      margin-right: 8px;
+      vertical-align: text-bottom;
+    }
+  }
+
   .btn-group {
     position: fixed;
     bottom: 0;