lex 1 year ago
parent
commit
146516142e

+ 155 - 144
src/business-components/course-plan-step/index.module.less

@@ -1,144 +1,155 @@
-.col-steps {
-  padding: 0 0 0 28px;
-  overflow: hidden;
-  background-color: #fff;
-
-  .col-step {
-    display: block;
-    float: none;
-    padding: 10px 0;
-    line-height: 18px;
-    position: relative;
-    flex: 1;
-    color: #7a7a7a;
-    font-size: 13px;
-
-    &:last-child .col-step__line {
-      border: 0;
-    }
-  }
-
-  .col-step_circle {
-    position: absolute;
-    top: 19px;
-    left: -18px;
-    z-index: 1;
-    width: 18px;
-    height: 18px;
-    font-size: 12px;
-    border-radius: 50%;
-    background: var(--van-primary);
-    transform: translate(-50%, -50%);
-    text-align: center;
-    line-height: 20px;
-    color: #fff;
-  }
-
-  .col-step__line {
-    top: 16px;
-    left: -19px;
-    width: 0px;
-    border-left: 1px dashed var(--van-primary);
-    height: 100%;
-    position: absolute;
-    transform: background-color 0.3s;
-  }
-
-  .stepSection {
-    .stepTitle {
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-      font-size: 13px;
-      color: #999;
-
-      .stepTitleNum {
-        font-size: 14px;
-        font-weight: 500;
-      }
-      .active {
-        color: var(--van-primary);
-      }
-    }
-    .stepContent {
-      padding-top: 10px;
-      font-size: 13px;
-      color: #7a7a7a;
-      line-height: 20px;
-    }
-  }
-
-  .videoText {
-    padding-top: 6px;
-    color: var(--van-primary);
-    font-size: 14px;
-  }
-
-  .videoImg {
-    margin-top: 10px;
-    width: 150px;
-    height: 100px;
-    position: relative;
-    border-radius: 4px;
-    overflow: hidden;
-    :global {
-      .van-image {
-        width: inherit;
-        height: inherit;
-      }
-    }
-
-    .videoStop {
-      position: absolute;
-      top: 0;
-      right: 0;
-      left: 0;
-      bottom: 0;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-    }
-  }
-}
-
-.videoList {
-  padding: 16px;
-
-  .videoTitle {
-    font-size: 18px;
-    font-weight: 500;
-    color: #333333;
-    line-height: 30px;
-    display: flex;
-    align-items: center;
-    i {
-      display: inline-block;
-      width: 4px;
-      height: 18px;
-      margin-right: 8px;
-      border-radius: 2px;
-      background-color: var(--van-primary);
-    }
-  }
-
-  .videoSection {
-    padding-top: 12px;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    flex-wrap: wrap;
-  }
-
-  .videoItem {
-    width: 48%;
-    border-radius: 6px;
-    margin-bottom: 8px;
-  }
-
-  :global {
-    .plyr {
-      // width: 130px;
-      min-width: 50%;
-    }
-  }
-}
+.col-steps {
+  padding: 0 0 0 28px;
+  overflow: hidden;
+  background-color: #fff;
+
+  .col-step {
+    display: block;
+    float: none;
+    padding: 10px 0;
+    line-height: 18px;
+    position: relative;
+    flex: 1;
+    color: #7a7a7a;
+    font-size: 13px;
+
+    &:last-child .col-step__line {
+      border: 0;
+    }
+  }
+
+  .col-step_circle {
+    position: absolute;
+    top: 19px;
+    left: -18px;
+    z-index: 1;
+    width: 18px;
+    height: 18px;
+    font-size: 12px;
+    border-radius: 50%;
+    background: var(--van-primary);
+    transform: translate(-50%, -50%);
+    text-align: center;
+    line-height: 20px;
+    color: #fff;
+  }
+
+  .col-step__line {
+    top: 16px;
+    left: -19px;
+    width: 0px;
+    border-left: 1px dashed var(--van-primary);
+    height: 100%;
+    position: absolute;
+    transform: background-color 0.3s;
+  }
+
+  .stepSection {
+    .stepTitle {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      font-size: 13px;
+      color: #999;
+
+      .stepTitleNum {
+        font-size: 14px;
+        font-weight: 500;
+      }
+
+      .active {
+        color: var(--van-primary);
+      }
+    }
+
+    .stepContent {
+      padding-top: 10px;
+      font-size: 13px;
+      color: #7a7a7a;
+      line-height: 20px;
+    }
+  }
+
+  .videoText {
+    padding-top: 6px;
+    color: var(--van-primary);
+    font-size: 14px;
+  }
+
+  .videoImg {
+    margin-top: 10px;
+    width: 150px;
+    height: 100px;
+    position: relative;
+    border-radius: 4px;
+    overflow: hidden;
+
+    :global {
+      .van-image {
+        width: inherit;
+        height: inherit;
+      }
+    }
+
+    .videoStop {
+      position: absolute;
+      top: 0;
+      right: 0;
+      left: 0;
+      bottom: 0;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+  }
+}
+
+.videoList {
+  padding: 16px;
+
+  .videoTitle {
+    font-size: 18px;
+    font-weight: 500;
+    color: #333333;
+    line-height: 30px;
+    display: flex;
+    align-items: center;
+
+    i {
+      display: inline-block;
+      width: 4px;
+      height: 18px;
+      margin-right: 8px;
+      border-radius: 2px;
+      background-color: var(--van-primary);
+    }
+  }
+
+  .videoSection {
+    padding-top: 12px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    max-height: 60vh;
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+
+  .videoItem {
+    width: 100%;
+    border-radius: 6px;
+    margin-bottom: 8px;
+  }
+
+  :global {
+    .plyr {
+      // width: 130px;
+      min-width: 50%;
+    }
+
+    .vjs-poster {
+      background-size: cover;
+    }
+  }
+}

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

@@ -1,129 +1,129 @@
-import { defineComponent, PropType } from 'vue'
-import styles from './index.module.less'
-import { Icon, Image, Popup } from 'vant'
-import videoStop from '@common/images/icon_video_stop.png'
-import VideoList from './video-list'
-import request from '@/helpers/request'
-
-interface IProps {
-  courseTime: string
-  coursePlan: string
-  videoPosterUrl?: string
-  roomUid?: string
-  liveState?: number
-  id?: number | string
-}
-
-export default defineComponent({
-  name: 'CoursePlanStep',
-  props: {
-    courseId: {
-      // 用于判断当前选择哪一节课程
-      type: Number,
-      default: 0
-    },
-    hideVideo: {
-      type: Boolean,
-      default: false
-    },
-    courseInfo: {
-      type: Array as PropType<IProps[]>,
-      default: []
-    }
-  },
-  data() {
-    return {
-      videoStatus: false,
-      list: []
-    }
-  },
-  // mounted() {
-  //   console.log(this.courseId, 'courseId 121212')
-  // },
-  methods: {
-    async onLookVideo(item: any) {
-      // console.log(item)
-      try {
-        const res = await request.get('/api-student/liveRoomVideo/queryVideo', {
-          params: {
-            roomUid: item.roomUid
-          }
-        })
-        console.log(res)
-        this.list = res.data || []
-        this.videoStatus = true
-      } catch {
-        //
-      }
-    }
-  },
-  render() {
-    return (
-      <div class={styles['col-steps']}>
-        <div class={styles['col-steps__items']}>
-          {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,
-                          (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.liveState === 2 && !this.hideVideo && (
-                        <div
-                          class={styles.videoText}
-                          onClick={() => {
-                            this.onLookVideo(item)
-                          }}
-                        >
-                          查看回放{'>>'}
-                        </div>
-                      )}
-                      {/* {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>
-            </div>
-          ))}
-        </div>
-
-        <Popup
-          v-model:show={this.videoStatus}
-          closeable
-          round
-          style={{ width: '90%' }}
-        >
-          {this.videoStatus && <VideoList list={this.list} />}
-        </Popup>
-      </div>
-    )
-  }
-})
+import { defineComponent, PropType } from 'vue'
+import styles from './index.module.less'
+import { Icon, Image, Popup } from 'vant'
+import videoStop from '@common/images/icon_video_stop.png'
+import VideoList from './video-list'
+import request from '@/helpers/request'
+
+interface IProps {
+  courseTime: string
+  coursePlan: string
+  videoPosterUrl?: string
+  roomUid?: string
+  liveState?: number
+  id?: number | string
+}
+
+export default defineComponent({
+  name: 'CoursePlanStep',
+  props: {
+    courseId: {
+      // 用于判断当前选择哪一节课程
+      type: Number,
+      default: 0
+    },
+    hideVideo: {
+      type: Boolean,
+      default: false
+    },
+    courseInfo: {
+      type: Array as PropType<IProps[]>,
+      default: []
+    }
+  },
+  data() {
+    return {
+      videoStatus: false,
+      list: []
+    }
+  },
+  // mounted() {
+  //   console.log(this.courseId, 'courseId 121212')
+  // },
+  methods: {
+    async onLookVideo(item: any) {
+      // console.log(item)
+      try {
+        const res = await request.get('/api-student/liveRoomVideo/queryVideo', {
+          params: {
+            roomUid: item.roomUid
+          }
+        })
+        console.log(res)
+        this.list = res.data || []
+        this.videoStatus = true
+      } catch {
+        //
+      }
+    }
+  },
+  render() {
+    return (
+      <div class={styles['col-steps']}>
+        <div class={styles['col-steps__items']}>
+          {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,
+                          (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.liveState === 2 && !this.hideVideo && (
+                        <div
+                          class={styles.videoText}
+                          onClick={() => {
+                            this.onLookVideo(item)
+                          }}
+                        >
+                          查看回放{'>>'}
+                        </div>
+                      )}
+                      {/* {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>
+            </div>
+          ))}
+        </div>
+
+        <Popup
+          v-model:show={this.videoStatus}
+          closeable
+          round
+          style={{ width: '90%' }}
+        >
+          {this.videoStatus && <VideoList list={this.list} />}
+        </Popup>
+      </div>
+    )
+  }
+})

+ 1 - 1
src/business-components/course-plan-step/video-list.tsx

@@ -26,7 +26,7 @@ export default defineComponent({
                   poster={videoBg}
                   src={item.url}
                   preload="none"
-                  height="82px"
+                  height="162px"
                   currentTime={false}
                 />
                 <p>{item.startTime}</p>