Commit eec9a0e0 authored by huoshizhe's avatar huoshizhe

feat: 结束时展示restart按钮

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