Commit de5e6189 authored by wildfirecode13's avatar wildfirecode13

update

parent c4533cd7
import { layers } from "../../module/views/layers";
import TestLabel from "./TestLabel";
export default class ShareMask extends FYGE.Sprite {
......@@ -27,4 +28,8 @@ export default class ShareMask extends FYGE.Sprite {
this.addEventListener(FYGE.MouseEvent.CLICK, callback, this);
}
}
export const showShareMask = ()=>{
layers.shareLayer.addChild(new ShareMask())
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ import { changeScene } from "../../module/ctrls";
import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel";
import Group from "../common/Group";
import { showShareMask } from "../common/ShareMask";
import TestButton from "../common/TestButton";
import TestLabel from "../common/TestLabel";
import getObject from "../getObject";
......@@ -11,28 +12,32 @@ import updateShare from "../updateShare";
import { getWebData, sendWebNet, WebNetName } from "../WebNet";
export class PrizePanel extends Panel {
amountTxt:FYGE.TextField;
percentTxt:FYGE.TextField;
amountTxt: FYGE.TextField;
percentTxt: FYGE.TextField;
closeBtn;inviteBtn;
initUi() {
super.initUi();
var skin = RES.getSkinDataByName(this.skinName);
this.position.set(skin.x, skin.y);
const group = new Group();
this.addChild(group)
const prizeBtn = new TestButton('立即拆开');
group.add(prizeBtn);
this.addChild(group)
const closeBtn = this.closeBtn = new TestButton('关闭按钮');
group.add(closeBtn);
const inviteBtn =this.inviteBtn= new TestButton('邀请按钮');
group.add(inviteBtn);
const label = new TestLabel({
text:'1000元', color:'0x000000',w:500,h:100,size:50
});
text: '1000元', color: '0x000000', w: 500, h: 100, size: 50
});
group.add(label);
this.amountTxt = label.textfield;
const label2 = new TestLabel({
text:'1000/1000000', color:'0x000000',w:500,h:100,size:50
});
text: '1000/1000000', color: '0x000000', w: 500, h: 100, size: 50
});
group.add(label2);
......@@ -40,15 +45,6 @@ export class PrizePanel extends Panel {
}
get groupNames() { return ["prize"] }
get skinName() { return "prize" }
//两个按钮都是关闭作用
get closeBtns() {
return [getObject(this, 'prize_closebtn'), getObject(this, 'prize_okbtn')];
}
async start(data) {
super.start();
const indexResult = await sendWebNet(WebNetName.index)
......@@ -57,8 +53,28 @@ export class PrizePanel extends Panel {
hidePanel() {
super.hidePanel();
changeScene(IndexScene);
}
onClick_inviteBtn(){
showShareMask();
}
//两个按钮都是关闭作用
get closeBtns() {
return [this.closeBtn];
}
initEvents() {
super.initEvents();
this.inviteBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this);
}
removeEvents() {
super.removeEvents();
this.inviteBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this);
}
get groupNames() { return ["prize"] }
get skinName() { return "prize" }
}
\ 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