lex 6 ماه پیش
والد
کامیت
899e18c85d
2فایلهای تغییر یافته به همراه28 افزوده شده و 22 حذف شده
  1. 22 20
      src/tenant/music/coursewarePlay/component/musicScore.tsx
  2. 6 2
      src/tenant/music/coursewarePlay/index.tsx

+ 22 - 20
src/tenant/music/coursewarePlay/component/musicScore.tsx

@@ -26,8 +26,8 @@ export default defineComponent({
     const isLoading = ref(false)
     const pageVisibility = usePageVisibility()
     /** 页面显示和隐藏 */
-    watch(pageVisibility, (value) => {
-      console.log("🚀 ~ value:", value)
+    watch(pageVisibility, value => {
+      console.log('🚀 ~ value:', value)
       if (value == 'hidden') {
         isLoading.value = false
       }
@@ -38,15 +38,14 @@ export default defineComponent({
     const renderSuccess = ref(false)
     const Authorization = sessionStorage.getItem('Authorization') || ''
     const origin = /(localhost|192)/.test(location.host)
-      ? 'https://test.lexiaoya.cn'
+      ? 'https://test.colexiu.com'
       : location.origin
     const query = qs.stringify({
       id: props.music.content,
-      modelType: 'practice',
-      headerHeight: 32,
       Authorization: Authorization
     })
-    const src = `${origin}/orchestra-music-score/?` + query
+
+    const src = `${origin}/accompany/?` + query
     const checkView = () => {
       fetch(src)
         .then(() => {
@@ -68,27 +67,30 @@ export default defineComponent({
     // 去云练习完整版
     const gotoAccomany = () => {
       if (isLoading.value) return
-      if (!browserInfo.ios){
+      if (!browserInfo.ios) {
         isLoading.value = true
       }
       const parmas = qs.stringify({
         id: props.music.content
       })
       const src = `${location.origin}/orchestra-music-score/?` + parmas
-      postMessage({
-        api: 'openAccompanyWebView',
-        content: {
-          url: src,
-          orientation: 0,
-          isHideTitle: true,
-          statusBarTextColor: false,
-          isOpenLight: true
-        }
-      }, () => {
-        if (browserInfo.ios){
-          isLoading.value = true
+      postMessage(
+        {
+          api: 'openAccompanyWebView',
+          content: {
+            url: src,
+            orientation: 0,
+            isHideTitle: true,
+            statusBarTextColor: false,
+            isOpenLight: true
+          }
+        },
+        () => {
+          if (browserInfo.ios) {
+            isLoading.value = true
+          }
         }
-      })
+      )
     }
     listenerMessage('webViewOnResume', () => {
       isLoading.value = false

+ 6 - 2
src/tenant/music/coursewarePlay/index.tsx

@@ -320,10 +320,14 @@ export default defineComponent({
               if (Array.isArray(n.materialList)) {
                 n.materialList = n.materialList.map((item: any) => {
                   index++
-
+                  const materialRefs = item.materialRefs
+                    ? item.materialRefs
+                    : []
+                  const materialMusicId =
+                    materialRefs.length > 0 ? materialRefs[0].resourceId : null
                   return {
                     ...item,
-
+                    materialMusicId,
                     content: item.content,
                     knowledgePointId: [item.knowledgePointId],
                     materialId: item.id,