lex-xin 3 năm trước cách đây
mục cha
commit
bc92347d17

+ 5 - 1
src/business-components/course-video-item/index.tsx

@@ -24,6 +24,10 @@ export default defineComponent({
       type: Object as PropType<IDetail>,
       required: true
     },
+    border: {
+      type: Boolean,
+      default: false
+    },
     onPlay: {
       type: Function as PropType<(detail: IDetail) => void>,
       default: () => { }
@@ -31,7 +35,7 @@ export default defineComponent({
   },
   render() {
     return (
-      <Cell class={styles.videoSection} onClick={() => this.onPlay(this.detail)} v-slots={{
+      <Cell class={styles.videoSection} border={this.border} onClick={() => this.onPlay(this.detail)} v-slots={{
         icon: () => (
           <div class={styles.videoImg}>
             <Image src={this.detail.imgUrl} fit="cover" />

+ 4 - 1
src/components/col-field/index.module.less

@@ -4,6 +4,9 @@
   display: flex;
   align-items: center;
   justify-content: space-between;
+  .pdL {
+    padding-left: 8px;
+  }
   .col-left {
     display: flex;
     align-items: center;
@@ -17,7 +20,7 @@
     }
     .required {
       font-style: normal;
-      color: #FF4E19;
+      color: #ff4e19;
       font-size: 17px;
     }
   }

+ 2 - 3
src/components/col-field/index.tsx

@@ -10,8 +10,7 @@ export default defineComponent({
       default: false
     },
     title: {
-      type: String,
-      required: true
+      type: String
     },
     border: {
       type: Boolean,
@@ -34,7 +33,7 @@ export default defineComponent({
               ) : null}
             </div>
             {this.required ? <i class={styles.required}>*</i> : null}
-            {this.title}
+            {this.$slots.title ? this.$slots.title() : <div class={styles.pdL}>{this.title}</div>}
           </div>
           <div class={styles['col-right']}>
             {this.$slots.right && this.$slots.right()}

+ 38 - 2
src/components/col-upload-video/index.tsx

@@ -29,6 +29,11 @@ export default defineComponent({
       default: true
     }
   },
+  data() {
+    return {
+      posterUrl: '',
+    }
+  },
   methods: {
     beforeRead(file: any) {
       const isLt2M = file.size / 1024 / 1024 < this.size
@@ -65,6 +70,37 @@ export default defineComponent({
       postMessage({ api: 'chooseFile', content: { type: 'video' } }, (res: any) => {
         this.$emit('update:modelValue', res.fileUrl);
       })
+    },
+    getVideoBase64(url: string) {
+      return new Promise(function (resolve) {
+        let dataURL = '';
+        const video = document.createElement('video');
+        video.setAttribute('crossOrigin', 'anonymous'); // 处理跨域
+        video.setAttribute('src', url);
+        video.setAttribute('preload', 'auto');
+        video.addEventListener('loadeddata', function () {
+          const canvas = document.createElement('canvas');
+          console.log('video.clientWidth', video.videoWidth);// 视频宽
+          console.log('video.clientHeight', video.videoHeight); // 视频高
+          const width = video.videoWidth || 750; // canvas的尺寸和图片一样
+          const height = video.videoHeight || 500;// 设置默认宽高为 750 * 500
+          canvas.width = width;
+          canvas.height = height;
+          (canvas as any).getContext('2d').drawImage(video, 0, 0, width, height); // 绘制canvas
+          dataURL = canvas.toDataURL('image/jpeg'); // 转换为base64
+          resolve(dataURL);
+        });
+      });
+    }
+  },
+  watch: {
+    modalValue(val: any) {
+      if (val) {
+        const urlImg = this.getVideoBase64(val)
+        console.log(urlImg)
+      } else {
+        this.posterUrl = '';
+      }
     }
   },
   render() {
@@ -72,13 +108,13 @@ export default defineComponent({
     return (
       <div class={styles['uploader-section']}>
         {this.modelValue && this.deletable ? <Icon name="cross" onClick={this.onClose} class={styles["img-close"]} /> : null}
-        {browser().isApp && this.nativeUpload ? <div onClick={this.onNativeUpload}>{this.modelValue ? <video class={styles.uploadImg} src={this.modelValue} /> : <div class={styles.uploader}>
+        {browser().isApp && this.nativeUpload ? <div onClick={this.onNativeUpload}>{this.modelValue ? <video ref="videoUpload" class={styles.uploadImg} src={this.modelValue} poster={this.posterUrl} /> : <div class={styles.uploader}>
           <Icon name={iconUploader} size="32" />
           <p class={styles.uploaderText}>{this.tips}</p>
         </div>}</div> : <>{/* @ts-ignore */}
           <Uploader accept=".mp4" afterRead={this.afterRead} beforeRead={this.beforeRead} beforeDelete={this.beforeDelete}
             v-slots={{
-              default: () => (this.modelValue ? <video class={styles.uploadImg} src={this.modelValue} /> : <div class={styles.uploader}>
+              default: () => (this.modelValue ? <video ref="videoUpload" class={styles.uploadImg} src={this.modelValue} poster={this.posterUrl} /> : <div class={styles.uploader}>
                 <Icon name={iconUploader} size="32" />
                 <p class={styles.uploaderText}>{this.tips}</p>
               </div>)

+ 8 - 1
src/components/col-upload/index.tsx

@@ -26,7 +26,11 @@ export default defineComponent({
     options: { // 裁切需要参数
       type: Object,
       default: {}
-    }
+    },
+    onUploadChange: {
+      type: Function,
+      default: (url: string) => { }
+    },
   },
   methods: {
     beforeRead(file: any) {
@@ -51,12 +55,14 @@ export default defineComponent({
           data: formData
         })
         this.$emit('update:modelValue', res.data.url);
+        this.onUploadChange(res.data.url);
       } catch (error) {
         //
       }
     },
     onClose(e: any) {
       this.$emit('update:modelValue', null);
+      this.onUploadChange();
       e.stopPropagation();
     },
     async getFile(file: any) {
@@ -68,6 +74,7 @@ export default defineComponent({
           data: formData
         })
         this.$emit('update:modelValue', res.data.url);
+        this.onUploadChange(res.data.url);
       } catch {
         //
       }

+ 4 - 3
src/teacher/music-cert/index.module.less

@@ -1,6 +1,6 @@
 .music-cert {
   background-color: #fff;
-  padding: 12px;
+  padding: 12px 12px 0;
   position: relative;
 
   h2 {
@@ -26,6 +26,7 @@
   }
 
   .btn-group {
-    background-color: #fff;
+    // background-color: #fff;
+    padding-bottom: 12px;
   }
-}
+}

+ 3 - 3
src/teacher/music-cert/index.tsx

@@ -13,9 +13,9 @@ export default defineComponent({
     }
   },
   mounted() {
-    if (state.user.data?.musicianAuthStatus) {
-      state.musicCertStatus = !!state.user.data.musicianAuthStatus
-    }
+    // if (state.user.data?.musicianAuthStatus) {
+    //   state.musicCertStatus = !!state.user.data.musicianAuthStatus
+    // }
   },
   methods: {
     async onClick() {

+ 19 - 17
src/teacher/open-live/index.tsx

@@ -34,9 +34,9 @@ export default defineComponent({
       const result = res.data
       result.forEach((item: any) => {
         console.log(item)
-        if(item.paramName === 'open_live_fans_num') {
+        if (item.paramName === 'open_live_fans_num') {
           this.fansNum = item.paranValue
-        } else if(item.paramName === 'open_list_over_class') {
+        } else if (item.paramName === 'open_list_over_class') {
           this.overClassNum = item.paranValue
         }
       });
@@ -46,10 +46,12 @@ export default defineComponent({
   },
   methods: {
     async onOpenLive() {
-      // await request('')
       try {
         await request.get('/api-teacher/teacher/openLive', {})
         Toast('开通成功')
+        setTimeout(() => {
+          postMessage({ api: 'back' })
+        }, 1000);
       } catch {
         //
       }
@@ -72,22 +74,22 @@ export default defineComponent({
         <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} color="#FFC459" void-icon="star" voidColor="#D6D6D6" size={15} />
-              </div>
+          <div class={styles['teacher-info']}>
+            <div class={styles['teacher-name']}>{this.users?.username}</div>
+            <div class={styles.level}>
+              <Rate modelValue={this.users?.starGrade} color="#FFC459" void-icon="star" voidColor="#D6D6D6" size={15} />
             </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>
-              </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>
             </div>
+          </div>
         </Cell>
 
         {!this.users.liveFlag ? <div class={styles['open-tips']}>

+ 2 - 1
src/teacher/teacher-cert/index.module.less

@@ -1,4 +1,5 @@
 .teacher-cert {
+  overflow: hidden;
   .btnGroup {
     padding: 0 14px;
     margin-bottom: 15px;
@@ -12,4 +13,4 @@
       }
     }
   }
-}
+}

+ 8 - 10
src/teacher/video-class/class-content.tsx

@@ -7,8 +7,6 @@ import { defineComponent } from "vue";
 import styles from './class-content.module.less';
 import { createState } from './createState';
 
-
-
 export default defineComponent({
   name: "ClassContent",
   data() {
@@ -25,37 +23,37 @@ export default defineComponent({
     onFailed(err: any) {
       console.log(err)
       console.log('onFailed', this.url)
-      // console.log('onFailed', createState.createVideo)
+      // console.log('onFailed', createState.lessonGroup)
     },
     addItem() {
-      createState.createVideo.videoLessonList.push({
+      createState.lessonList.push({
         videoTitle: '',
         videoContent: '',
-        videoUrl: 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kHuSh.mp4',
-        coverUrl: 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kK2ao.png'
+        videoUrl: '',
+        coverUrl: ''
       })
     },
     removeItem(index: number) {
       // 最少一节课
-      if (createState.createVideo.videoLessonList.length <= 1) return
+      if (createState.lessonList.length <= 1) return
       Dialog.confirm({
         title: '操作',
         message: `确定删除该条数据吗?`,
         confirmButtonColor: '#2DC7AA',
       })
         .then(() => {
-          createState.createVideo.videoLessonList.splice(index, 1)
+          createState.lessonList.splice(index, 1)
         })
     }
   },
   render() {
     return (
       <Form class={styles['class-content']} onSubmit={this.onSubmit} onFailed={this.onFailed} scrollToError>
-        {createState.createVideo.videoLessonList.map((item: any, index: number) => (
+        {createState.lessonList.map((item: any, index: number) => (
           <>
             <div class={styles.titleSection}>
               <span class={styles.title}>第{index + 1}课</span>
-              <Icon name="delete-o" class={createState.createVideo.videoLessonList.length <= 1 ? styles.disabled : null} onClick={() => this.removeItem(index)} size={20} />
+              <Icon name="delete-o" class={createState.lessonList.length <= 1 ? styles.disabled : null} onClick={() => this.removeItem(index)} size={20} />
             </div>
             <ColFieldGroup>
               <ColField title="课程标题" required>

+ 30 - 0
src/teacher/video-class/class-info.module.less

@@ -1,12 +1,42 @@
 .classInfo {
   margin-top: 12px;
 
+  .infoField {
+    width: 50vw;
+    font-size: 16px;
+
+    :global {
+      .van-tab {
+        font-size: 16px;
+      }
+      .van-tabs__nav--line {
+        padding-left: 0;
+      }
+      .van-tab--active {
+        color: #000;
+      }
+      // .van-tab--shrink {
+      //   padding-left: 0;
+      // }
+    }
+  }
+
   .imgContainer {
     width: 150px;
     height: 100px;
     border-radius: 10px;
     overflow: hidden;
     margin: 0 0 12px;
+    position: relative;
+
+    :global {
+      .van-radio {
+        position: absolute;
+        bottom: 10px;
+        right: 20px;
+        z-index: 9;
+      }
+    }
   }
 
   .btnGroup {

+ 59 - 40
src/teacher/video-class/class-info.tsx

@@ -4,23 +4,27 @@ import ColPopup from "@/components/col-popup";
 import ColUpload from "@/components/col-upload";
 import request from "@/helpers/request";
 import { verifyNumberIntegerAndFloat } from "@/helpers/toolsValidate";
-import { Button, Col, Field, Form, Image, Row, Sticky } from "vant";
+import { Button, Col, Field, Form, Image, Radio, RadioGroup, Row, Sticky, Tab, Tabs } from "vant";
 import { defineComponent } from "vue";
 import SubjectModel from "../../business-components/subject-list";
 import styles from "./class-info.module.less";
 import { createState } from './createState'
 
-
 export default defineComponent({
   name: "ClassInfo",
   data() {
     return {
-      subjectStatus: false
+      subjectStatus: false,
+      tabIndex: 1,
+      imgList: ['https://daya.ks3-cn-beijing.ksyun.com/202110/Sn2OAjr.png',
+        'https://daya.ks3-cn-beijing.ksyun.com/202108/ShHJ1Bb.png',
+        'https://daya.ks3-cn-beijing.ksyun.com/202110/Sn76BUQ.png'
+      ]
     }
   },
   computed: {
     choiceSubjectIds() { // 选择的科目编号
-      let ids = createState.createVideo.lessonSubject ? Number(createState.createVideo.lessonSubject) : null;
+      let ids = createState.lessonGroup.lessonSubject ? Number(createState.lessonGroup.lessonSubject) : null;
       return ids ? [ids] : [];
     },
     subjectList() { // 学科列表
@@ -38,9 +42,8 @@ export default defineComponent({
       return tempStr
     },
     calcRatePrice() { // 计算手续费
-      console.log(createState.rate)
       let rate = createState.rate || 0;
-      let price = createState.createVideo.lessonPrice || 0;
+      let price = createState.lessonGroup.lessonPrice || 0;
       return ((rate / 100) * price).toFixed(2);
     }
   },
@@ -59,37 +62,39 @@ export default defineComponent({
       //
     }
 
-    // lessonName: '',
-    // lessonSubject: null as any,
-    // lessonDesc: '',
-    // lessonPrice: null,
-    // lessonCoverUrl: '',
+    createState.lessonGroup.lessonName = '测试视屏信息';
+    createState.lessonGroup.lessonSubject = 5;
+    createState.lessonGroup.lessonDesc = '测试视屏信息内容';
+    createState.lessonGroup.lessonPrice = 50;
+    createState.lessonGroup.lessonCoverUrl = 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kK2ao.png';
 
-    createState.createVideo.lessonName = '测试视屏信息';
-    createState.createVideo.lessonSubject = 5;
-    createState.createVideo.lessonDesc = '测试视屏信息内容';
-    createState.createVideo.lessonPrice = 50;
-    createState.createVideo.lessonCoverUrl = 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kK2ao.png';
+    if (createState.lessonGroup.lessonCoverUrl && !this.imgList.includes(createState.lessonGroup.lessonCoverUrl)) {
+      this.tabIndex = 2
+    }
   },
   methods: {
-    onSubmit(values: any) {
-      createState.active = 2
-    },
     onChoice(id: number) {
-      createState.createVideo.lessonSubject = id
+      createState.lessonGroup.lessonSubject = id
       this.subjectStatus = false
     },
     onFormatter(val: any) {
       return verifyNumberIntegerAndFloat(val)
+    },
+    tabChange(name: number) {
+      this.tabIndex = name
+    },
+    selectImg(val: string) {
+      createState.lessonGroup.lessonCoverUrl = ''
+      createState.lessonGroup.lessonCoverTemplateUrl = val
     }
   },
   render() {
     return (
-      <Form class={styles.classInfo} onSubmit={this.onSubmit}>
+      <Form class={styles.classInfo} onSubmit={() => createState.active = 2} scrollToError>
         <ColFieldGroup>
           <ColField title="课程名称" required>
             <Field
-              v-model={createState.createVideo.lessonName}
+              v-model={createState.lessonGroup.lessonName}
               name="lessonName"
               maxlength={50}
               placeholder="请输入您的课程名称"
@@ -112,7 +117,7 @@ export default defineComponent({
         <ColFieldGroup>
           <ColField title="课程介绍" required border={false}>
             <Field
-              v-model={createState.createVideo.lessonDesc}
+              v-model={createState.lessonGroup.lessonDesc}
               name="lessonDesc"
               placeholder="请输入课程介绍"
               rows="3"
@@ -127,7 +132,7 @@ export default defineComponent({
         <ColFieldGroup>
           <ColField title="课程组售价" required>
             <Field
-              v-model={createState.createVideo.lessonPrice}
+              v-model={createState.lessonGroup.lessonPrice}
               name="lessonPrice"
               placeholder="请输入您的课程组售价"
               formatter={this.onFormatter}
@@ -148,34 +153,48 @@ export default defineComponent({
         </div>
 
         <ColFieldGroup>
-          <ColField title="图片模板" required border={false}>
+          <ColField required border={false}
+            v-slots={{
+              title: () => (
+                <Tabs v-model:active={this.tabIndex} class={styles.infoField} onChange={this.tabChange} shrink color="var(--van-primary)" lineWidth={20}>
+                  <Tab title="图片模板" name={1}></Tab>
+                  <Tab title="自定义模板" name={2}></Tab>
+                </Tabs>
+              )
+            }}>
             <p class={styles.photoTip}>模板图片将作为改课程封面为学员展示</p>
 
+            {/* name={this.tabIndex === 1 ? 'lessonCoverTemplateUrl' : 'lessonCoverUrl'} */}
             <Field
-              v-model={createState.createVideo.lessonCoverUrl}
               name="lessonCoverUrl"
               rules={[{ required: true, message: '请选择课程声部' }]}
               v-slots={{
-                input: () => (
-                  <Row justify="space-between">
-                    <Col span={12} class={styles.imgContainer}>
-                      <Image class={styles.imgContainer} src="https://daya.ks3-cn-beijing.ksyun.com/202201/Sv7wlrW.png" />
-                    </Col>
-                    <Col span={12} class={styles.imgContainer}>
-                      <Image class={styles.imgContainer} src="https://daya.ks3-cn-beijing.ksyun.com/202201/Sv7wlrW.png" />
-                    </Col>
-                    <Col span={12} class={styles.imgContainer}>
-                      <Image class={styles.imgContainer} src="https://daya.ks3-cn-beijing.ksyun.com/202201/Sv7wlrW.png" />
-                    </Col>
+                input: () =>
+                  this.tabIndex == 1 ? <RadioGroup v-model={createState.lessonGroup.lessonCoverTemplateUrl}>
+                    <Row justify="space-between" style={{ width: '100%' }}>
+                      {this.imgList.map((item: any) => (
+                        <Col span={12} class={styles.imgContainer} onClick={() => this.selectImg(item)}>
+                          <Image class={styles.imgContainer} src={item} />
+                          <Radio name={item} />
+                        </Col>
+                      ))}
+                    </Row>
+                  </RadioGroup> : <Row justify="space-between" style={{ width: '100%' }}>
                     <Col span={12} class={styles.imgContainer}>
                       <ColUpload cropper options={{
                         fixedNumber: [3, 2],
                         autoCropWidth: 750,
                         autoCropHeight: 500,
-                      }} v-model={createState.createVideo.lessonCoverUrl} class={styles.imgContainer} />
+                      }}
+                        onUploadChange={(val: any) => {
+                          if (val) {
+                            createState.lessonGroup.lessonCoverTemplateUrl = ''
+                          }
+                        }}
+                        v-model={createState.lessonGroup.lessonCoverUrl} class={styles.imgContainer} />
                     </Col>
                   </Row>
-                )
+
               }}
             />
           </ColField>
@@ -190,7 +209,7 @@ export default defineComponent({
         <ColPopup v-model={this.subjectStatus}>
           <SubjectModel selectType="Radio" subjectList={this.subjectList} choiceSubjectIds={this.choiceSubjectIds} onChoice={this.onChoice} />
         </ColPopup>
-      </Form>
+      </Form >
     )
   }
 })

+ 23 - 5
src/teacher/video-class/create-submit.tsx

@@ -3,16 +3,17 @@ import styles from "./create-submit.module.less";
 import UserDetail from "@/business-components/user-detail";
 import SectionDetail from "@/business-components/section-detail";
 import CourseVideoItem from "@/business-components/course-video-item";
-import { Button, Sticky } from "vant";
+import { Button, Sticky, Toast } from "vant";
 import { createState } from "./createState";
 import { state } from "@/state";
+import request from "@/helpers/request";
 
 
 export default defineComponent({
   name: "CreateSubmit",
   computed: {
     userInfo() {
-      const videoDetail = createState.createVideo;
+      const videoDetail = createState.lessonGroup;
       const users = state.user.data || {};
       return {
         username: users.username,
@@ -22,11 +23,28 @@ export default defineComponent({
         lessonDesc: videoDetail.lessonDesc,
         lessonPrice: videoDetail.lessonPrice,
         lessonCoverUrl: videoDetail.lessonCoverUrl,
-        lessonNum: videoDetail.videoLessonList.length
+        lessonNum: createState.lessonList.length
       }
     },
     lessonList() {
-      return createState.createVideo.videoLessonList || [];
+      return createState.lessonList || [];
+    }
+  },
+  methods: {
+    async onSubmit() {
+      try {
+        let params = {
+          lessonList: this.lessonList,
+          lessonGroup: createState.lessonGroup
+        }
+        await request.post('/api-teacher/videoLessonGroup/add', {
+          data: params
+        });
+        Toast.success('创建成功');
+        setTimeout(() => {
+          postMessage({ api: 'back' })
+        }, 1000);
+      } catch { }
     }
   },
   render() {
@@ -50,7 +68,7 @@ export default defineComponent({
         <Sticky offsetBottom={0} position="bottom">
           <div class={[styles.btnGroup, styles.btnMore]}>
             <Button block round type="primary" plain onClick={() => { createState.active = 2 }}>返回编辑</Button>
-            <Button block round type="primary">创建完成</Button>
+            <Button block round type="primary" onClick={this.onSubmit}>创建完成</Button>
           </div>
         </Sticky>
       </div>

+ 12 - 14
src/teacher/video-class/createState.tsx

@@ -4,22 +4,20 @@ export const createState = reactive({
   active: 1,
   rate: 0, // 手续费
   subjectList: [], // 声部列表
-  createVideo: {
+  lessonGroup: {
     lessonName: '',
     lessonSubject: null as any,
     lessonDesc: '',
     lessonPrice: null as any,
     lessonCoverUrl: '',
-    videoLessonList: [{
-      videoTitle: '视屏标题',
-      videoContent: '视屏内容',
-      videoUrl: 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kHuSh.mp4',
-      coverUrl: 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kK2ao.png'
-    }, {
-      videoTitle: '视屏标题2',
-      videoContent: '视屏内容2',
-      videoUrl: 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kHuSh.mp4',
-      coverUrl: 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kK2ao.png'
-    }]
-  }
-})
+    lessonCoverTemplateUrl: '',
+  },
+  lessonList: [{
+    videoTitle: '',
+    videoContent: '',
+    videoUrl: '',
+    coverUrl: ''
+  }]
+})
+// videoUrl: 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kHuSh.mp4',
+// coverUrl: 'https://daya.ks3-cn-beijing.ksyun.com/202204/T1kK2ao.png'

+ 2 - 3
src/teacher/video-class/video-detail.tsx

@@ -12,7 +12,7 @@ export default defineComponent({
   name: 'VideoDetail',
   computed: {
     userInfo() {
-      const videoDetail = createState.createVideo;
+      const videoDetail = createState.lessonGroup;
       const users = state.user.data || {};
       return {
         username: users.username,
@@ -21,8 +21,7 @@ export default defineComponent({
         buyNum: 0,
         lessonDesc: videoDetail.lessonDesc,
         lessonPrice: videoDetail.lessonPrice,
-        lessonCoverUrl: videoDetail.lessonCoverUrl,
-        lessonNum: videoDetail.videoLessonList.length
+        lessonCoverUrl: videoDetail.lessonCoverUrl
       }
     },
   },