Ver Fonte

修改两个视屏播放的问题

lex há 1 ano atrás
pai
commit
d7f751883f

+ 17 - 2
public/project/initiation.html

@@ -188,7 +188,7 @@
       <div class="top-tips">科学的教育与关爱,足以改变世界。我们希望,学员的未来会因您和我们的共同努力而更加光辉灿烂!</div>
       <div class="top-tips">科学的教育与关爱,足以改变世界。我们希望,学员的未来会因您和我们的共同努力而更加光辉灿烂!</div>
       <van-cell-group inset class="cell-group">
       <van-cell-group inset class="cell-group">
         <van-field label="学员姓名" :rules="[{ validator, message }]" name="username" v-model="stu.username"
         <van-field label="学员姓名" :rules="[{ validator, message }]" name="username" v-model="stu.username"
-          placeholder="请填写学员真实姓名"></van-field>
+          placeholder="请填写学员真实姓名" autocomplete="off"></van-field>
         <!-- <van-field label="性别" name="sex" :rules="[{ required: true, message: '请选择性别' }]">
         <!-- <van-field label="性别" name="sex" :rules="[{ required: true, message: '请选择性别' }]">
           <template #input>
           <template #input>
             <van-radio-group v-model="stu.sex" checked-color="#FF8057" direction="horizontal">
             <van-radio-group v-model="stu.sex" checked-color="#FF8057" direction="horizontal">
@@ -346,6 +346,21 @@
           document.querySelector('#m_loading').remove()
           document.querySelector('#m_loading').remove()
         }
         }
 
 
