lex-xin 4 ヶ月 前
コミット
47c268c6fe

BIN
src/img/coursewarePlay/back.png


+ 16 - 20
src/views/cloudPractice/cloudPractice.tsx

@@ -766,7 +766,7 @@ export default defineComponent({
          await handleAllGetList()
       }
 
-      const toDetailGYM = async () => {
+      const toDetailGYM = () => {
          // const row: any = activeItem.value
          const details: any = state.details
          state.imgs = []
@@ -846,7 +846,7 @@ export default defineComponent({
 
       const toDetail = async () => {
          if (userStoreHook.roles === "GYM") {
-            await toDetailGYM()
+            toDetailGYM()
             return
          }
          const row: any = activeItem.value
@@ -854,18 +854,6 @@ export default defineComponent({
          if (row.musicSheetType === "SINGLE") {
             loading.value = false
             state.musicPdfUrl = row.musicPdfUrl
-
-            // if (userStoreHook.roles === "GYM") {
-            //    const imgs = row.musicImg ? row.musicImg.split(",") : []
-            //    imgs.forEach(async (item: string, index: number) => {
-            //       const imgCanvas = await imgToCanvas(item)
-            //       const img = await canvasAddTitle(imgCanvas, row.name)
-            //       state.imgs.push({
-            //          name: index + 1 + ".png",
-            //          url: img
-            //       })
-            //    })
-            // }
          }
          state.partNames = await getPartNames(row.xmlUrl)
          let partList = row.background || []
@@ -993,8 +981,14 @@ export default defineComponent({
                // https://cdn.oss.dayaedu.com/daya202409/UODQffO.pdf
             } else {
                if (userStoreHook.roles === "GYM") {
-                  console.log(state.partXmlIndex, state.selectedTrack, "----------")
-                  state.iframeSrc = getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack)
+                  nextTick(() => {
+                     const iframeRef: any = document.getElementById("staffIframeRef")
+                     if (iframeRef) {
+                        iframeRef.contentWindow.location.replace(getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack))
+                     } else {
+                        state.iframeSrc = getPreViewCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack)
+                     }
+                  })
                } else {
                   state.iframeSrc = `/osmd/index.html`
                }
@@ -1347,12 +1341,14 @@ export default defineComponent({
                                  <div class={styles.btnSection}>
                                     <div
                                        class={styles.btn}
-                                       onClick={(e: any) => {
+                                       onClick={async (e: any) => {
                                           e.stopPropagation()
-                                          handlePlay(item)
                                           if (state.listActive !== index) {
-                                             resetRender()
+                                             state.listActive = index
+                                             await handleGetDetail()
+                                             searchContent()
                                           }
+                                          handlePlay(item)
                                        }}
                                     >
                                        {state.listActive === index && (
@@ -1442,7 +1438,7 @@ export default defineComponent({
                      src={btnSubmit as any}
                      onClick={() => {
                         handleChangeAudio("pause")
-                        goToCloud(activeItem.value.id, state.partXmlIndex)
+                        goToCloud(activeItem.value.id, state.partXmlIndex, state.selectedTrack)
                      }}
                   />
 

+ 8 - 2
src/views/cloudPractice/useData.ts

@@ -21,11 +21,17 @@ export const useFunction = () => {
    /** 跳转云教练 */
    const isPracticeShow = ref(false)
    const practiceUrl = ref("")
-   function goToCloud(musicId: string, partIndex = 0) {
+   function goToCloud(musicId: string, partIndex = 0, track = "") {
       //  GYM,GYT,KLX 区分   云教练
+      let gymUrl = `${URL_TEACH_GYM}#/?id=${musicId}&Authorization=${getToken()}&platform=pc&isYjt=1&isHideMusicList=true&systemType=teacher`
+      if (partIndex === 999) {
+         gymUrl += `&part-index=${partIndex}`
+      } else {
+         gymUrl += `&part-name=${track}`
+      }
       const urlObj = {
          GYT: `${URL_TEACH_GYT}?id=${musicId}&modelType=practice&modeType=json&part-index=${partIndex}&Authorization=${getToken()}&isYjt=1&&isHideBack=false`,
-         GYM: `${URL_TEACH_GYM}#/?id=${musicId}&Authorization=${getToken()}&platform=pc&part-index=${partIndex}&isYjt=1&isHideMusicList=true&systemType=teacher`,
+         GYM: gymUrl,
          KLX: `${URL_TEACH_KLX}#/?id=${musicId}&Authorization=${getToken()}&platform=pc&part-index=${partIndex}&isYjt=1&isHideMusicList=true&systemType=teacher`
       }
       isPracticeShow.value = true

+ 9 - 7
src/views/coursewarePlay/coursewarePlay.vue

@@ -434,19 +434,21 @@ function filterPointList(pointList: any[], parentData?: { ids: string[]; name: s
    })
 }
 function handleChangeCourseware(index: -1 | 1) {
-   console.log("parentId parentId  parentId")
    handleVideoPause()
    handleSongPause()
    const newIndex = index + activeCoursewareIndex.value
    if (newIndex < 0 || newIndex > flattenCoursewareList.value.length - 1) {
       return
    }
-   const newItem = flattenCoursewareList.value[newIndex]
-   const newParentId = newItem ? newItem.parentData?.ids[0] : ""
-   if (newParentId) {
-      const parentItem = coursewareList.value.find((item: any) => item.id === newParentId)
-      if (parentItem) {
-         lessonTargetDetail.value = parentItem.lessonTargetDesc
+
+   if (searchObj.source === "search") {
+      const newItem = flattenCoursewareList.value[newIndex]
+      const newParentId = newItem ? newItem.parentData?.ids[0] : ""
+      if (newParentId) {
+         const parentItem = coursewareList.value.find((item: any) => item.id === newParentId)
+         if (parentItem) {
+            lessonTargetDetail.value = parentItem.lessonTargetDesc
+         }
       }
    }