lex-xin 2 years ago
parent
commit
fd818f5d20

+ 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>

+ 3 - 1
src/business-components/course-plan-step/index.module.less

@@ -54,9 +54,11 @@
 
       .stepTitleNum {
         font-size: 14px;
-        color: var(--van-primary);
         font-weight: 500;
       }
+      .active {
+        color: var(--van-primary);
+      }
     }
     .stepContent {
       padding-top: 10px;

+ 47 - 22
src/business-components/course-plan-step/index.tsx

@@ -1,18 +1,23 @@
-import { defineComponent, PropType } from "vue";
-import styles from './index.module.less';
-import { Icon, Image } from "vant";
-import videoStop from '@common/images/icon_video_stop.png';
+import { defineComponent, PropType } from 'vue'
+import styles from './index.module.less'
+import { Icon, Image } from 'vant'
+import videoStop from '@common/images/icon_video_stop.png'
 
 interface IProps {
-  courseTime: string;
-  coursePlan: string;
-  videoPosterUrl?: string;
-  id?: number | string;
+  courseTime: string
+  coursePlan: string
+  videoPosterUrl?: string
+  id?: number | string
 }
 
 export default defineComponent({
-  name: "CoursePlanStep",
+  name: 'CoursePlanStep',
   props: {
+    courseId: {
+      // 用于判断当前选择哪一节课程
+      type: Number,
+      default: 0
+    },
     courseInfo: {
       type: Array as PropType<IProps[]>,
       default: []
@@ -25,19 +30,39 @@ export default defineComponent({
           {this.courseInfo.map((item: any, index: number) => (
             <div class={styles['col-step']}>
               <div class={styles['col-step__title']}>
-                {this.$slots.content ? this.$slots.content() : <div class={styles.stepSection}>
-                  <div class={styles.stepTitle}>
-                    <span class={styles.stepTitleNum}>第 {index + 1} 课时</span>
-                    <span class={styles.stepTitleText}>{ item.courseTime }</span>
+                {this.$slots.content ? (
+                  this.$slots.content()
+                ) : (
+                  <div class={styles.stepSection}>
+                    <div class={styles.stepTitle}>
+                      <span
+                        class={[
+                          styles.stepTitleNum,
+                          (this.courseId === 0 || this.courseId === item.id) &&
+                            styles.active
+                        ]}
+                      >
+                        第 {index + 1} 课时
+                      </span>
+                      <span class={styles.stepTitleText}>
+                        {item.courseTime}
+                      </span>
+                    </div>
+                    <div class={styles.stepContent}>
+                      <p>{item.coursePlan}</p>
+                      {item.videoPosterUrl && (
+                        <div class={styles.videoImg}>
+                          <Image src={item.videoPosterUrl} fit="cover" />
+                          <Icon
+                            class={styles.videoStop}
+                            name={videoStop}
+                            size={32}
+                          />
+                        </div>
+                      )}
+                    </div>
                   </div>
-                  <div class={styles.stepContent}>
-                    <p>{ item.coursePlan }</p>
-                    {item.videoPosterUrl && (<div class={styles.videoImg}>
-                      <Image src={item.videoPosterUrl} fit="cover" />
-                      <Icon class={styles.videoStop} name={videoStop} size={32} />
-                    </div>)}
-                  </div>
-                </div>}
+                )}
               </div>
               <div class={styles['col-step_circle']}>{index + 1}</div>
               <div class={styles['col-step__line']}></div>
@@ -47,4 +72,4 @@ export default defineComponent({
       </div>
     )
   }
-})
+})

+ 279 - 247
src/components/col-cropper/index.tsx

@@ -1,10 +1,10 @@
-import { defineComponent } from "vue";
+import { defineComponent } from 'vue'
 import 'vue-cropper/dist/index.css'
-import { VueCropper } from 'vue-cropper';
+import { VueCropper } from 'vue-cropper'
 import styles from './index.module.less'
 
 export default defineComponent({
-  name: "col-cropper",
+  name: 'col-cropper',
   components: { VueCropper },
   props: {
     hideInput: {
@@ -33,15 +33,15 @@ export default defineComponent({
     imgOriginF: {
       type: Function,
       default: () => {}
-    },
+    }
   },
   data() {
     return {
-      img: "",
+      img: '',
       config: {
         ceilbutton: false, //顶部按钮,默认底部
         outputSize: 1, //裁剪生成图片的质量
-        outputType: "png", //裁剪生成图片的格式,默认png
+        outputType: 'png', //裁剪生成图片的格式,默认png
         info: false, //裁剪框的大小信息
         canScale: true, //图片是否允许滚轮缩放
         autoCrop: false, //是否默认生成截图框
@@ -59,13 +59,13 @@ export default defineComponent({
         infoTrue: false, //true 为展示真实输出图片宽高 false 展示看到的截图框宽高
         maxImgSize: 2000, //限制图片最大宽度和高度
         enlarge: 1, //图片根据截图框输出比例倍数
-        mode: "100%", //图片默认渲染方式
-        cancelButtonText:"取消",//取消按钮文本
-        confirmButtonText:"确定",//确定按钮文本
-        cancelButtonBackgroundColor:"#606266",//取消按钮背景色
-        confirmButtonBackgroundColor:"#ed594c",//确定按钮背景色
-        cancelButtonTextColor:"#ffffff",//取消按钮字体色
-        confirmButtonTextColor:"#ffffff",//确定按钮字体色
+        mode: '100%', //图片默认渲染方式
+        cancelButtonText: '取消', //取消按钮文本
+        confirmButtonText: '确定', //确定按钮文本
+        cancelButtonBackgroundColor: '#606266', //取消按钮背景色
+        confirmButtonBackgroundColor: '#ed594c', //确定按钮背景色
+        cancelButtonTextColor: '#ffffff', //取消按钮字体色
+        confirmButtonTextColor: '#ffffff' //确定按钮字体色
       }
     }
   },
@@ -75,153 +75,153 @@ export default defineComponent({
   methods: {
     //添加网格线
     addSlide() {
-      if (document.getElementById("vertical") == null) {
-        let box = document.getElementsByClassName("cropper-crop-box")[0];
+      if (document.getElementById('vertical') == null) {
+        let box = document.getElementsByClassName('cropper-crop-box')[0]
         //左网格线
-        let verticalLeft = document.createElement("div");
-        verticalLeft.id = "vertical";
-        verticalLeft.style.width = "1px";
-        verticalLeft.style.height = "100%";
-        verticalLeft.style.top = "0px";
-        verticalLeft.style.left = "33%";
-        verticalLeft.style.position = "absolute";
-        verticalLeft.style.backgroundColor = "#fff";
-        verticalLeft.style.zIndex = "522";
-        verticalLeft.style.opacity = "0.5";
+        let verticalLeft = document.createElement('div')
+        verticalLeft.id = 'vertical'
+        verticalLeft.style.width = '1px'
+        verticalLeft.style.height = '100%'
+        verticalLeft.style.top = '0px'
+        verticalLeft.style.left = '33%'
+        verticalLeft.style.position = 'absolute'
+        verticalLeft.style.backgroundColor = '#fff'
+        verticalLeft.style.zIndex = '522'
+        verticalLeft.style.opacity = '0.5'
         //右网格线
-        let verticalRight = document.createElement("div");
-        verticalRight.style.width = "1px";
-        verticalRight.style.height = "100%";
-        verticalRight.style.top = "0px";
-        verticalRight.style.right = "33%";
-        verticalRight.style.position = "absolute";
-        verticalRight.style.backgroundColor = "#fff";
-        verticalRight.style.zIndex = "522";
-        verticalRight.style.opacity = "0.5";
+        let verticalRight = document.createElement('div')
+        verticalRight.style.width = '1px'
+        verticalRight.style.height = '100%'
+        verticalRight.style.top = '0px'
+        verticalRight.style.right = '33%'
+        verticalRight.style.position = 'absolute'
+        verticalRight.style.backgroundColor = '#fff'
+        verticalRight.style.zIndex = '522'
+        verticalRight.style.opacity = '0.5'
         //上网格线
-        let verticalTop = document.createElement("div");
-        verticalTop.style.width = "100%";
-        verticalTop.style.height = "1px";
-        verticalTop.style.top = "33%";
-        verticalTop.style.left = "0px";
-        verticalTop.style.position = "absolute";
-        verticalTop.style.backgroundColor = "#fff";
-        verticalTop.style.zIndex = "522";
-        verticalTop.style.opacity = "0.5";
+        let verticalTop = document.createElement('div')
+        verticalTop.style.width = '100%'
+        verticalTop.style.height = '1px'
+        verticalTop.style.top = '33%'
+        verticalTop.style.left = '0px'
+        verticalTop.style.position = 'absolute'
+        verticalTop.style.backgroundColor = '#fff'
+        verticalTop.style.zIndex = '522'
+        verticalTop.style.opacity = '0.5'
         //下网格线
-        let verticalBottom = document.createElement("div");
-        verticalBottom.style.width = "100%";
-        verticalBottom.style.height = "1px";
-        verticalBottom.style.bottom = "33%";
-        verticalBottom.style.left = "0px";
-        verticalBottom.style.position = "absolute";
-        verticalBottom.style.backgroundColor = "#fff";
-        verticalBottom.style.zIndex = "522";
-        verticalBottom.style.opacity = "0.5";
+        let verticalBottom = document.createElement('div')
+        verticalBottom.style.width = '100%'
+        verticalBottom.style.height = '1px'
+        verticalBottom.style.bottom = '33%'
+        verticalBottom.style.left = '0px'
+        verticalBottom.style.position = 'absolute'
+        verticalBottom.style.backgroundColor = '#fff'
+        verticalBottom.style.zIndex = '522'
+        verticalBottom.style.opacity = '0.5'
         //左上边线
-        let LeftTopSide = document.createElement("div");
-        LeftTopSide.style.width = "30px";
-        LeftTopSide.style.height = "4px";
-        LeftTopSide.style.top = "-4px";
-        LeftTopSide.style.left = "-4px";
-        LeftTopSide.style.position = "absolute";
-        LeftTopSide.style.backgroundColor = "#fff";
-        LeftTopSide.style.zIndex = "522";
-        LeftTopSide.style.opacity = "1";
+        let LeftTopSide = document.createElement('div')
+        LeftTopSide.style.width = '30px'
+        LeftTopSide.style.height = '4px'
+        LeftTopSide.style.top = '-4px'
+        LeftTopSide.style.left = '-4px'
+        LeftTopSide.style.position = 'absolute'
+        LeftTopSide.style.backgroundColor = '#fff'
+        LeftTopSide.style.zIndex = '522'
+        LeftTopSide.style.opacity = '1'
         //上左边线
-        let TopListSide = document.createElement("div");
-        TopListSide.style.width = "4px";
-        TopListSide.style.height = "30px";
-        TopListSide.style.top = "-4px";
-        TopListSide.style.left = "-4px";
-        TopListSide.style.position = "absolute";
-        TopListSide.style.backgroundColor = "#fff";
-        TopListSide.style.zIndex = "522";
-        TopListSide.style.opacity = "1";
+        let TopListSide = document.createElement('div')
+        TopListSide.style.width = '4px'
+        TopListSide.style.height = '30px'
+        TopListSide.style.top = '-4px'
+        TopListSide.style.left = '-4px'
+        TopListSide.style.position = 'absolute'
+        TopListSide.style.backgroundColor = '#fff'
+        TopListSide.style.zIndex = '522'
+        TopListSide.style.opacity = '1'
         //右上边线
-        let RightTopSide = document.createElement("div");
-        RightTopSide.style.width = "30px";
-        RightTopSide.style.height = "4px";
-        RightTopSide.style.top = "-4px";
-        RightTopSide.style.right = "-4px";
-        RightTopSide.style.position = "absolute";
-        RightTopSide.style.backgroundColor = "#fff";
-        RightTopSide.style.zIndex = "522";
-        RightTopSide.style.opacity = "1";
+        let RightTopSide = document.createElement('div')
+        RightTopSide.style.width = '30px'
+        RightTopSide.style.height = '4px'
+        RightTopSide.style.top = '-4px'
+        RightTopSide.style.right = '-4px'
+        RightTopSide.style.position = 'absolute'
+        RightTopSide.style.backgroundColor = '#fff'
+        RightTopSide.style.zIndex = '522'
+        RightTopSide.style.opacity = '1'
         //上右边线
-        let TopRightSide = document.createElement("div");
-        TopRightSide.style.width = "4px";
-        TopRightSide.style.height = "30px";
-        TopRightSide.style.top = "-4px";
-        TopRightSide.style.right = "-4px";
-        TopRightSide.style.position = "absolute";
-        TopRightSide.style.backgroundColor = "#fff";
-        TopRightSide.style.zIndex = "522";
-        TopRightSide.style.opacity = "1";
+        let TopRightSide = document.createElement('div')
+        TopRightSide.style.width = '4px'
+        TopRightSide.style.height = '30px'
+        TopRightSide.style.top = '-4px'
+        TopRightSide.style.right = '-4px'
+        TopRightSide.style.position = 'absolute'
+        TopRightSide.style.backgroundColor = '#fff'
+        TopRightSide.style.zIndex = '522'
+        TopRightSide.style.opacity = '1'
         //左下边线
-        let LeftBottomSide = document.createElement("div");
-        LeftBottomSide.style.width = "30px";
-        LeftBottomSide.style.height = "4px";
-        LeftBottomSide.style.bottom = "-4px";
-        LeftBottomSide.style.left = "-4px";
-        LeftBottomSide.style.position = "absolute";
-        LeftBottomSide.style.backgroundColor = "#fff";
-        LeftBottomSide.style.zIndex = "522";
-        LeftBottomSide.style.opacity = "1";
+        let LeftBottomSide = document.createElement('div')
+        LeftBottomSide.style.width = '30px'
+        LeftBottomSide.style.height = '4px'
+        LeftBottomSide.style.bottom = '-4px'
+        LeftBottomSide.style.left = '-4px'
+        LeftBottomSide.style.position = 'absolute'
+        LeftBottomSide.style.backgroundColor = '#fff'
+        LeftBottomSide.style.zIndex = '522'
+        LeftBottomSide.style.opacity = '1'
         //下左边线
-        let BottomListSide = document.createElement("div");
-        BottomListSide.style.width = "4px";
-        BottomListSide.style.height = "30px";
-        BottomListSide.style.bottom = "-4px";
-        BottomListSide.style.left = "-4px";
-        BottomListSide.style.position = "absolute";
-        BottomListSide.style.backgroundColor = "#fff";
-        BottomListSide.style.zIndex = "522";
-        BottomListSide.style.opacity = "1";
+        let BottomListSide = document.createElement('div')
+        BottomListSide.style.width = '4px'
+        BottomListSide.style.height = '30px'
+        BottomListSide.style.bottom = '-4px'
+        BottomListSide.style.left = '-4px'
+        BottomListSide.style.position = 'absolute'
+        BottomListSide.style.backgroundColor = '#fff'
+        BottomListSide.style.zIndex = '522'
+        BottomListSide.style.opacity = '1'
         //右下边线
-        let RightBottomSide = document.createElement("div");
-        RightBottomSide.style.width = "30px";
-        RightBottomSide.style.height = "4px";
-        RightBottomSide.style.bottom = "-4px";
-        RightBottomSide.style.right = "-4px";
-        RightBottomSide.style.position = "absolute";
-        RightBottomSide.style.backgroundColor = "#fff";
-        RightBottomSide.style.zIndex = "522";
-        RightBottomSide.style.opacity = "1";
+        let RightBottomSide = document.createElement('div')
+        RightBottomSide.style.width = '30px'
+        RightBottomSide.style.height = '4px'
+        RightBottomSide.style.bottom = '-4px'
+        RightBottomSide.style.right = '-4px'
+        RightBottomSide.style.position = 'absolute'
+        RightBottomSide.style.backgroundColor = '#fff'
+        RightBottomSide.style.zIndex = '522'
+        RightBottomSide.style.opacity = '1'
         //下右边线
-        let BottomRightSide = document.createElement("div");
-        BottomRightSide.style.width = "4px";
-        BottomRightSide.style.height = "30px";
-        BottomRightSide.style.bottom = "-4px";
-        BottomRightSide.style.right = "-4px";
-        BottomRightSide.style.position = "absolute";
-        BottomRightSide.style.backgroundColor = "#fff";
-        BottomRightSide.style.zIndex = "522";
-        BottomRightSide.style.opacity = "1";
+        let BottomRightSide = document.createElement('div')
+        BottomRightSide.style.width = '4px'
+        BottomRightSide.style.height = '30px'
+        BottomRightSide.style.bottom = '-4px'
+        BottomRightSide.style.right = '-4px'
+        BottomRightSide.style.position = 'absolute'
+        BottomRightSide.style.backgroundColor = '#fff'
+        BottomRightSide.style.zIndex = '522'
+        BottomRightSide.style.opacity = '1'
         //一起生成
-        box.appendChild(verticalLeft);
-        box.appendChild(verticalRight);
-        box.appendChild(verticalTop);
-        box.appendChild(verticalBottom);
-        box.appendChild(LeftTopSide);
-        box.appendChild(TopListSide);
-        box.appendChild(RightTopSide);
-        box.appendChild(TopRightSide);
-        box.appendChild(LeftBottomSide);
-        box.appendChild(BottomListSide);
-        box.appendChild(RightBottomSide);
-        box.appendChild(BottomRightSide);
+        box.appendChild(verticalLeft)
+        box.appendChild(verticalRight)
+        box.appendChild(verticalTop)
+        box.appendChild(verticalBottom)
+        box.appendChild(LeftTopSide)
+        box.appendChild(TopListSide)
+        box.appendChild(RightTopSide)
+        box.appendChild(TopRightSide)
+        box.appendChild(LeftBottomSide)
+        box.appendChild(BottomListSide)
+        box.appendChild(RightBottomSide)
+        box.appendChild(BottomRightSide)
       }
     },
     //异步onload图片
     onLoadImg(photoUrl: any) {
-      return new Promise(function(resolve, reject) {
-        let reader = new FileReader();
-        reader.readAsDataURL(photoUrl);
+      return new Promise(function (resolve, reject) {
+        let reader = new FileReader()
+        reader.readAsDataURL(photoUrl)
         reader.onload = (e: any) => {
-          resolve(e.target["result"]);
-        };
-      });
+          resolve(e.target['result'])
+        }
+      })
     },
     /**
      * 载入文件
@@ -236,14 +236,14 @@ export default defineComponent({
     loadFile(file: any) {
       if (file instanceof File) {
         this.onLoadImg(file).then((base64: any) => {
-          this.img = base64;
+          this.img = base64
           setTimeout(() => {
-            this.config.autoCrop = true;
-            this.addSlide();
-          }, 10);
-        });
+            this.config.autoCrop = true
+            this.addSlide()
+          }, 10)
+        })
       } else {
-        throw new Error("Arguments file is not File");
+        throw new Error('Arguments file is not File')
       }
     },
     /**
@@ -251,70 +251,70 @@ export default defineComponent({
      * @param base64
      */
     loadBase64(base64: string) {
-      if (typeof base64 !== "string") {
-        throw new Error("Arguments base64 is not string");
+      if (typeof base64 !== 'string') {
+        throw new Error('Arguments base64 is not string')
       }
-      const base = base64.split(",");
+      const base = base64.split(',')
       if (!/^data:image\/(.*?);base64$/.test(base[0])) {
-        throw new Error("Arguments base64 MIME is not image/*");
+        throw new Error('Arguments base64 MIME is not image/*')
       }
       // Base64 Regex @see https://learnku.com/articles/42295
       if (
         !/^[\/]?([\da-zA-Z]+[\/+]+)*[\da-zA-Z]+([+=]{1,2}|[\/])?$/.test(base[1])
       ) {
-        throw new Error("Not standard base64");
+        throw new Error('Not standard base64')
       }
-      this.img = base64;
+      this.img = base64
       setTimeout(() => {
-        this.config.autoCrop = true;
-        this.addSlide();
-      }, 10);
+        this.config.autoCrop = true
+        this.addSlide()
+      }, 10)
     },
     rotating(e: any) {
-      (this as any).$refs.cropper.rotateRight();
+      ;(this as any).$refs.cropper.rotateRight()
       // document.getElementsByClassName("cropper-modal")[0].style = "background-color: rgba(0,0,0,0.5);transition: 0.88s";
     },
     canceltailor() {
-      this.img = ""
+      this.img = ''
       this.onCancelTailor()
     },
     tailoring() {
       // 获取截图的base64数据
-      (this as any).$refs.cropper.getCropData((data: any) => {
-        this.getBase64Data(data);
-        this.getBlob(data);
-        this.img = "";
-        this.config.autoCrop = false;
-      });
+      ;(this as any).$refs.cropper.getCropData((data: any) => {
+        this.getBase64Data(data)
+        this.getBlob(data)
+        this.img = ''
+        this.config.autoCrop = false
+      })
       // 获取截图的blob数据
-      (this as any).$refs.cropper.getCropBlob((data: BlobPart) => {
-        this.getBase64Data(data);
-        this.getBlob(data);
+      ;(this as any).$refs.cropper.getCropBlob((data: BlobPart) => {
+        this.getBase64Data(data)
+        this.getBlob(data)
         // Blob 转 File
         const suffix = {
-          jpeg: "jpg",
-          png: "png",
-          webp: "webp"
-        }[this.config.outputType];
-        const time = new Date().getTime();
+          jpeg: 'jpg',
+          png: 'png',
+          webp: 'webp'
+        }[this.config.outputType]
+        const time = new Date().getTime()
         const file = new File([data], `${time}.${suffix}`, {
           type: `image/${this.config.outputType}`
-        });
-        this.getFile(file);
-        this.img = "";
-        this.config.autoCrop = false;
-      });
+        })
+        this.getFile(file)
+        this.img = ''
+        this.config.autoCrop = false
+      })
     },
     async upPhoto(e: any) {
-      let photoUrl = e.target.files[0];
-      (this as any).$refs.headInput.value = null;
+      let photoUrl = e.target.files[0]
+      ;(this as any).$refs.headInput.value = null
       if (photoUrl != undefined) {
-        this.imgOriginF(photoUrl);
-        this.img = await this.onLoadImg(photoUrl) as string;
-        this.config.autoCrop = true;
+        this.imgOriginF(photoUrl)
+        this.img = (await this.onLoadImg(photoUrl)) as string
+        this.config.autoCrop = true
         setTimeout(() => {
-          this.addSlide();
-        }, 20);
+          this.addSlide()
+        }, 20)
       }
     },
     onCropMoving(e: any) {
@@ -322,75 +322,107 @@ export default defineComponent({
     },
     onImgMoving(e: any) {
       // console.log('onCropMoving')
-    },
+    }
   },
   render() {
     return (
       <div class={[styles.upbtn, styles.uploadWarper]}>
         {this.hideInput}
-        {!this.hideInput ? <input
-          style="opacity: 0;"
-          class={styles.upbtn}
-          type="file"
-          accept="image/*"
-          onChange={this.upPhoto}
-          ref="headInput"
-        /> : null}
-        {this.img != '' ? <div class={styles.bg}>
-          {this.config.ceilbutton ? <div class={styles.btndiv}>
-            <div class={styles.btn} onClick={this.canceltailor} style={{
-              backgroundColor: this.config.cancelButtonBackgroundColor,
-              color: this.config.cancelButtonTextColor
-            }}>{ this.config.cancelButtonText }</div>
-            <div class={styles.img} onClick={this.rotating}></div>
-            <div class={styles.btn} onClick={this.tailoring} style={{
-              backgroundColor: this.config.confirmButtonBackgroundColor,
-              color: this.config.confirmButtonTextColor
-            }}>{ this.config.confirmButtonText }</div>
-          </div> : null}
+        {!this.hideInput ? (
+          <input
+            style="opacity: 0;"
+            class={styles.upbtn}
+            type="file"
+            accept="image/*"
+            onChange={this.upPhoto}
+            ref="headInput"
+          />
+        ) : null}
+        {this.img != '' ? (
+          <div class={styles.bg}>
+            {this.config.ceilbutton ? (
+              <div class={styles.btndiv}>
+                <div
+                  class={styles.btn}
+                  onClick={this.canceltailor}
+                  style={{
+                    backgroundColor: this.config.cancelButtonBackgroundColor,
+                    color: this.config.cancelButtonTextColor
+                  }}
+                >
+                  {this.config.cancelButtonText}
+                </div>
+                <div class={styles.img} onClick={this.rotating}></div>
+                <div
+                  class={styles.btn}
+                  onClick={this.tailoring}
+                  style={{
+                    backgroundColor: this.config.confirmButtonBackgroundColor,
+                    color: this.config.confirmButtonTextColor
+                  }}
+                >
+                  {this.config.confirmButtonText}
+                </div>
+              </div>
+            ) : null}
 
-          <div class={styles.wrapper}>
-            <VueCropper
-              ref="cropper"
-              img={this.img}
-              outputSize={this.config.outputSize}
-              outputType={this.config.outputType}
-              info={this.config.info}
-              canScale={this.config.canScale}
-              autoCrop={this.config.autoCrop}
-              autoCropWidth={this.config.autoCropWidth}
-              autoCropHeight={this.config.autoCropHeight}
-              fixedBox={this.config.fixedBox}
-              fixed={this.config.fixed}
-              fixedNumber={this.config.fixedNumber}
-              full={this.config.full}
-              canMove={this.config.canMove}
-              canMoveBox={this.config.canMoveBox}
-              original={this.config.original}
-              centerBox={this.config.centerBox}
-              high={this.config.high}
-              infoTrue={this.config.infoTrue}
-              maxImgSize={this.config.maxImgSize}
-              enlarge={this.config.enlarge}
-              mode={this.config.mode}
-              onCropMoving={this.onCropMoving}
-              onImgMoving={this.onImgMoving}
-            ></VueCropper>
-          </div>
+            <div class={styles.wrapper}>
+              <VueCropper
+                ref="cropper"
+                img={this.img}
+                outputSize={this.config.outputSize}
+                outputType={this.config.outputType}
+                info={this.config.info}
+                canScale={this.config.canScale}
+                autoCrop={this.config.autoCrop}
+                autoCropWidth={this.config.autoCropWidth}
+                autoCropHeight={this.config.autoCropHeight}
+                fixedBox={this.config.fixedBox}
+                fixed={this.config.fixed}
+                fixedNumber={this.config.fixedNumber}
+                full={this.config.full}
+                canMove={this.config.canMove}
+                canMoveBox={this.config.canMoveBox}
+                original={this.config.original}
+                centerBox={this.config.centerBox}
+                high={this.config.high}
+                infoTrue={this.config.infoTrue}
+                maxImgSize={this.config.maxImgSize}
+                enlarge={this.config.enlarge}
+                mode={this.config.mode}
+                onCropMoving={this.onCropMoving}
+                onImgMoving={this.onImgMoving}
+              ></VueCropper>
+            </div>
 
-          {!this.config.ceilbutton ? <div class={styles.btndiv}>
-            <div class={styles.btn} onClick={this.canceltailor} style={{
-              backgroundColor: this.config.cancelButtonBackgroundColor,
-              color: this.config.cancelButtonTextColor
-            }}>{this.config.cancelButtonText}</div>
-            <div class={styles.img} onClick={this.rotating}></div>
-            <div class={styles.btn} onClick={this.tailoring} style={{
-              backgroundColor: this.config.confirmButtonBackgroundColor,
-              color: this.config.confirmButtonTextColor
-            }}>{this.config.confirmButtonText}</div>
-          </div> : null }
-        </div> : null }
+            {!this.config.ceilbutton ? (
+              <div class={styles.btndiv}>
+                <div
+                  class={styles.btn}
+                  onClick={this.canceltailor}
+                  style={{
+                    backgroundColor: this.config.cancelButtonBackgroundColor,
+                    color: this.config.cancelButtonTextColor
+                  }}
+                >
+                  {this.config.cancelButtonText}
+                </div>
+                <div class={styles.img} onClick={this.rotating}></div>
+                <div
+                  class={styles.btn}
+                  onClick={this.tailoring}
+                  style={{
+                    backgroundColor: this.config.confirmButtonBackgroundColor,
+                    color: this.config.confirmButtonTextColor
+                  }}
+                >
+                  {this.config.confirmButtonText}
+                </div>
+              </div>
+            ) : null}
+          </div>
+        ) : null}
       </div>
     )
   }
-})
+})

+ 39 - 2
src/components/col-upload/index.tsx

@@ -3,6 +3,7 @@ import { defineComponent } from 'vue'
 import styles from './index.module.less'
 import ColCropper from '../col-cropper'
 import { useCustomFieldValue } from '@vant/use'
+import { postMessage } from '@/helpers/native-message'
 
 import iconUploader from '@common/images/icon_uploader.png'
 import request from '@/helpers/request'
@@ -19,6 +20,11 @@ export default defineComponent({
       type: Boolean,
       default: true
     },
+    native: {
+      // 是否原生上传
+      type: Boolean,
+      default: false
+    },
     cropper: {
       // 是否进行裁切
       type: Boolean,
@@ -40,6 +46,14 @@ export default defineComponent({
     }
   },
   methods: {
+    nativeUpload() {
+      postMessage(
+        { api: 'chooseFile', content: { type: 'img', max: 1 } },
+        (res: any) => {
+          this.$emit('update:modelValue', res.fileUrl)
+        }
+      )
+    },
     beforeRead(file: any) {
       const isLt2M = file.size / 1024 / 1024 < this.uploadSize
       if (!isLt2M) {
@@ -98,7 +112,7 @@ export default defineComponent({
             class={styles['img-close']}
           />
         ) : null}
-        {this.cropper ? (
+        {this.cropper && !this.native ? (
           <div class={styles['col-uploader']}>
             {this.modelValue ? (
               <Image
@@ -115,8 +129,31 @@ export default defineComponent({
             )}
             <ColCropper option={this.options} getFile={this.getFile} />
           </div>
+        ) : this.native ? (
+          <div
+            style={{
+              display: 'flex',
+              alignItems: 'center',
+              justifyContent: 'center',
+              height: '100%'
+            }}
+            onClick={this.nativeUpload}
+          >
+            {this.modelValue ? (
+              <Image
+                fit="cover"
+                position="center"
+                class={styles.uploadImg}
+                src={this.modelValue}
+              />
+            ) : (
+              <div class={styles.uploader}>
+                <Icon name={iconUploader} size="32" />
+                <p class={styles.uploaderText}>{this.tips}</p>
+              </div>
+            )}
+          </div>
         ) : (
-          // @ts-ignore
           <Uploader
             afterRead={this.afterRead}
             beforeRead={this.beforeRead}

+ 7 - 2
src/student/live-class/live-detail.tsx

@@ -21,6 +21,7 @@ export default defineComponent({
     const query = this.$route.query
     return {
       groupId: query.groupId,
+      courseId: query.courseId,
       live: {} as any
     }
   },
@@ -55,7 +56,8 @@ export default defineComponent({
           courseTime: `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(
             startTime
           ).format('HH:mm')}~${dayjs(endTime).format('HH:mm')}`,
-          coursePlan: item.plan
+          coursePlan: item.plan,
+          id: item.id
         })
       })
       return tempArr || []
@@ -164,7 +166,10 @@ export default defineComponent({
           icon="courseList"
           contentStyle={{ paddingTop: '0' }}
         >
-          <CoursePlanStep courseInfo={this.courseInfo} />
+          <CoursePlanStep
+            courseInfo={this.courseInfo}
+            courseId={Number(this.courseId) || 0}
+          />
         </SectionDetail>
 
         <div class={styles.tips}>

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

@@ -57,7 +57,8 @@ export default defineComponent({
           courseTime: `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(
             startTime
           ).format('HH:mm')}~${dayjs(endTime).format('HH:mm')}`,
-          coursePlan: item.plan
+          coursePlan: item.plan,
+          id: item.id
         })
       })
       return tempArr || []
@@ -128,7 +129,10 @@ export default defineComponent({
         >
           <Tabs color="var(--van-primary)" lineWidth={20} sticky>
             <Tab title="课程" titleClass="van-hairline--bottom">
-              <CoursePlanStep courseInfo={this.courseInfo} />
+              <CoursePlanStep
+                courseInfo={this.courseInfo}
+                courseId={Number(this.courseId) || 0}
+              />
             </Tab>
             <Tab title="学员列表" titleClass="van-hairline--bottom">
               {this.studentList.map((item: any) => (

+ 8 - 0
src/teacher/video-class/class-info.tsx

@@ -267,6 +267,14 @@ export default defineComponent({
                         class={styles.imgContainer}
                       />
                     </Col>
+                    <Col span={24}>
+                      <p
+                        class={styles.photoTip}
+                        style={{ color: '#ff4e19', padding: '0' }}
+                      >
+                        图片尺寸为750*500能达到最佳显示效果
+                      </p>
+                    </Col>
                   </Row>
                 )
               }}