Commit f1d60d1a authored by 邱旭's avatar 邱旭

1

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