Commit 8dc9173f authored by wildfirecode13's avatar wildfirecode13

update

parent e8f27ef4
......@@ -43,7 +43,7 @@
<canvas id="canvas" style="width: 100%;height: 100%"></canvas>
</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>
......
export default class TestButton extends FYGE.Sprite {
constructor(txt) {
constructor(txt,parent?) {
super();
const bg = new FYGE.Shape();
......@@ -18,5 +18,8 @@ export default class TestButton extends FYGE.Sprite {
buttonTxt.verticalAlign=FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt.fillColor = '0xffffff';
this.addChild(buttonTxt);
if(parent)
parent.addChild(this)
}
}
\ No newline at end of file
import { unwatchPageVisibility, watchPageVisibility } from "@spark/utils";
import { changeScene, closeCurrentPanel, showPanel } from "../../module/ctrls";
import PanelCtrl from "../../module/ctrls/panelCtrl";
import { Scene } from "../../module/views/Scene";
import TestButton from "../common/TestButton";
import getQueryParams from "../getQueryParams";
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";
let prize;
export class NewbieScene extends Scene {
prizeBtn:FYGE.Sprite;
onPageVisibilityChange = async (visible) => {
console.log('页面visible',visible);
if (!prize) {
......@@ -26,14 +24,11 @@ export class NewbieScene extends Scene {
super.start();
const query = getQueryParams();
if(query.autoprize) {
if(query.autoprize==1) {
this.openPrize(data);
}
this.addEventListener(FYGE.MouseEvent.CLICK, () => {
this.openPrize(data);
}, this);
}
openPrize(data){
......@@ -41,13 +36,24 @@ export class NewbieScene extends Scene {
showPanel(PrizePanel, data);
}
onClick_prizeBtn(){
this.openPrize(this.data);
}
initUi(){
super.initUi();
this.prizeBtn = new TestButton('立即岔开',this);
}
initEvents() {
super.initEvents();
watchPageVisibility(this.onPageVisibilityChange)
watchPageVisibility(this.onPageVisibilityChange);
this.prizeBtn.addEventListener(FYGE.MouseEvent.CLICK,this.onClick_prizeBtn,this);
}
removeEvents() {
super.removeEvents();
unwatchPageVisibility(this.onPageVisibilityChange)
this.prizeBtn.removeEventListener(FYGE.MouseEvent.CLICK,this.onClick_prizeBtn,this);
}
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