Commit edfb2551 authored by 李维's avatar 李维

在处理homeworkFinish数据时,禁止退出

parent a0c9979c
......@@ -626,8 +626,12 @@ export default class NewClass extends middleLayerBase {
callback && callback(res);
}
// 正在保存数据
waittingUnlock = false;
async onHomeworkFinish(callBack, data = null, isSaveAnswer = true) {
console.log("===onHomeworkFinish===", callBack, data, isSaveAnswer);
// 表示正在等待解锁
this.waittingUnlock = true;
if (typeof (callBack) == 'object') {
data = callBack;
}
......@@ -641,6 +645,7 @@ export default class NewClass extends middleLayerBase {
// 数字版又要不自动跳页了
// this.goNextPage();
}
this.waittingUnlock = false;
}
async pdtdFinishHandler() {
......@@ -1072,6 +1077,11 @@ export default class NewClass extends middleLayerBase {
onClickExitBtn() {
const exit = () => {
if(this.waittingUnlock) {
// 正在保存数据,不允许退出
this.showTips("正在解锁下一关,请稍后...");
return
}
cc.find('middleLayer/BtnRight').active = false;
cc.find('middleLayer/BtnLeft').active = false;
......
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