lex-xin 4 kuukautta sitten
vanhempi
commit
cf2176420d

+ 1 - 1
src/views/cloudPractice/cloudPractice.tsx

@@ -767,7 +767,7 @@ export default defineComponent({
       }
 
       const toDetailGYM = async () => {
-         const row: any = activeItem.value
+         // const row: any = activeItem.value
          const details: any = state.details
          state.imgs = []
          if (details.musicSheetType === "SINGLE") {

+ 16 - 4
src/views/coursewarePlay/coursewarePlay.vue

@@ -431,24 +431,23 @@ 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 item = flattenCoursewareList.value[activeCoursewareIndex.value]
    const newItem = flattenCoursewareList.value[newIndex]
    const parentId = item ? item.parentData.ids[0] : ""
    const newParentId = newItem ? newItem.parentData.ids[0] : ""
    if (parentId !== newParentId) {
-      const parentItem = coursewareList.value.find((item: any) => item.id === parentId)
+      const parentItem = coursewareList.value.find((item: any) => item.id === newParentId)
       if (parentItem) {
          lessonTargetDetail.value = parentItem.lessonTargetDesc
       }
    }
-
    activeCoursewareIndex.value = newIndex
 }
 function handleCourseClick(value: any) {
@@ -456,9 +455,22 @@ function handleCourseClick(value: any) {
    searchObj.search = searchObj.tempSearch ? JSON.parse(JSON.stringify(searchObj.tempSearch)) : ""
    coursewareList.value = deepCopy(tempCoursewareList.value)
    flattenCoursewareList.value = deepCopy(tempFlattenCoursewareList.value)
-   activeCoursewareIndex.value = flattenCoursewareList.value.findIndex((item: any) => {
+
+   const newIndex = flattenCoursewareList.value.findIndex((item: any) => {
       return value.id === item.id && value.knowledgePointId === item.knowledgePointId
    })
+
+   const item = flattenCoursewareList.value[activeCoursewareIndex.value]
+   const newItem = flattenCoursewareList.value[newIndex]
+   const parentId = item ? item.parentData.ids[0] : ""
+   const newParentId = newItem ? newItem.parentData.ids[0] : ""
+   if (parentId !== newParentId) {
+      const parentItem = coursewareList.value.find((item: any) => item.id === newParentId)
+      if (parentItem) {
+         lessonTargetDetail.value = parentItem.lessonTargetDesc
+      }
+   }
+   activeCoursewareIndex.value = newIndex
    drawerShow.value = false
 }
 async function handleCourseMenuClick(value: any) {