Commit f1d60d1a authored by 邱旭's avatar 邱旭

1

parent 6c421aec
...@@ -21,6 +21,7 @@ import CountDown from "./CountDown"; ...@@ -21,6 +21,7 @@ import CountDown from "./CountDown";
import AvatarComp from "./AvatarComp"; import AvatarComp from "./AvatarComp";
import Utils from "../Utils"; import Utils from "../Utils";
import tr = egret.sys.tr; import tr = egret.sys.tr;
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
export default class MapScene extends Scene { export default class MapScene extends Scene {
...@@ -51,7 +52,7 @@ export default class MapScene extends Scene { ...@@ -51,7 +52,7 @@ export default class MapScene extends Scene {
this.updateMyInfo(); this.updateMyInfo();
this.updateAdData(); this.updateAdData();
this.getInviteInfo(); // 查询邀请信息,控制邀请有礼角标 GDispatcher.dispatchEvent("getInviteInfo"); // 查询邀请信息,控制邀请有礼角标
this['avatar'].mask = this['avatarMask']; this['avatar'].mask = this['avatarMask'];
setTimeout(() => { setTimeout(() => {
...@@ -496,7 +497,7 @@ export default class MapScene extends Scene { ...@@ -496,7 +497,7 @@ export default class MapScene extends Scene {
&& timer.min === "00" && timer.min === "00"
&& timer.sec === "00") { && timer.sec === "00") {
this.timer.stop(); this.timer.stop();
this.getInviteInfo(); GDispatcher.dispatchEvent("getInviteInfo");
} }
this["inviteTips"].text = `${timer.hour}:${timer.min}:${timer.sec}`; this["inviteTips"].text = `${timer.hour}:${timer.min}:${timer.sec}`;
} }
...@@ -550,6 +551,9 @@ export default class MapScene extends Scene { ...@@ -550,6 +551,9 @@ export default class MapScene extends Scene {
this['recordBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['recordBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
window.location.href = window['__link__'] window.location.href = window['__link__']
}, this); }, this);
// 消消乐查询信息
GDispatcher.addEvent('getInviteInfo', this.getInviteInfo, this);
} }
initSound() { initSound() {
......
...@@ -5,6 +5,7 @@ import getHomeData from "../getHomeData"; ...@@ -5,6 +5,7 @@ import getHomeData from "../getHomeData";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes"; import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import Utils from "../Utils"; import Utils from "../Utils";
import { addAdComp } from "./BoxPanel"; import { addAdComp } from "./BoxPanel";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
/** /**
* 邀请规则面板 * 邀请规则面板
...@@ -32,20 +33,28 @@ export default class InviteCutTimePanel extends Panel { ...@@ -32,20 +33,28 @@ export default class InviteCutTimePanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
} }
onTouchTap_closeBtn() {
GDispatcher.dispatchEvent("getInviteInfo");
super.onTouchTap_closeBtn();
}
onTouchOK() { onTouchOK() {
if((getHomeData().levels.length + 1) > window['last_level']) { if((getHomeData().levels.length + 1) > window['last_level']) {
changeMapScene(); changeMapScene();
super.hidePanel(); super.hidePanel();
return; return;
} }
GDispatcher.dispatchEvent("getInviteInfo");
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1); PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
} }
......
...@@ -5,6 +5,8 @@ import InviteRulePanel from "./InviteRulePanel"; ...@@ -5,6 +5,8 @@ import InviteRulePanel from "./InviteRulePanel";
import { NetManager } from "../../libs/tw/manager/NetManager"; import { NetManager } from "../../libs/tw/manager/NetManager";
import Utils from "../Utils"; import Utils from "../Utils";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { changeMapScene } from "../startScene/StartScene";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
export default class InvitePanel extends Panel { export default class InvitePanel extends Panel {
public prizeImg: eui.Image; public prizeImg: eui.Image;
...@@ -36,13 +38,18 @@ export default class InvitePanel extends Panel { ...@@ -36,13 +38,18 @@ export default class InvitePanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
// this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this) this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.helpBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapRule, this); this.helpBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapRule, this);
} }
onTouchTap_closeBtn() {
GDispatcher.dispatchEvent("getInviteInfo");
super.onTouchTap_closeBtn();
}
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
// this['inviteBtn'].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this) this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.helpBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapRule, this); this.helpBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapRule, this);
} }
...@@ -54,10 +61,6 @@ export default class InvitePanel extends Panel { ...@@ -54,10 +61,6 @@ export default class InvitePanel extends Panel {
this.addChild(rule); this.addChild(rule);
} }
onTapInvite() {
}
protected onSkinComplete() { protected onSkinComplete() {
this.getGameRes().then(r => this.initUI()); this.getGameRes().then(r => this.initUI());
} }
......
...@@ -3,6 +3,7 @@ import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; ...@@ -3,6 +3,7 @@ import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { changeMapScene } from "../startScene/StartScene"; import { changeMapScene } from "../startScene/StartScene";
import { addAdComp } from "./BoxPanel"; import { addAdComp } from "./BoxPanel";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
/** /**
* 邀请规则面板 * 邀请规则面板
...@@ -28,22 +29,30 @@ export default class InvitePrizePanel extends Panel { ...@@ -28,22 +29,30 @@ export default class InvitePrizePanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this); this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this);
this.game_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.game_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this); this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapGoPrize, this);
this.game_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.game_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
} }
onTouchTap_closeBtn() {
GDispatcher.dispatchEvent("getInviteInfo");
super.onTouchTap_closeBtn();
}
onTouchOK() { onTouchOK() {
if((getHomeData().levels.length + 1) > window['last_level']) { if((getHomeData().levels.length + 1) > window['last_level']) {
changeMapScene(); changeMapScene();
super.hidePanel(); super.hidePanel();
return; return;
} }
GDispatcher.dispatchEvent("getInviteInfo");
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1); PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"avatar": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg" "avatar": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg"
} }
], ],
"completeFlag": 1, "completeFlag": 0,
"openPrizeMsg": "图片", "openPrizeMsg": "图片",
"prizeType": "nickname", "prizeType": "nickname",
"prizeName": "nickname", "prizeName": "nickname",
......
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