Commit 8dc9173f authored by wildfirecode13's avatar wildfirecode13

update

parent e8f27ef4
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<canvas id="canvas" style="width: 100%;height: 100%"></canvas> <canvas id="canvas" style="width: 100%;height: 100%"></canvas>
</div> </div>
<!-- 帧率检测 --> <!-- 帧率检测 -->
<script src="https://yun.duiba.com.cn/db_games/libs0126/stats.js"></script> <!-- <script src="https://yun.duiba.com.cn/db_games/libs0126/stats.js"></script> -->
<script> <script>
......
export default class TestButton extends FYGE.Sprite { export default class TestButton extends FYGE.Sprite {
constructor(txt) { constructor(txt,parent?) {
super(); super();
const bg = new FYGE.Shape(); const bg = new FYGE.Shape();
...@@ -18,5 +18,8 @@ export default class TestButton extends FYGE.Sprite { ...@@ -18,5 +18,8 @@ export default class TestButton extends FYGE.Sprite {
buttonTxt.verticalAlign=FYGE.VERTICAL_ALIGN.MIDDLE; buttonTxt.verticalAlign=FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt.fillColor = '0xffffff'; buttonTxt.fillColor = '0xffffff';
this.addChild(buttonTxt); this.addChild(buttonTxt);
if(parent)
parent.addChild(this)
} }
} }
\ No newline at end of file
import { unwatchPageVisibility, watchPageVisibility } from "@spark/utils"; import { unwatchPageVisibility, watchPageVisibility } from "@spark/utils";
import { changeScene, closeCurrentPanel, showPanel } from "../../module/ctrls"; import { changeScene, closeCurrentPanel, showPanel } from "../../module/ctrls";
import PanelCtrl from "../../module/ctrls/panelCtrl";
import { Scene } from "../../module/views/Scene"; import { Scene } from "../../module/views/Scene";
import TestButton from "../common/TestButton";
import getQueryParams from "../getQueryParams"; import getQueryParams from "../getQueryParams";
import { PrizePanel } from "../panels/prize"; import { PrizePanel } from "../panels/prize";
import { ShareFailPanel } from "../panels/share_fail";
import { ShareSuccessPanel } from "../panels/share_success";
import { sendWebNet, WebNetName } from "../WebNet";
import { IndexScene } from "./IndexScene"; import { IndexScene } from "./IndexScene";
let prize; let prize;
export class NewbieScene extends Scene { export class NewbieScene extends Scene {
prizeBtn:FYGE.Sprite;
onPageVisibilityChange = async (visible) => { onPageVisibilityChange = async (visible) => {
console.log('页面visible',visible); console.log('页面visible',visible);
if (!prize) { if (!prize) {
...@@ -26,13 +24,10 @@ export class NewbieScene extends Scene { ...@@ -26,13 +24,10 @@ export class NewbieScene extends Scene {
super.start(); super.start();
const query = getQueryParams(); const query = getQueryParams();
if(query.autoprize) { if(query.autoprize==1) {
this.openPrize(data); this.openPrize(data);
} }
this.addEventListener(FYGE.MouseEvent.CLICK, () => {
this.openPrize(data);
}, this);
} }
...@@ -41,13 +36,24 @@ export class NewbieScene extends Scene { ...@@ -41,13 +36,24 @@ export class NewbieScene extends Scene {
showPanel(PrizePanel, data); showPanel(PrizePanel, data);
} }
onClick_prizeBtn(){
this.openPrize(this.data);
}
initUi(){
super.initUi();
this.prizeBtn = new TestButton('立即岔开',this);
}
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
watchPageVisibility(this.onPageVisibilityChange) watchPageVisibility(this.onPageVisibilityChange);
this.prizeBtn.addEventListener(FYGE.MouseEvent.CLICK,this.onClick_prizeBtn,this);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
unwatchPageVisibility(this.onPageVisibilityChange) unwatchPageVisibility(this.onPageVisibilityChange)
this.prizeBtn.removeEventListener(FYGE.MouseEvent.CLICK,this.onClick_prizeBtn,this);
} }
get groupNames() { return ["newbie"] } get groupNames() { return ["newbie"] }
......
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