Commit 937553a1 authored by 邱旭's avatar 邱旭

1

parent 6d04de41
......@@ -23,6 +23,7 @@ import Utils from "../Utils";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import Loading from "../../libs/new_wx/components/Loading";
import ScratchIcon from "./icon/ScratchIcon";
import TurntableIcon from "./icon/TurntableIcon";
let doHelpFlag = false;
// let adTag = false;
......@@ -37,6 +38,8 @@ export default class MapScene extends Scene {
static starHash: any = {};
_data;
private icons = {};
sendInvite() {
const code = Utils.getRequestByKey('shareCode');
if(!code) return;
......@@ -72,10 +75,12 @@ export default class MapScene extends Scene {
async start(data?) {
super.start();
this.addIcon(); // 添加Icon
this.sendInvite();
PanelCtrl.instance.show('back');
this.updateMyInfo();
this.updateAdData();
GDispatcher.dispatchEvent("getInviteInfo"); // 查询邀请信息,控制邀请有礼角标
......@@ -91,8 +96,6 @@ export default class MapScene extends Scene {
stopGamebg();
let scratchBtn = new ScratchIcon("scratch", this["scratchGroup"], this["scratchBtn"], this["scratchTipsBg"], this["scratchTips"]);
NetManager.ins.getSignInfo(() => {
const panels = [];
const date = new Date();
......@@ -248,6 +251,14 @@ export default class MapScene extends Scene {
}
// 添加图标
private addIcon(){
this.icons = {
"scratchIcon": new ScratchIcon("scratchIcon", this["scratchGroup"], this["scratchBtn"], this["scratchTipsBg"], this["scratchTips"]),
"turntableIcon": new TurntableIcon("turntableIcon", this["turnTableGroup"], this["turnTableBtn"], this["turnTableTipsBg"], this["turnTableTips"])
};
}
updateMyInfo() {
this['avatar'].visible = false;
this['nameTxt'].text = '';
......@@ -299,7 +310,7 @@ export default class MapScene extends Scene {
if(this['pic'])
egret.Tween.removeTweens(this['pic']);
if(this.inviteTimer){
if(this.inviteTimer) {
this.inviteTimer.stop();
this.inviteTimer.removeEventListener(egret.TimerEvent.TIMER, this.inviteCutTimer, this);
}
......@@ -639,25 +650,8 @@ export default class MapScene extends Scene {
}, window['signActivityId'])
}
////////////////////////////////////////////////// 刮刮卡 //////////////////////////////////////////////////
onTap_scratchBtn() {
NetManager.ins.getInviteInfo((success, res) => {
if(!success) {
return;
}
PanelCtrl.instance.show('scratch', res.data);
});
}
////////////////////////////////////////////////// 大转盘 //////////////////////////////////////////////////
onTap_turnTableBtn() {
PanelCtrl.instance.show('turnTable')
}
protected initEvents() {
// this['goldBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_goldBtn, this)
this['turnTableBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_turnTableBtn, this)
// this['scratchBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_scratchBtn, this)
this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_inviteBtn, this)
this['friendBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_friendBtn, this)
this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_adBtn, this)
......
......@@ -14,7 +14,7 @@ export default class IconBase{
}
constructor(name:string, group:eui.Group, btn:eui.Button, tipsBg:eui.Image, tipsLabel:eui.Label){
constructor(name:string, group:eui.Group, btn:eui.Button, tipsBg?:eui.Image, tipsLabel?:eui.Label){
this.iconGroup = group;
this.iconBtn = btn;
this.iconTipsBg = tipsBg;
......@@ -28,7 +28,7 @@ export default class IconBase{
}
protected onTouchBtn(e:egret.TouchEvent){
console.log("基类");
}
protected removeEvents(){
......
import IconBase from "./IconBase";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
export default class ScratchIcon extends IconBase {
constructor(name: string, group: eui.Group, btn: eui.Button, tipsBg: eui.Image, tipsLabel: eui.Label) {
constructor(name: string, group: eui.Group, btn: eui.Button, tipsBg?: eui.Image, tipsLabel?: eui.Label) {
super(name, group, btn, tipsBg, tipsLabel);
}
......@@ -11,7 +13,12 @@ export default class ScratchIcon extends IconBase {
protected onTouchBtn(e: egret.TouchEvent) {
super.onTouchBtn(e);
console.log("子类");
NetManager.ins.getInviteInfo((success, res) => {
if(!success) {
return;
}
PanelCtrl.instance.show('scratch', res.data);
});
}
protected removeEvents() {
......
import IconBase from "./IconBase";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
export default class TurntableIcon extends IconBase {
constructor(name: string, group: eui.Group, btn: eui.Button, tipsBg?: eui.Image, tipsLabel?: eui.Label) {
super(name, group, btn, tipsBg, tipsLabel);
}
protected initEvents() {
super.initEvents();
}
protected onTouchBtn(e: egret.TouchEvent) {
super.onTouchBtn(e);
PanelCtrl.instance.show('turnTable');
}
protected removeEvents() {
super.removeEvents();
}
protected destory() {
super.destory();
}
}
\ No newline at end of file
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