This commit is contained in:
zhaofang
2022-07-15 13:03:31 +08:00
parent 989fc9170c
commit 021425d7f6

View File

@@ -791,8 +791,9 @@ export default {
//console.log(e); //console.log(e);
}, },
showRes(r,i,index) {//i:子节下标index:章下标 showRes(r,i,index) {//i:子节下标index:章下标
if(i!=undefined && index!=undefined) { if(i!=undefined && index!=undefined && r.status<9) {
if(this.courseInfo.orderStudy) { if(this.courseInfo.orderStudy) {
//判断上个是否学完
if(i == 0) { if(i == 0) {
if(index > 0) { //第一章 第一节 if(index > 0) { //第一章 第一节
let preCatalog=this.catalogTree[index-1]; let preCatalog=this.catalogTree[index-1];
@@ -807,11 +808,28 @@ export default {
if(pre.status!=9){ if(pre.status!=9){
this.$message.warning('请按顺序学习'); this.$message.warning('请按顺序学习');
return; 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;
} }
} }
} }