diff --git a/src/views/study/PortalIndex.vue b/src/views/study/PortalIndex.vue index e0b45954..cebe7232 100644 --- a/src/views/study/PortalIndex.vue +++ b/src/views/study/PortalIndex.vue @@ -791,8 +791,9 @@ export default { //console.log(e); }, showRes(r,i,index) {//i:子节下标,index:章下标 - if(i!=undefined && index!=undefined) { + if(i!=undefined && index!=undefined && r.status<9) { if(this.courseInfo.orderStudy) { + //判断上个是否学完 if(i == 0) { if(index > 0) { //第一章 第一节 let preCatalog=this.catalogTree[index-1]; @@ -807,11 +808,28 @@ export default { if(pre.status!=9){ this.$message.warning('请按顺序学习!'); return; - } else { - if(this.completed.indexOf(pre.id) > 0) { - this.$message.warning('请按顺序学习!'); - return; - } + } + } + //判断是否是第一个未学完的 + let isAllow=false; + let has=this.catalogTree.some(treeNode=>{ + let hasNo=treeNode.children.some(child=>{ + if(child.status<9){ + if(child.id==r.id){ + isAllow=true; + } + return true; + }else{ + return false; + } + + }); + return hasNo; + }); + if(has){ + if(!isAllow){ + this.$message.warning('请按顺序学习!'); + return; } } }