Commit 5a124b05 authored by 李维's avatar 李维

修复数字判断错误

parent 4d31f8ad
......@@ -335,16 +335,13 @@ export abstract class middleLayerBase extends cc.Component {
if (data.rows && data.rows.length > 0) {
this.courses = data.rows;
if (coursewareId) {
console.log("coursewareId", coursewareId);
this.courseIndex = data.rows.findIndex(item => item.id == coursewareId);
} else if(courseIndex != null && !isNaN(Number(courseIndex)) && courseIndex >= 0) {
console.log("courseIndex", courseIndex);
} else if(typeof courseIndex === 'number' && !isNaN(courseIndex) && courseIndex >= 0) {
if(courseIndex == 0) {
courseIndex = 1;
}
this.courseIndex = courseIndex;
} else {
console.log(courseId, linkFlag, coursewareId, courseIndex)
this.courseIndex = data.index || 0;
}
this.courseItem = data.rows[this.courseIndex];
......
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