Commit eec9a0e0 authored by huoshizhe's avatar huoshizhe

feat: 结束时展示restart按钮

parent f9a011dd
......@@ -277,9 +277,19 @@ cc.Class({
}, 0);
console.log('rightCount = ' + rightCount);
}
this.showRestartBtn();
console.log('onHomeworkFinish: ' + JSON.stringify(data));
},
showRestartBtn() {
const btnRestart = cc.find('middleLayer/BtnRestart');
btnRestart.active = true;
btnRestart.once('click', () => {
btnRestart.active = false;
this.loadPageBundle();
});
},
callMiddleLayerFunction(apiName, data, callback) {
switch (apiName) {
case 'NS_login':
......@@ -771,6 +781,8 @@ cc.Class({
return this.asyncDelayLog(err);
}
bundle.loadScene(sceneName, null, null, (err, scene) => {
const btnRestart = cc.find('middleLayer/BtnRestart');
btnRestart.active = false;
if (err) {
this.asyncDelayLog('err: ', err);
}
......
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