|  | @@ -139,7 +139,8 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        type: 'class' as '' | 'preview' | 'class', // 预览类型
 | 
	
		
			
				|  |  |        subjectId: '' as any, // 声部编号
 | 
	
		
			
				|  |  |        lessonCourseId: '' as any, // 教材编号
 | 
	
		
			
				|  |  | -      detailId: '' as any, // 编号 - 章节编号
 | 
	
		
			
				|  |  | +      lessonCoursewareDetailId: '' as any, // 章节
 | 
	
		
			
				|  |  | +      detailId: '' as any, // 编号 - 课程编号
 | 
	
		
			
				|  |  |        classGroupId: '' as any, // 上课时需要 班级编号
 | 
	
		
			
				|  |  |        classId: '' as any, // 上课编号
 | 
	
		
			
				|  |  |        // detail: null,
 | 
	
	
		
			
				|  | @@ -548,10 +549,28 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        activeIndex: 0,
 | 
	
		
			
				|  |  |        toolOpen: false, // 工具弹窗控制
 | 
	
		
			
				|  |  |        chapterOpen: false, // 切换章节
 | 
	
		
			
				|  |  | -      chapterDetails: {} as any,
 | 
	
		
			
				|  |  | +      chapterDetails: [] as any,
 | 
	
		
			
				|  |  |        chapterLoading: false // 加载数据
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    const formatParentId = (id: any, list: any, ids = [] as any) => {
 | 
	
		
			
				|  |  | +      for (const item of list) {
 | 
	
		
			
				|  |  | +        if (item.knowledgeList && item.knowledgeList.length > 0) {
 | 
	
		
			
				|  |  | +          const cIds: any = formatParentId(id, item.knowledgeList, [
 | 
	
		
			
				|  |  | +            ...ids,
 | 
	
		
			
				|  |  | +            item.id
 | 
	
		
			
				|  |  | +          ]);
 | 
	
		
			
				|  |  | +          if (cIds.includes(id)) {
 | 
	
		
			
				|  |  | +            return cIds;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (item.id === id) {
 | 
	
		
			
				|  |  | +          return [...ids, id];
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      return ids;
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      /** 获取章节 */
 | 
	
		
			
				|  |  |      const getLessonCoursewareDetail = async () => {
 | 
	
		
			
				|  |  |        try {
 | 
	
	
		
			
				|  | @@ -561,6 +580,9 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          popupData.chapterDetails = res.data.lessonList || [];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        const ids = formatParentId(data.detailId, popupData.chapterDetails);
 | 
	
		
			
				|  |  | +        data.lessonCoursewareDetailId = ids[0];
 | 
	
		
			
				|  |  |        } catch {
 | 
	
		
			
				|  |  |          //
 | 
	
		
			
				|  |  |        }
 | 
	
	
		
			
				|  | @@ -809,11 +831,186 @@ export default defineComponent({
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      // 上一个知识点, 下一个知识点
 | 
	
		
			
				|  |  | -    const handlePreAndNext = (type: string) => {
 | 
	
		
			
				|  |  | +    const handlePreAndNext = async (type: string) => {
 | 
	
		
			
				|  |  | +      // if (type === 'up') {
 | 
	
		
			
				|  |  | +      //   handleSwipeChange(popupData.activeIndex - 1);
 | 
	
		
			
				|  |  | +      // } else {
 | 
	
		
			
				|  |  | +      //   handleSwipeChange(popupData.activeIndex + 1);
 | 
	
		
			
				|  |  | +      // }
 | 
	
		
			
				|  |  |        if (type === 'up') {
 | 
	
		
			
				|  |  | -        handleSwipeChange(popupData.activeIndex - 1);
 | 
	
		
			
				|  |  | +        // 判断上面是否还有章节
 | 
	
		
			
				|  |  | +        if (popupData.activeIndex > 0) {
 | 
	
		
			
				|  |  | +          handleSwipeChange(popupData.activeIndex - 1);
 | 
	
		
			
				|  |  | +          return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 获取当前是哪个章节
 | 
	
		
			
				|  |  | +        let detailIndex = popupData.chapterDetails.findIndex(
 | 
	
		
			
				|  |  | +          (item: any) => item.id == data.lessonCoursewareDetailId
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +        const detailItem =
 | 
	
		
			
				|  |  | +          popupData.chapterDetails[detailIndex]?.knowledgeList || [];
 | 
	
		
			
				|  |  | +        let lessonIndex = detailItem.findIndex(
 | 
	
		
			
				|  |  | +          (item: any) => item.id == data.detailId
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        let lessonStatus = false; // 当前章节上面是否有内容
 | 
	
		
			
				|  |  | +        let lessonCoursewareDetailId = '';
 | 
	
		
			
				|  |  | +        let coursewareDetailKnowledgeId = '';
 | 
	
		
			
				|  |  | +        while (lessonIndex >= 0) {
 | 
	
		
			
				|  |  | +          lessonIndex--;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +          if (lessonIndex >= 0) {
 | 
	
		
			
				|  |  | +            if (detailItem[lessonIndex].containMaterial) {
 | 
	
		
			
				|  |  | +              lessonStatus = true;
 | 
	
		
			
				|  |  | +              lessonCoursewareDetailId =
 | 
	
		
			
				|  |  | +                detailItem[lessonIndex].lessonCoursewareDetailId;
 | 
	
		
			
				|  |  | +              coursewareDetailKnowledgeId = detailItem[lessonIndex].id;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +          if (lessonStatus) {
 | 
	
		
			
				|  |  | +            break;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        // 判断当前章节下面课程是否有内容,否则往上一个章节走
 | 
	
		
			
				|  |  | +        if (lessonStatus) {
 | 
	
		
			
				|  |  | +          popupData.chapterLoading = true;
 | 
	
		
			
				|  |  | +          data.detailId = coursewareDetailKnowledgeId;
 | 
	
		
			
				|  |  | +          data.lessonCoursewareDetailId = lessonCoursewareDetailId;
 | 
	
		
			
				|  |  | +          // 更新上课记录 上课的时候才更新
 | 
	
		
			
				|  |  | +          if (data.type !== 'preview') {
 | 
	
		
			
				|  |  | +            await classCourseScheduleUpdate();
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          await getDetail();
 | 
	
		
			
				|  |  | +          popupData.activeIndex = data.itemList.length - 1 || 0;
 | 
	
		
			
				|  |  | +          popupData.chapterOpen = false;
 | 
	
		
			
				|  |  | +          popupData.chapterLoading = false;
 | 
	
		
			
				|  |  | +          return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        let prevLessonStatus = false;
 | 
	
		
			
				|  |  | +        while (detailIndex >= 0) {
 | 
	
		
			
				|  |  | +          detailIndex--;
 | 
	
		
			
				|  |  | +          const tempDetail =
 | 
	
		
			
				|  |  | +            popupData.chapterDetails[detailIndex]?.knowledgeList || [];
 | 
	
		
			
				|  |  | +          let tempLessonLength = tempDetail.length;
 | 
	
		
			
				|  |  | +          while (tempLessonLength > 0) {
 | 
	
		
			
				|  |  | +            if (tempDetail[tempLessonLength - 1].containMaterial) {
 | 
	
		
			
				|  |  | +              prevLessonStatus = true;
 | 
	
		
			
				|  |  | +              lessonCoursewareDetailId =
 | 
	
		
			
				|  |  | +                tempDetail[tempLessonLength - 1].lessonCoursewareDetailId;
 | 
	
		
			
				|  |  | +              coursewareDetailKnowledgeId = tempDetail[tempLessonLength - 1].id;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            tempLessonLength--;
 | 
	
		
			
				|  |  | +            if (prevLessonStatus) {
 | 
	
		
			
				|  |  | +              break;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +          if (prevLessonStatus) {
 | 
	
		
			
				|  |  | +            break;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 判断当前章节下面课程是否有内容,否则往上一个章节走
 | 
	
		
			
				|  |  | +        if (prevLessonStatus) {
 | 
	
		
			
				|  |  | +          popupData.chapterLoading = true;
 | 
	
		
			
				|  |  | +          data.detailId = coursewareDetailKnowledgeId;
 | 
	
		
			
				|  |  | +          data.lessonCoursewareDetailId = lessonCoursewareDetailId;
 | 
	
		
			
				|  |  | +          await getDetail();
 | 
	
		
			
				|  |  | +          popupData.activeIndex = data.itemList.length - 1 || 0;
 | 
	
		
			
				|  |  | +          popupData.chapterLoading = false;
 | 
	
		
			
				|  |  | +          return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |        } else {
 | 
	
		
			
				|  |  | -        handleSwipeChange(popupData.activeIndex + 1);
 | 
	
		
			
				|  |  | +        if (popupData.activeIndex < data.itemList.length - 1) {
 | 
	
		
			
				|  |  | +          handleSwipeChange(popupData.activeIndex + 1);
 | 
	
		
			
				|  |  | +          return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 获取当前是哪个章节
 | 
	
		
			
				|  |  | +        let detailIndex = popupData.chapterDetails.findIndex(
 | 
	
		
			
				|  |  | +          (item: any) => item.id == data.lessonCoursewareDetailId
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +        const detailItem =
 | 
	
		
			
				|  |  | +          popupData.chapterDetails[detailIndex]?.knowledgeList || [];
 | 
	
		
			
				|  |  | +        let lessonIndex = detailItem.findIndex(
 | 
	
		
			
				|  |  | +          (item: any) => item.id == data.detailId
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        let lessonStatus = false; // 当前章节下面是否有内容
 | 
	
		
			
				|  |  | +        let lessonCoursewareDetailId = '';
 | 
	
		
			
				|  |  | +        let coursewareDetailKnowledgeId = '';
 | 
	
		
			
				|  |  | +        while (lessonIndex < detailItem.length - 1) {
 | 
	
		
			
				|  |  | +          lessonIndex++;
 | 
	
		
			
				|  |  | +          if (lessonIndex >= 0) {
 | 
	
		
			
				|  |  | +            if (detailItem[lessonIndex].containMaterial) {
 | 
	
		
			
				|  |  | +              lessonStatus = true;
 | 
	
		
			
				|  |  | +              lessonCoursewareDetailId =
 | 
	
		
			
				|  |  | +                detailItem[lessonIndex].lessonCoursewareDetailId;
 | 
	
		
			
				|  |  | +              coursewareDetailKnowledgeId = detailItem[lessonIndex].id;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          if (lessonStatus) {
 | 
	
		
			
				|  |  | +            break;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        // 判断当前章节下面课程是否有内容,否则往下一个章节走
 | 
	
		
			
				|  |  | +        if (lessonStatus) {
 | 
	
		
			
				|  |  | +          popupData.chapterLoading = true;
 | 
	
		
			
				|  |  | +          data.detailId = coursewareDetailKnowledgeId;
 | 
	
		
			
				|  |  | +          data.lessonCoursewareDetailId = lessonCoursewareDetailId;
 | 
	
		
			
				|  |  | +          // 更新上课记录 上课的时候才更新
 | 
	
		
			
				|  |  | +          if (data.type !== 'preview') {
 | 
	
		
			
				|  |  | +            await classCourseScheduleUpdate();
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          await getDetail();
 | 
	
		
			
				|  |  | +          popupData.activeIndex = 0;
 | 
	
		
			
				|  |  | +          popupData.chapterOpen = false;
 | 
	
		
			
				|  |  | +          popupData.chapterLoading = false;
 | 
	
		
			
				|  |  | +          return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        let nextLessonStatus = false;
 | 
	
		
			
				|  |  | +        while (detailIndex <= popupData.chapterDetails.length - 1) {
 | 
	
		
			
				|  |  | +          detailIndex++;
 | 
	
		
			
				|  |  | +          const tempDetail =
 | 
	
		
			
				|  |  | +            popupData.chapterDetails[detailIndex]?.knowledgeList || [];
 | 
	
		
			
				|  |  | +          let tempLessonLength = 0;
 | 
	
		
			
				|  |  | +          while (tempLessonLength <= tempDetail.length - 1) {
 | 
	
		
			
				|  |  | +            if (tempDetail[tempLessonLength].containMaterial) {
 | 
	
		
			
				|  |  | +              nextLessonStatus = true;
 | 
	
		
			
				|  |  | +              lessonCoursewareDetailId =
 | 
	
		
			
				|  |  | +                tempDetail[tempLessonLength].lessonCoursewareDetailId;
 | 
	
		
			
				|  |  | +              coursewareDetailKnowledgeId = tempDetail[tempLessonLength].id;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            tempLessonLength++;
 | 
	
		
			
				|  |  | +            if (nextLessonStatus) {
 | 
	
		
			
				|  |  | +              break;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +          if (nextLessonStatus) {
 | 
	
		
			
				|  |  | +            break;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 判断当前章节下面课程是否有内容,否则往上一个章节走
 | 
	
		
			
				|  |  | +        if (nextLessonStatus) {
 | 
	
		
			
				|  |  | +          popupData.chapterLoading = true;
 | 
	
		
			
				|  |  | +          data.detailId = coursewareDetailKnowledgeId;
 | 
	
		
			
				|  |  | +          data.lessonCoursewareDetailId = lessonCoursewareDetailId;
 | 
	
		
			
				|  |  | +          // 更新上课记录 上课的时候才更新
 | 
	
		
			
				|  |  | +          if (data.type !== 'preview') {
 | 
	
		
			
				|  |  | +            await classCourseScheduleUpdate();
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          await getDetail();
 | 
	
		
			
				|  |  | +          popupData.activeIndex = 0;
 | 
	
		
			
				|  |  | +          popupData.chapterOpen = false;
 | 
	
		
			
				|  |  | +          popupData.chapterLoading = false;
 | 
	
		
			
				|  |  | +          return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -839,9 +1036,6 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          if (popupData.activeIndex === data.itemList.length - 1) return;
 | 
	
		
			
				|  |  |          handlePreAndNext('down');
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      //  else if (e.code === 'Space') {
 | 
	
		
			
				|  |  | -      //   handleStop();
 | 
	
		
			
				|  |  | -      // }
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /** 教学数据 */
 | 
	
	
		
			
				|  | @@ -898,27 +1092,161 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    // 是否允许上一页
 | 
	
		
			
				|  |  | +    const isUpArrow = computed(() => {
 | 
	
		
			
				|  |  | +      /**
 | 
	
		
			
				|  |  | +       * 1,判断当前课程中是否处在第一个资源;
 | 
	
		
			
				|  |  | +       * 2,判断当前课程是否在当前章节的第一个;
 | 
	
		
			
				|  |  | +       * 3,判断当前章节,当前课程上面还没有其它课程,是否有资源;
 | 
	
		
			
				|  |  | +       * 4,判断当前章节上面还没有其它章节;
 | 
	
		
			
				|  |  | +       * 5,判断上面章节里面课程是否有资源;
 | 
	
		
			
				|  |  | +       */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      if (popupData.activeIndex > 0) {
 | 
	
		
			
				|  |  | +        return true;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // 获取当前是哪个章节
 | 
	
		
			
				|  |  | +      let detailIndex = popupData.chapterDetails.findIndex(
 | 
	
		
			
				|  |  | +        (item: any) => item.id == data.lessonCoursewareDetailId
 | 
	
		
			
				|  |  | +      );
 | 
	
		
			
				|  |  | +      const detailItem =
 | 
	
		
			
				|  |  | +        popupData.chapterDetails[detailIndex]?.knowledgeList || [];
 | 
	
		
			
				|  |  | +      let lessonIndex = detailItem.findIndex(
 | 
	
		
			
				|  |  | +        (item: any) => item.id == data.detailId
 | 
	
		
			
				|  |  | +      );
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // 说明已经是第一单元,第一课
 | 
	
		
			
				|  |  | +      if (detailIndex <= 0 && lessonIndex <= 0) {
 | 
	
		
			
				|  |  | +        return false;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      let lessonStatus = false; // 当前章节上面是否有内容
 | 
	
		
			
				|  |  | +      while (lessonIndex >= 0) {
 | 
	
		
			
				|  |  | +        lessonIndex--;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if (lessonIndex >= 0) {
 | 
	
		
			
				|  |  | +          if (detailItem[lessonIndex].containMaterial) {
 | 
	
		
			
				|  |  | +            lessonStatus = true;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      // 判断当前章节下面课程是否有内容,否则往上一个章节走
 | 
	
		
			
				|  |  | +      if (lessonStatus) {
 | 
	
		
			
				|  |  | +        return true;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // 已经是第一个章节了
 | 
	
		
			
				|  |  | +      if (detailIndex <= 0) {
 | 
	
		
			
				|  |  | +        return false;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      let prevLessonStatus = false;
 | 
	
		
			
				|  |  | +      while (detailIndex >= 0) {
 | 
	
		
			
				|  |  | +        detailIndex--;
 | 
	
		
			
				|  |  | +        const tempDetail =
 | 
	
		
			
				|  |  | +          popupData.chapterDetails[detailIndex]?.knowledgeList || [];
 | 
	
		
			
				|  |  | +        let tempLessonLength = tempDetail.length;
 | 
	
		
			
				|  |  | +        while (tempLessonLength > 0) {
 | 
	
		
			
				|  |  | +          if (tempDetail[tempLessonLength - 1].containMaterial) {
 | 
	
		
			
				|  |  | +            prevLessonStatus = true;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          tempLessonLength--;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if (prevLessonStatus) {
 | 
	
		
			
				|  |  | +          return true;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      return false;
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    // 是否允许下一页
 | 
	
		
			
				|  |  | +    const isDownArrow = computed(() => {
 | 
	
		
			
				|  |  | +      if (popupData.activeIndex < data.itemList.length - 1) {
 | 
	
		
			
				|  |  | +        return true;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // 获取当前是哪个章节
 | 
	
		
			
				|  |  | +      let detailIndex = popupData.chapterDetails.findIndex(
 | 
	
		
			
				|  |  | +        (item: any) => item.id == data.lessonCoursewareDetailId
 | 
	
		
			
				|  |  | +      );
 | 
	
		
			
				|  |  | +      const detailItem =
 | 
	
		
			
				|  |  | +        popupData.chapterDetails[detailIndex]?.knowledgeList || [];
 | 
	
		
			
				|  |  | +      let lessonIndex = detailItem.findIndex(
 | 
	
		
			
				|  |  | +        (item: any) => item.id == data.detailId
 | 
	
		
			
				|  |  | +      );
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // 说明已经是最后-单元,最后一课
 | 
	
		
			
				|  |  | +      if (
 | 
	
		
			
				|  |  | +        detailIndex >= popupData.chapterDetails.length - 1 &&
 | 
	
		
			
				|  |  | +        lessonIndex >= detailItem.length - 1
 | 
	
		
			
				|  |  | +      ) {
 | 
	
		
			
				|  |  | +        return false;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      let lessonStatus = false; // 当前章节下面是否有内容
 | 
	
		
			
				|  |  | +      while (lessonIndex < detailItem.length - 1) {
 | 
	
		
			
				|  |  | +        lessonIndex++;
 | 
	
		
			
				|  |  | +        if (lessonIndex >= 0) {
 | 
	
		
			
				|  |  | +          if (detailItem[lessonIndex].containMaterial) {
 | 
	
		
			
				|  |  | +            lessonStatus = true;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      // 判断当前章节下面课程是否有内容,否则往下一个章节走
 | 
	
		
			
				|  |  | +      if (lessonStatus) {
 | 
	
		
			
				|  |  | +        return true;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // 已经是最后一个章节了
 | 
	
		
			
				|  |  | +      if (detailIndex >= popupData.chapterDetails.length - 1) {
 | 
	
		
			
				|  |  | +        return false;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      let nextLessonStatus = false;
 | 
	
		
			
				|  |  | +      while (detailIndex < popupData.chapterDetails.length - 1) {
 | 
	
		
			
				|  |  | +        detailIndex++;
 | 
	
		
			
				|  |  | +        const tempDetail =
 | 
	
		
			
				|  |  | +          popupData.chapterDetails[detailIndex]?.knowledgeList || [];
 | 
	
		
			
				|  |  | +        let tempLessonLength = 0;
 | 
	
		
			
				|  |  | +        while (tempLessonLength <= tempDetail.length - 1) {
 | 
	
		
			
				|  |  | +          if (tempDetail[tempLessonLength].containMaterial) {
 | 
	
		
			
				|  |  | +            nextLessonStatus = true;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          tempLessonLength++;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if (nextLessonStatus) {
 | 
	
		
			
				|  |  | +          return true;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      return false;
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      return () => (
 | 
	
		
			
				|  |  |        <div id="playContent" class={[styles.playContent, 'wrap']}>
 | 
	
		
			
				|  |  | -        {!popupData.chapterLoading ? (
 | 
	
		
			
				|  |  | +        <div
 | 
	
		
			
				|  |  | +          onClick={() => {
 | 
	
		
			
				|  |  | +            clearTimeout(activeData.timer);
 | 
	
		
			
				|  |  | +            activeData.model = !activeData.model;
 | 
	
		
			
				|  |  | +            Object.values(data.videoRefs).map((n: any) =>
 | 
	
		
			
				|  |  | +              n.toggleHideControl(activeData.model)
 | 
	
		
			
				|  |  | +            );
 | 
	
		
			
				|  |  | +            Object.values(data.audioRefs).map((n: any) =>
 | 
	
		
			
				|  |  | +              n.toggleHideControl(activeData.model)
 | 
	
		
			
				|  |  | +            );
 | 
	
		
			
				|  |  | +          }}>
 | 
	
		
			
				|  |  |            <div
 | 
	
		
			
				|  |  | -            onClick={() => {
 | 
	
		
			
				|  |  | -              clearTimeout(activeData.timer);
 | 
	
		
			
				|  |  | -              activeData.model = !activeData.model;
 | 
	
		
			
				|  |  | -              Object.values(data.videoRefs).map((n: any) =>
 | 
	
		
			
				|  |  | -                n.toggleHideControl(activeData.model)
 | 
	
		
			
				|  |  | -              );
 | 
	
		
			
				|  |  | -              Object.values(data.audioRefs).map((n: any) =>
 | 
	
		
			
				|  |  | -                n.toggleHideControl(activeData.model)
 | 
	
		
			
				|  |  | -              );
 | 
	
		
			
				|  |  | +            class={styles.coursewarePlay}
 | 
	
		
			
				|  |  | +            style={{ width: parentContainer.width }}
 | 
	
		
			
				|  |  | +            onClick={(e: Event) => {
 | 
	
		
			
				|  |  | +              e.stopPropagation();
 | 
	
		
			
				|  |  | +              setModelOpen();
 | 
	
		
			
				|  |  |              }}>
 | 
	
		
			
				|  |  | -            <div
 | 
	
		
			
				|  |  | -              class={styles.coursewarePlay}
 | 
	
		
			
				|  |  | -              style={{ width: parentContainer.width }}
 | 
	
		
			
				|  |  | -              onClick={(e: Event) => {
 | 
	
		
			
				|  |  | -                e.stopPropagation();
 | 
	
		
			
				|  |  | -                setModelOpen();
 | 
	
		
			
				|  |  | -              }}>
 | 
	
		
			
				|  |  | +            {!popupData.chapterLoading ? (
 | 
	
		
			
				|  |  |                <div class={styles.wraps}>
 | 
	
		
			
				|  |  |                  {data.itemList.map((m: any, mIndex: number) => {
 | 
	
		
			
				|  |  |                    const isRender =
 | 
	
	
		
			
				|  | @@ -1047,65 +1375,59 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                    ) : null;
 | 
	
		
			
				|  |  |                  })}
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  | -              <Transition name="right">
 | 
	
		
			
				|  |  | -                {activeData.model && (
 | 
	
		
			
				|  |  | +            ) : (
 | 
	
		
			
				|  |  | +              ''
 | 
	
		
			
				|  |  | +            )}
 | 
	
		
			
				|  |  | +            <Transition name="right">
 | 
	
		
			
				|  |  | +              {activeData.model && (
 | 
	
		
			
				|  |  | +                <div
 | 
	
		
			
				|  |  | +                  class={styles.rightFixedBtns}
 | 
	
		
			
				|  |  | +                  onClick={(e: Event) => {
 | 
	
		
			
				|  |  | +                    e.stopPropagation();
 | 
	
		
			
				|  |  | +                    clearTimeout(activeData.timer);
 | 
	
		
			
				|  |  | +                  }}>
 | 
	
		
			
				|  |  |                    <div
 | 
	
		
			
				|  |  | -                    class={styles.rightFixedBtns}
 | 
	
		
			
				|  |  | -                    onClick={(e: Event) => {
 | 
	
		
			
				|  |  | -                      e.stopPropagation();
 | 
	
		
			
				|  |  | -                      clearTimeout(activeData.timer);
 | 
	
		
			
				|  |  | +                    class={[styles.fullBtn]}
 | 
	
		
			
				|  |  | +                    onClick={() => (popupData.chapterOpen = true)}>
 | 
	
		
			
				|  |  | +                    <img src={iconChange} />
 | 
	
		
			
				|  |  | +                  </div>
 | 
	
		
			
				|  |  | +                  <div
 | 
	
		
			
				|  |  | +                    class={[
 | 
	
		
			
				|  |  | +                      styles.fullBtn,
 | 
	
		
			
				|  |  | +                      styles.iconUp,
 | 
	
		
			
				|  |  | +                      !isUpArrow.value ? styles.btnsDisabled : ''
 | 
	
		
			
				|  |  | +                    ]}
 | 
	
		
			
				|  |  | +                    onClick={() => {
 | 
	
		
			
				|  |  | +                      if (!isUpArrow.value) return;
 | 
	
		
			
				|  |  | +                      handlePreAndNext('up');
 | 
	
		
			
				|  |  |                      }}>
 | 
	
		
			
				|  |  | +                    <img src={iconUp} />
 | 
	
		
			
				|  |  | +                  </div>
 | 
	
		
			
				|  |  | +                  <div id="attent-0">
 | 
	
		
			
				|  |  |                      <div
 | 
	
		
			
				|  |  | -                      class={[styles.fullBtn]}
 | 
	
		
			
				|  |  | -                      onClick={() => (popupData.chapterOpen = true)}>
 | 
	
		
			
				|  |  | -                      <img src={iconChange} />
 | 
	
		
			
				|  |  | +                      class={[styles.fullBtn, styles.point]}
 | 
	
		
			
				|  |  | +                      onClick={() => (popupData.open = true)}>
 | 
	
		
			
				|  |  | +                      <img src={iconMenu} />
 | 
	
		
			
				|  |  |                      </div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                      <div
 | 
	
		
			
				|  |  |                        class={[
 | 
	
		
			
				|  |  |                          styles.fullBtn,
 | 
	
		
			
				|  |  | -                        styles.iconUp,
 | 
	
		
			
				|  |  | -                        popupData.activeIndex === 0 ? styles.btnsDisabled : ''
 | 
	
		
			
				|  |  | +                        styles.iconDown,
 | 
	
		
			
				|  |  | +                        !isDownArrow.value ? styles.btnsDisabled : ''
 | 
	
		
			
				|  |  |                        ]}
 | 
	
		
			
				|  |  |                        onClick={() => {
 | 
	
		
			
				|  |  | -                        if (popupData.activeIndex === 0) return;
 | 
	
		
			
				|  |  | -                        handlePreAndNext('up');
 | 
	
		
			
				|  |  | +                        if (!isDownArrow.value) return;
 | 
	
		
			
				|  |  | +                        handlePreAndNext('down');
 | 
	
		
			
				|  |  |                        }}>
 | 
	
		
			
				|  |  | -                      <img src={iconUp} />
 | 
	
		
			
				|  |  | -                    </div>
 | 
	
		
			
				|  |  | -                    <div id="attent-0">
 | 
	
		
			
				|  |  | -                      <div
 | 
	
		
			
				|  |  | -                        class={[styles.fullBtn, styles.point]}
 | 
	
		
			
				|  |  | -                        onClick={() => (popupData.open = true)}>
 | 
	
		
			
				|  |  | -                        <img src={iconMenu} />
 | 
	
		
			
				|  |  | -                      </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                      <div
 | 
	
		
			
				|  |  | -                        class={[
 | 
	
		
			
				|  |  | -                          styles.fullBtn,
 | 
	
		
			
				|  |  | -                          styles.iconDown,
 | 
	
		
			
				|  |  | -                          popupData.activeIndex === data.itemList.length - 1
 | 
	
		
			
				|  |  | -                            ? styles.btnsDisabled
 | 
	
		
			
				|  |  | -                            : ''
 | 
	
		
			
				|  |  | -                        ]}
 | 
	
		
			
				|  |  | -                        onClick={() => {
 | 
	
		
			
				|  |  | -                          if (
 | 
	
		
			
				|  |  | -                            popupData.activeIndex ===
 | 
	
		
			
				|  |  | -                            data.itemList.length - 1
 | 
	
		
			
				|  |  | -                          )
 | 
	
		
			
				|  |  | -                            return;
 | 
	
		
			
				|  |  | -                          handlePreAndNext('down');
 | 
	
		
			
				|  |  | -                        }}>
 | 
	
		
			
				|  |  | -                        <img src={iconDown} />
 | 
	
		
			
				|  |  | -                      </div>
 | 
	
		
			
				|  |  | +                      <img src={iconDown} />
 | 
	
		
			
				|  |  |                      </div>
 | 
	
		
			
				|  |  |                    </div>
 | 
	
		
			
				|  |  | -                )}
 | 
	
		
			
				|  |  | -              </Transition>
 | 
	
		
			
				|  |  | -            </div>
 | 
	
		
			
				|  |  | +                </div>
 | 
	
		
			
				|  |  | +              )}
 | 
	
		
			
				|  |  | +            </Transition>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  | -        ) : (
 | 
	
		
			
				|  |  | -          ''
 | 
	
		
			
				|  |  | -        )}
 | 
	
		
			
				|  |  | +        </div>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          <div
 | 
	
		
			
				|  |  |            style={{ transform: activeData.model ? '' : 'translateY(-100%)' }}
 | 
	
	
		
			
				|  | @@ -1256,6 +1578,11 @@ export default defineComponent({
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  try {
 | 
	
		
			
				|  |  |                    data.detailId = val.itemActive;
 | 
	
		
			
				|  |  | +                  const ids = formatParentId(
 | 
	
		
			
				|  |  | +                    val.itemActive,
 | 
	
		
			
				|  |  | +                    popupData.chapterDetails
 | 
	
		
			
				|  |  | +                  );
 | 
	
		
			
				|  |  | +                  data.lessonCoursewareDetailId = ids[0];
 | 
	
		
			
				|  |  |                    // 更新上课记录 上课的时候才更新
 | 
	
		
			
				|  |  |                    if (data.type !== 'preview') {
 | 
	
		
			
				|  |  |                      await classCourseScheduleUpdate();
 |