Commit 7bd7cb5b authored by wildfirecode's avatar wildfirecode

1

parent 92720411
...@@ -169,8 +169,8 @@ export default class MainBase extends eui.UILayer { ...@@ -169,8 +169,8 @@ export default class MainBase extends eui.UILayer {
"rightMark", "rightMark",
"unlightedStar" "unlightedStar"
] ]
for(var i=0;i<arr.length;i++){ for (var i = 0; i < arr.length; i++) {
RES.getResAsync(arr[i]+"_png") RES.getResAsync(arr[i] + "_png")
} }
} }
...@@ -206,11 +206,24 @@ export default class MainBase extends eui.UILayer { ...@@ -206,11 +206,24 @@ export default class MainBase extends eui.UILayer {
} }
protected createGameScene() { protected createGameScene() {
NetManager.ins.ajaxElement(async () => { let count = 2;
const check = () => {
if (count <= 0) {
Buried.init(); Buried.init();
SceneCtrl.instance.change(ModuleTypes.START_SCENE, this.svgaList); SceneCtrl.instance.change(ModuleTypes.START_SCENE, this.svgaList);
}) }
}
NetManager.ins.hc_home(() => {
count--;
check();
}, window['collectRuleId']);
NetManager.ins.ajaxElement(async () => {
count--;
check();
});
} }
} }
\ No newline at end of file
enum PropType{
BOOM=1,
HAMMER,
CHANCE_NUM
}
export default PropType
\ No newline at end of file
...@@ -48,9 +48,9 @@ export default class MapScene extends Scene { ...@@ -48,9 +48,9 @@ export default class MapScene extends Scene {
}, this) }, this)
} }
setTimeout(() => { // setTimeout(() => {
PanelCtrl.instance.show('box'); // PanelCtrl.instance.show('box');
}, 2000); // }, 2000);
} }
protected initEvents() { protected initEvents() {
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import PropType from "../PropType";
export default class Buy1Panel extends Panel { export default class Buy1Panel extends Panel {
buyBtn: eui.Button
start(data) { start(data) {
super.start(); super.start();
this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this);
}
ontap() {
this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true;
if (success) {
this.hidePanel();
}
}, 2, PropType.HAMMER);//兑换道具
} }
get skinKey() { return 'Buy1' } get skinKey() { return 'Buy1' }
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import PropType from "../PropType";
export default class Buy2Panel extends Panel { export default class Buy2Panel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this);
}
buyBtn: eui.Button
ontap() {
this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true;
if (success) {
this.hidePanel();
}
}, 2, PropType.BOOM);//兑换道具
} }
get skinKey() { return 'Buy2' } get skinKey() { return 'Buy2' }
} }
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import PropType from "../PropType";
export default class Buy3Panel extends Panel { export default class Buy3Panel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this);
} }
buyBtn: eui.Button
get skinKey() { return 'Buy3' } get skinKey() { return 'Buy3' }
ontap() {
this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true;
if (success) {
this.hidePanel();
}
}, 2, PropType.CHANCE_NUM);//兑换道具
}
} }
\ 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