--fix bug

This commit is contained in:
yuping
2023-04-20 17:27:00 +08:00
parent b98afdb3db
commit e8804329ce

View File

@@ -264,16 +264,17 @@ function canStudy(setting,current){
return false return false
} }
function toDetail(item, i) { function toDetail(item, i) {
const realIndex = data.value?.list.findIndex(e => e.id === showList.value[i].id);
// 预览和学习设置 // 预览和学习设置
let isStudy = true; 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("当前关卡不可预览"); ElMessage.warning("当前关卡不可预览");
return; return;
} }
if(current.value !== i && canStudy(props.routerInfo.previewSetting,i+1)){ if(current.value !== i && canStudy(props.routerInfo.previewSetting,realIndex+1)){
isStudy = false isStudy = false
} }
if(current.value !== i && canStudy(props.routerInfo.studySetting,i+1)){ if(current.value !== i && canStudy(props.routerInfo.studySetting,realIndex+1)){
isStudy = true isStudy = true
} }
router.push({ router.push({