Commit 27a8170e authored by limingzhe's avatar limingzhe

fix: debug

parent 3b5d719c
......@@ -12,6 +12,7 @@ export default class NewClass extends middleLayerBase {
courseware_id;
backPageScene;
isRunCamp = false;
isTodayWork = false;
JRZY_ID = -1; //今日作业
JRSX_ID = -2; //今日所学
......@@ -59,7 +60,13 @@ export default class NewClass extends middleLayerBase {
this.course_id = bundleInfo.course_id;
this.courseware_id = bundleInfo.courseware_id;
this.isRunCamp = bundleInfo.is_run_camp;
if (this.isRunCamp ) {
if (this.isRunCamp) {
this.setCurHomeworkData( bundleInfo.homework_id, bundleInfo.syllabus_id, bundleInfo.user_id);
this.initExitPanel();
this.initNetworkLoading();
}
this.isTodayWork = bundleInfo.is_today_work;
if (this.isTodayWork) {
this.setCurHomeworkData( bundleInfo.homework_id, bundleInfo.syllabus_id, bundleInfo.user_id);
this.initExitPanel();
this.initNetworkLoading();
......@@ -69,7 +76,7 @@ export default class NewClass extends middleLayerBase {
cc.sys.localStorage.setItem('student_token', bundleInfo.token);
console.log("student_token 1: ", bundleInfo.token);
if (!this.isRunCamp) {
if (!this.isRunCamp && !this.isTodayWork) {
await this.getUserInfo();
}
......@@ -131,6 +138,7 @@ export default class NewClass extends middleLayerBase {
exitPanel.active = false;
this.isRunCamp = false;
this.isTodayWork = false;
this.curHomeworkId = null;
this.curSyllabusId = null;
this.curUserId = null;
......@@ -220,6 +228,10 @@ export default class NewClass extends middleLayerBase {
return;
}
if (this.isTodayWork && this.curHomeworkId) {
this.showExitPanel();
return;
}
// if (this.node) {
// cc.game.removePersistRootNode(this.node);
......@@ -418,6 +430,12 @@ export default class NewClass extends middleLayerBase {
return;
}
if (this.isTodayWork) {
this.onHomeworkFinishTodayWork(d1, d2);
return;
}
console.log('in onHomeworkFinish');
let data = d1;
let callback = null;
......@@ -446,6 +464,49 @@ export default class NewClass extends middleLayerBase {
onHomeworkFinishTodayWork(d1 = null, d2 = null) {
console.log('in onHomeworkFinishTodayWork');
let data = d1;
let callback = null;
if (typeof(d1) == 'function') {
data = d2;
callback = d1;
}
if (this.curHomeworkId == null || this.curSyllabusId == null || this.curUserId == null) {
callback && callback();
this.isTodayWork = false;
return;
}
console.log('in onHomeworkFinish 1');
console.log(' curUserId : ' + this.curUserId);
console.log(' curHomeworkId : ' + this.curHomeworkId);
console.log(' curSyllabusId : ' + this.curSyllabusId);
this.showNetworkLoading();
this.callNetworkApiPostNew(`v1/class-work/finish/${this.curUserId}/${this.curHomeworkId}`, {
"id": this.curHomeworkId,
"useTime": 10,
"score": 100,
"accuracy": 1
}, res => {
this.hideNetworkLoading();
this.curSyllabusId = null;
this.curHomeworkId = null;
this.isTodayWork = false;
callback && callback(res);
});
}
onHomeworkFinishRunCamp(d1 = null, d2 = null) {
console.log('in onHomeworkFinishRunCamp');
......
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