Explorar o código

修复最后一个视频播完卡死

liushengqiang %!s(int64=2) %!d(string=hai) anos
pai
achega
8419fdabed
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/views/coursewarePlay/index.tsx

+ 2 - 1
src/views/coursewarePlay/index.tsx

@@ -543,7 +543,8 @@ export default defineComponent({
     const acitveTimer = ref()
     // 轮播切换
     const handleSwipeChange = (index: number) => {
-      if (popupData.activeIndex == index) return
+      // 如果是当前正在播放 或者是视频最后一个
+      if (popupData.activeIndex == index || index === (data.itemList.length - 1)) return
       handleStop()
       clearTimeout(acitveTimer.value)
       const oldIndex = popupData.activeIndex