Commit 61eddedd authored by 章红平's avatar 章红平

提交

parent 0401fc9e
......@@ -52,7 +52,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
start() {
super.start();
this.log('initBg:' );
this.initBg();
this.log('initData:' );
this.initData();
// cc.find("Canvas/uiP/top/timeN").active=false;
}
......@@ -60,7 +62,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this.initBg();
this.tittleLabel.string = this.data.title;
this.tipLabel.string = this.data.questionText;
this.initCards()
......
......@@ -56,12 +56,15 @@ export class MyCocosSceneComponent extends cc.Component {
(<any>window).courseware.getData((data) => {
this.log('data:' + data);
this.data = data || this.getDefaultData();
this.log('data1:' + data);
this.data = JSON.parse(JSON.stringify(this.data));
this.log('data2:' + data);
this.preloadItem();
})
} else {
this.log('data:' + "======");
this.data = this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data));
this.preloadItem();
}
}
......
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