Commit 9401dcda authored by limingzhe's avatar limingzhe

fix: debug

parent 9ee305a1
......@@ -10,6 +10,7 @@ export default class NewClass extends middleLayerBase {
token;
course_id;
courseware_id;
backPageScene;
JRZY_ID = -1; //今日作业
......@@ -88,7 +89,7 @@ export default class NewClass extends middleLayerBase {
return;
}
// 打开今日所学
// 打开今日所学c
if (this.course_id == this.JRSX_ID) {
this.loadOnlineBundleNew("JJ_page_learn");
return;
......@@ -101,11 +102,13 @@ export default class NewClass extends middleLayerBase {
}
showBackBtn() {
return;
const backBtn = cc.find("middleLayer/UI/back_btn");
backBtn.active = true;
}
onBackBtnClick() {
const backBtn = cc.find("middleLayer/UI/back_btn");
backBtn.active = false;
......@@ -138,36 +141,50 @@ export default class NewClass extends middleLayerBase {
console.log(' this.token: ', this.token);
cc.game.removePersistRootNode(this.node);
if (this.token && data) {
// if (this.token && data) {
console.log('data str: ', JSON.stringify(data));
// console.log('data str: ', JSON.stringify(data));
this.callNetworkApiPost(`api/dige/v1/user/report`, {
token: this.token,
syllabus_id: this.courseItem.course_id,
courseware_id: this.courseItem.id,
template_name: this.courseItem.template_name,
study_duration: Date.now() - this.courseOpenTimeStamp,
result: JSON.stringify(data),
}, (res) => {
console.log('-----------------');
console.log(res);
console.log('-----------------');
cc.director.loadScene("emptyScene", () => {
this.callNativeFunction({ name: "exit", value: "" });
});
});
} else {
cc.director.loadScene("emptyScene", () => {
this.callNativeFunction({ name: "exit", value: "" });
});
}
// this.callNetworkApiPost(`api/dige/v1/user/report`, {
// token: this.token,
// syllabus_id: this.courseItem.course_id,
// courseware_id: this.courseItem.id,
// template_name: this.courseItem.template_name,
// study_duration: Date.now() - this.courseOpenTimeStamp,
// result: JSON.stringify(data),
// }, (res) => {
// console.log('-----------------');
// console.log(res);
// console.log('-----------------');
// this.backScene();
// });
// } else {
this.backScene();
// }
}
initListener() {
}
backScene() {
let sceneName = 'emptyScene';
if (this.backPageScene) {
sceneName = this.backPageScene;
this.backPageScene = null;
this.loadOnlineBundleNew(sceneName);
return;
}
cc.director.loadScene(sceneName, () => {
this.callNativeFunction({ name: "exit", value: "" });
});
}
async getUserInfo(data = {}) {
......
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