Commit de5e6189 authored by wildfirecode13's avatar wildfirecode13

update

parent c4533cd7
import { layers } from "../../module/views/layers";
import TestLabel from "./TestLabel"; import TestLabel from "./TestLabel";
export default class ShareMask extends FYGE.Sprite { export default class ShareMask extends FYGE.Sprite {
...@@ -27,4 +28,8 @@ 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); 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"; ...@@ -2,6 +2,7 @@ import { changeScene } from "../../module/ctrls";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import Group from "../common/Group"; import Group from "../common/Group";
import { showShareMask } from "../common/ShareMask";
import TestButton from "../common/TestButton"; import TestButton from "../common/TestButton";
import TestLabel from "../common/TestLabel"; import TestLabel from "../common/TestLabel";
import getObject from "../getObject"; import getObject from "../getObject";
...@@ -11,28 +12,32 @@ import updateShare from "../updateShare"; ...@@ -11,28 +12,32 @@ import updateShare from "../updateShare";
import { getWebData, sendWebNet, WebNetName } from "../WebNet"; import { getWebData, sendWebNet, WebNetName } from "../WebNet";
export class PrizePanel extends Panel { export class PrizePanel extends Panel {
amountTxt:FYGE.TextField; amountTxt: FYGE.TextField;
percentTxt:FYGE.TextField; percentTxt: FYGE.TextField;
closeBtn;inviteBtn;
initUi() { initUi() {
super.initUi(); super.initUi();
var skin = RES.getSkinDataByName(this.skinName); var skin = RES.getSkinDataByName(this.skinName);
this.position.set(skin.x, skin.y); this.position.set(skin.x, skin.y);
const group = new Group(); const group = new Group();
this.addChild(group) this.addChild(group)
const prizeBtn = new TestButton('立即拆开');
group.add(prizeBtn); const closeBtn = this.closeBtn = new TestButton('关闭按钮');
group.add(closeBtn);
const inviteBtn =this.inviteBtn= new TestButton('邀请按钮');
group.add(inviteBtn);
const label = new TestLabel({ 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); group.add(label);
this.amountTxt = label.textfield; this.amountTxt = label.textfield;
const label2 = new TestLabel({ 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); group.add(label2);
...@@ -40,15 +45,6 @@ export class PrizePanel extends Panel { ...@@ -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) { async start(data) {
super.start(); super.start();
const indexResult = await sendWebNet(WebNetName.index) const indexResult = await sendWebNet(WebNetName.index)
...@@ -57,8 +53,28 @@ export class PrizePanel extends Panel { ...@@ -57,8 +53,28 @@ export class PrizePanel extends Panel {
hidePanel() { hidePanel() {
super.hidePanel(); super.hidePanel();
changeScene(IndexScene); 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