Commit 30344d41 authored by wildfirecode's avatar wildfirecode

Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev

parents e3d3cbc8 44eb43d6
...@@ -10,9 +10,13 @@ export default class Scene extends ComponentBase { ...@@ -10,9 +10,13 @@ export default class Scene extends ComponentBase {
this.height = this.stage.stageHeight; this.height = this.stage.stageHeight;
this.playAnimation(); this.playAnimation();
} }
getAllPromise(){
} onLoad(){
return new Promise((resolve, reject)=>{
resolve();
})
}
updateScene(){ updateScene(){
} }
......
...@@ -48,8 +48,10 @@ export default class SceneCtrl { ...@@ -48,8 +48,10 @@ export default class SceneCtrl {
scene.addEventListener(egret.Event.ADDED_TO_STAGE, () => { scene.addEventListener(egret.Event.ADDED_TO_STAGE, () => {
scene.start(data); scene.start(data);
}, this); }, this);
scene.onLoad().then(()=>{
this.addToStage(scene); this.addToStage(scene);
onComplete && onComplete(); onComplete && onComplete();
});
} }
addMask() { addMask() {
......
...@@ -108,6 +108,15 @@ export default class MapScene extends Scene { ...@@ -108,6 +108,15 @@ export default class MapScene extends Scene {
private inviteTimer: egret.Timer; private inviteTimer: egret.Timer;
private cutTime: number; private cutTime: number;
onLoad() {
super.onLoad().then(()=>{});
return new Promise((resolve, reject) => {
NetManager.ins.hbRainBaseInfo(() => {
resolve();
});
});
}
async start(data?) { async start(data?) {
super.start(); super.start();
......
...@@ -4,6 +4,8 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher"; ...@@ -4,6 +4,8 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { NetManager } from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../Main"; import { getlogItem } from "../../Main";
import CutTimer from "../../CutTimer"; import CutTimer from "../../CutTimer";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { NetName } from "../../../libs/tw/enum/NetName";
export default class HbRainIcon extends IconBase { export default class HbRainIcon extends IconBase {
...@@ -15,11 +17,10 @@ export default class HbRainIcon extends IconBase { ...@@ -15,11 +17,10 @@ export default class HbRainIcon extends IconBase {
this.cutTimer.callFun = () => { this.cutTimer.callFun = () => {
this.updateIcon(); this.updateIcon();
}; };
this.updateIcon(); let res = DataManager.ins.getData(NetName.HBRAIN_BASEINFO);
if(res) {
this.call(res.success, res);
} }
protected start() {
super.start();
} }
public showLog() { public showLog() {
...@@ -28,7 +29,10 @@ export default class HbRainIcon extends IconBase { ...@@ -28,7 +29,10 @@ export default class HbRainIcon extends IconBase {
} }
private updateIcon() { private updateIcon() {
NetManager.ins.hbRainBaseInfo((success, res) => { NetManager.ins.hbRainBaseInfo((success, res) => this.call(success, res));
}
private call(success, res) {
if(!success) { if(!success) {
if(res.code == "600054" || res.code == "600055") { if(res.code == "600054" || res.code == "600055") {
this.visible = false; this.visible = false;
...@@ -37,7 +41,6 @@ export default class HbRainIcon extends IconBase { ...@@ -37,7 +41,6 @@ export default class HbRainIcon extends IconBase {
return; return;
} }
const data = res.data; const data = res.data;
let time: number; let time: number;
const sysTime = res.timestamp; // 当前系统时间 const sysTime = res.timestamp; // 当前系统时间
if(data.currentSession) { if(data.currentSession) {
...@@ -58,7 +61,6 @@ export default class HbRainIcon extends IconBase { ...@@ -58,7 +61,6 @@ export default class HbRainIcon extends IconBase {
this.visible = false; this.visible = false;
} }
GDispatcher.dispatchEvent('updateActIcon'); GDispatcher.dispatchEvent('updateActIcon');
});
} }
......
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