+        // 重置数据
+        this.stu = {
+          username: null, // 姓名
+          // sex: 1, // 性别
+          phone: null, // 电话
+          currentGrade: '', // 年级
+          currentGradeNum: null, // 年级编号
+          currentClass: '', // 班级
+          currentClassNum: null, // 年级编号
+          learningSubjectName: null,
+          joinOrchestra: null, //
+          personalSuggestion: null, // 个人建议
+          joinParentMeeting: null
+        }
+
         // 判断是否是微信,只能微信中打开
         // 判断是否是微信,只能微信中打开
         if (!browser().weixin) {
         if (!browser().weixin) {
           this.showPopup = true
           this.showPopup = true
@@ -552,4 +567,4 @@
   </script>
   </script>
 </body>
 </body>
 
 
-</html>
+</html>

+ 21 - 4
src/helpers/utils.ts

@@ -2,6 +2,7 @@ import dayjs from 'dayjs'
 import numeral from 'numeral'
 import numeral from 'numeral'
 import { Toast } from 'vant'
 import { Toast } from 'vant'
 import { state as helpState } from './helpState'
 import { state as helpState } from './helpState'
+import qs from 'query-string'
 
 
 export const browser = () => {
 export const browser = () => {
   const u = navigator.userAgent
   const u = navigator.userAgent
@@ -45,6 +46,18 @@ export const getUrlCode = (name = 'code') => {
   return theRequest[name]
   return theRequest[name]
 }
 }
 
 
+export const getQuery = (name = 'code') => {
+  let search: any = {}
+  try {
+    search = {
+      ...qs.parse(location.search),
+      ...qs.parse(location.hash.split('?')[1])
+    }
+  } catch (error) {
+    //
+  }
+  return search[name]
+}
 export const getRandomKey = () => {
 export const getRandomKey = () => {
   const key = '' + new Date().getTime() + Math.floor(Math.random() * 1000000)
   const key = '' + new Date().getTime() + Math.floor(Math.random() * 1000000)
   return key
   return key
@@ -125,8 +138,12 @@ export const dateFormat = (value: string | Date, format = 'YYYY-MM-DD HH:mm:ss')
 // 秒转分
 // 秒转分
 export const getSecondRPM = (second: number, type?: string) => {
 export const getSecondRPM = (second: number, type?: string) => {
   if (isNaN(second)) return '00:00'
   if (isNaN(second)) return '00:00'
-  const mm = Math.floor(second / 60).toString().padStart(2, '0')
-  const dd = Math.floor(second % 60).toString().padStart(2, '0')
+  const mm = Math.floor(second / 60)
+    .toString()
+    .padStart(2, '0')
+  const dd = Math.floor(second % 60)
+    .toString()
+    .padStart(2, '0')
   if (type === 'cn') {
   if (type === 'cn') {
     return mm + '分' + dd + '秒'
     return mm + '分' + dd + '秒'
   } else {
   } else {
@@ -136,8 +153,8 @@ export const getSecondRPM = (second: number, type?: string) => {
 
 
 /**
 /**
  * @description 格式化日期控件显示内容
  * @description 格式化日期控件显示内容
- * @param type 
- * @param option 
+ * @param type
+ * @param option
  * @returns OBJECT
  * @returns OBJECT
  */
  */
 export const formatterDatePicker = (type: any, option: any) => {
 export const formatterDatePicker = (type: any, option: any) => {

+ 19 - 10
src/views/coursewarePlay/index.module.less

@@ -37,7 +37,8 @@
   background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
   background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
   transition: transform 0.5s;
   transition: transform 0.5s;
   box-sizing: border-box;
   box-sizing: border-box;
-  div{
+
+  div {
     box-sizing: border-box;
     box-sizing: border-box;
   }
   }
 }
 }
@@ -57,7 +58,8 @@
     }
     }
   }
   }
 }
 }
-.headRight{
+
+.headRight {
   position: relative;
   position: relative;
   z-index: 10;
   z-index: 10;
   display: flex;
   display: flex;
@@ -65,13 +67,15 @@
   margin-left: auto;
   margin-left: auto;
   height: 100%;
   height: 100%;
   padding-right: 15px;
   padding-right: 15px;
-  .rightBtn{
+
+  .rightBtn {
     display: flex;
     display: flex;
     justify-content: center;
     justify-content: center;
     align-items: center;
     align-items: center;
     height: 100%;
     height: 100%;
     padding: 0 10px;
     padding: 0 10px;
-    img{
+
+    img {
       width: 22px;
       width: 22px;
       height: 22px;
       height: 22px;
       display: block;
       display: block;
@@ -127,18 +131,23 @@
   backface-visibility: hidden;
   backface-visibility: hidden;
   overflow: hidden;
   overflow: hidden;
   z-index: 1;
   z-index: 1;
-  &.itemActive{
+
+  &.itemActive {
     z-index: 10;
     z-index: 10;
   }
   }
-  &.acitveAnimation{
+
+  &.acitveAnimation {
     transition-duration: .8s;
     transition-duration: .8s;
   }
   }
-  &.show{
+
+  &.show {
     display: block;
     display: block;
   }
   }
-  &.hide{
+
+  &.hide {
     display: none;
     display: none;
   }
   }
+
   video {
   video {
     width: 100%;
     width: 100%;
     height: 100%;
     height: 100%;
@@ -356,6 +365,6 @@
   }
   }
 }
 }
 
 
-.popupMore{
+.popupMore {
   background: rgba(0, 0, 0, 0.8);
   background: rgba(0, 0, 0, 0.8);
-}
+}

+ 17 - 8
src/views/coursewarePlay/index.tsx

@@ -444,6 +444,7 @@ export default defineComponent({
     const handleStop = () => {
     const handleStop = () => {
       for (let i = 0; i < data.itemList.length; i++) {
       for (let i = 0; i < data.itemList.length; i++) {
         const activeItem = data.itemList[i]
         const activeItem = data.itemList[i]
+
         if (activeItem.type === 'VIDEO') {
         if (activeItem.type === 'VIDEO') {
           activeItem.videoEle?.pause()
           activeItem.videoEle?.pause()
           activeItem.videoEle?.stop()
           activeItem.videoEle?.stop()
@@ -603,7 +604,13 @@ export default defineComponent({
             if (item.type == 'SONG') {
             if (item.type == 'SONG') {
               activeData.model = true
               activeData.model = true
             }
             }
-            if (item.type === 'VIDEO') {
+          }
+          requestAnimationFrame(() => {
+            const _effectIndex = effectIndex.value + 1
+            effectIndex.value = _effectIndex >= effects.length - 1 ? 0 : _effectIndex
+
+            handleStop()
+            if (item && item.type === 'VIDEO') {
               // 自动播放下一个视频
               // 自动播放下一个视频
               clearTimeout(activeData.timer)
               clearTimeout(activeData.timer)
               closeToast()
               closeToast()
@@ -612,10 +619,6 @@ export default defineComponent({
                 item.videoEle?.play()
                 item.videoEle?.play()
               })
               })
             }
             }
-          }
-          requestAnimationFrame(() => {
-            const _effectIndex = effectIndex.value + 1
-            effectIndex.value = _effectIndex >= effects.length - 1 ? 0 : _effectIndex
           })
           })
         },
         },
         activeData.isAnimation ? 800 : 0
         activeData.isAnimation ? 800 : 0
@@ -719,12 +722,16 @@ export default defineComponent({
                 // if (isRender) {
                 // if (isRender) {
                 //   m.isRender = true
                 //   m.isRender = true
                 // }
                 // }
+                // 判断是否是当前选中的元素
+                const activeEle = popupData.activeIndex === mIndex ? true : false
+
                 return isRender ? (
                 return isRender ? (
                   <div
                   <div
                     key={'index' + mIndex}
                     key={'index' + mIndex}
+                    data-id={'data' + mIndex}
                     class={[
                     class={[
                       styles.itemDiv,
                       styles.itemDiv,
-                      popupData.activeIndex === mIndex && styles.itemActive,
+                      activeEle && styles.itemActive,
                       activeData.isAnimation && styles.acitveAnimation,
                       activeData.isAnimation && styles.acitveAnimation,
                       Math.abs(popupData.activeIndex - mIndex) < 2 ? styles.show : styles.hide
                       Math.abs(popupData.activeIndex - mIndex) < 2 ? styles.show : styles.hide
                     ]}
                     ]}
@@ -759,7 +766,7 @@ export default defineComponent({
                         <VideoPlay
                         <VideoPlay
                           ref={(v: any) => (data.videoRefs[mIndex] = v)}
                           ref={(v: any) => (data.videoRefs[mIndex] = v)}
                           item={m}
                           item={m}
-                          isActive={popupData.activeIndex === mIndex}
+                          isActive={activeEle}
                           isEmtry={isEmtry}
                           isEmtry={isEmtry}
                           onLoadedmetadata={(videoItem: any) => {
                           onLoadedmetadata={(videoItem: any) => {
                             m.videoEle = videoItem
                             m.videoEle = videoItem
@@ -810,7 +817,9 @@ export default defineComponent({
                       />
                       />
                     )}
                     )}
                   </div>
                   </div>
-                ) : null
+                ) : (
+                  ''
+                )
               })}
               })}
             </div>
             </div>
             <Transition name="right">
             <Transition name="right">

+ 4 - 0
src/views/unit-test/unit-create/index.tsx

@@ -135,6 +135,10 @@ export default defineComponent({
                   readonly
                   readonly
                   input-align="right"
                   input-align="right"
                   onClick={() => {
                   onClick={() => {
+                    if (state.actions.length <= 0) {
+                      showToast('暂无乐团')
+                      return
+                    }
                     state.showPopoverOrchestra = true
                     state.showPopoverOrchestra = true
                   }}
                   }}
                 >
                 >