Bläddra i källkod

Merge branch 'jenkins' of http://git.dayaedu.com/lex/orchestra-app into jenkins

lex 2 år sedan
förälder
incheckning
f9f520084c

+ 1 - 1
src/views/courseList/index.tsx

@@ -106,7 +106,7 @@ export default defineComponent({
       postMessage({
         api: 'openWebView',
         content: {
-          url: `${location.origin}${location.pathname}/#/coursewarePlay?id=${item.lessonCoursewareDetailId}`,
+          url: `${location.origin}${location.pathname}/#/coursewarePlay?id=${item.lessonCoursewareDetailId}&source=my-course`,
           orientation: 0,
           isHideTitle: true,
           statusBarTextColor: false,

+ 34 - 0
src/views/coursewarePlay/component/musicScore.module.less

@@ -5,10 +5,12 @@
   -webkit-overflow-scrolling: touch;
   overflow: scroll;
   .container {
+    position: relative;
     display: block;
     border: none;
     width: 100%;
     height: 100%;
+    z-index: 10;
   }
   .musicModel {
     position: absolute;
@@ -45,4 +47,36 @@
   left: 4%;
   top: 50%;
   margin-top: -15Px;
+}
+.skeletonWrap{
+  position: absolute;
+  left: 0;
+  top: 0;
+  right: 0;
+  height: 100%;
+  z-index: 1;
+  padding-top: 1.2rem;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  overflow: hidden;
+  background: #fff;
+  pointer-events: none;
+}
+.skeleton {
+  --van-skeleton-paragraph-height: 24px;
+  :global{
+    .van-skeleton__content{
+      .van-skeleton-paragraph{
+        margin: 12px auto;
+        width: 80% !important;
+        &:first-child{
+          width: 60% !important;
+        }
+        &:last-child{
+          width: 100% !important;
+        }
+      }
+    }
+  }
 }

+ 9 - 4
src/views/coursewarePlay/component/musicScore.tsx

@@ -4,8 +4,9 @@ import qs from 'query-string'
 import OEmpty from '@/components/o-empty'
 import iconStart from '../image/icon-start.svg'
 import { postMessage } from '@/helpers/native-message'
-import { Loading } from 'vant'
+import { Loading, Skeleton } from 'vant'
 import { usePageVisibility } from '@vant/use'
+import { useRoute } from 'vue-router'
 
 export default defineComponent({
   name: 'musicScore',
@@ -20,6 +21,7 @@ export default defineComponent({
   },
   emits: ['setIframe'],
   setup(props, { emit }) {
+    const route = useRoute()
     const isLoading = ref(false)
     const pageVisibility = usePageVisibility()
     /** 页面显示和隐藏 */
@@ -93,7 +95,7 @@ export default defineComponent({
           frameborder="0"
           src={src}
         ></iframe>
-        {isLoaded.value && (
+        {route.query.source == 'my-course' && isLoaded.value && (
           <div
             style={{
               display: props.activeModel ? '' : 'none'
@@ -105,11 +107,14 @@ export default defineComponent({
             }}
           >
             <img src={iconStart} />
-            {isLoading.value && (
+            {/* {isLoading.value && (
               <Loading class={styles.loading} color="rgba(63,134,237,1)" size={16} />
-            )}
+            )} */}
           </div>
         )}
+        {!isLoaded.value && <div class={styles.skeletonWrap}>
+          <Skeleton class={styles.skeleton} row={8} />
+        </div>}
       </div>
     )
   }

+ 3 - 11
src/views/coursewarePlay/index.tsx

@@ -366,10 +366,6 @@ export default defineComponent({
       try {
         playRef.value?.handleOut()
       } catch (error) {}
-      if (route.query.source == 'my-course') {
-        router.back()
-        return
-      }
       postMessage({ api: 'goBack' })
     }
 
@@ -398,8 +394,8 @@ export default defineComponent({
       }
     }
     // 切换素材
-    const toggleMaterial = () => {
-      const index = data.itemList.findIndex((n: any) => n.id == popupData.itemActive)
+    const toggleMaterial = (itemActive: any) => {
+      const index = data.itemList.findIndex((n: any) => n.id == itemActive)
       if (index > -1) {
         handleSwipeChange(index)
       }
@@ -781,12 +777,8 @@ export default defineComponent({
             tabActive={popupData.tabActive}
             itemActive={popupData.itemActive}
             onHandleSelect={(res: any) => {
-              // console.log(res)
-              popupData.tabActive = res.tabActive
-              popupData.itemActive = res.itemActive
-              popupData.tabName = res.tabName
               popupData.open = false
-              toggleMaterial()
+              toggleMaterial(res.itemActive)
             }}
           />
         </Popup>