mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
提交
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user