From e8804329ce6883e44bb47619c94b8cada363c824 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Thu, 20 Apr 2023 17:27:00 +0800 Subject: [PATCH] --fix bug --- src/components/PathDetailImage.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/PathDetailImage.vue b/src/components/PathDetailImage.vue index 5af4ac6..37f50b0 100644 --- a/src/components/PathDetailImage.vue +++ b/src/components/PathDetailImage.vue @@ -264,16 +264,17 @@ function canStudy(setting,current){ return false } function toDetail(item, i) { + const realIndex = data.value?.list.findIndex(e => e.id === showList.value[i].id); // 预览和学习设置 let isStudy = true; - if(current.value !== i && !canStudy(props.routerInfo.previewSetting,i+1) && !canStudy(props.routerInfo.studySetting,i+1)){ + if(current.value !== i && !canStudy(props.routerInfo.previewSetting,realIndex+1) && !canStudy(props.routerInfo.studySetting,realIndex+1)){ ElMessage.warning("当前关卡不可预览"); return; } - if(current.value !== i && canStudy(props.routerInfo.previewSetting,i+1)){ + if(current.value !== i && canStudy(props.routerInfo.previewSetting,realIndex+1)){ isStudy = false } - if(current.value !== i && canStudy(props.routerInfo.studySetting,i+1)){ + if(current.value !== i && canStudy(props.routerInfo.studySetting,realIndex+1)){ isStudy = true } router.push({