Commit 66a31001 authored by 李维's avatar 李维

修复指定课件页不好用的问题

parent 9a442f15
...@@ -336,11 +336,8 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -336,11 +336,8 @@ export abstract class middleLayerBase extends cc.Component {
this.courses = data.rows; this.courses = data.rows;
if (coursewareId) { if (coursewareId) {
this.courseIndex = data.rows.findIndex(item => item.id == coursewareId); this.courseIndex = data.rows.findIndex(item => item.id == coursewareId);
} else if(typeof courseIndex === 'number' && !isNaN(courseIndex) && courseIndex >= 0) { } else if(typeof courseIndex != null && !isNaN(courseIndex) && courseIndex > 0) {
if(courseIndex == 0) { this.courseIndex = courseIndex - 1;
courseIndex = 1;
}
this.courseIndex = courseIndex;
} else { } else {
this.courseIndex = data.index || 0; this.courseIndex = data.index || 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment