Commit 5806944f authored by wildfirecode13's avatar wildfirecode13

u

parent 893c6673
{
"code": null,
"data": {
"surplusCount": 0,
"surplusCount": 10,
"credits": 235,
"needCredits": 10,
"type": 1,
"needCredits": 110,
"type": 2,
"isMember":1
},
"message": null,
......
......@@ -18,6 +18,7 @@ export class CostPanel extends Panel {
const cost = 1234567890;
getObject(this, "cost_tips").text = `消耗${cost}积分拆开1个盲盒`;
}
cost_open() {
sendLog("click",1);
this.dispatchEvent("stopIndexEnterFrame", { });
......
......@@ -10,6 +10,10 @@ import { SharePanel } from "./share";
let section;
export class getTimesPanel extends Panel {
hidePanel(){
this.stage.dispatchEvent("restartEnterFrame",{});
super.hidePanel();
}
click_getTimes_go() {
sendLog("click",7);
this.hidePanel();
......
......@@ -7,9 +7,9 @@ import { sendLog } from "../WebNet";
let section;
export class timesNotEnoughPanel extends Panel {
share_share_go(){
sendLog("exposure",8);
console.log('timesNotEnough');
hidePanel(){
this.stage.dispatchEvent("restartEnterFrame",{});
super.hidePanel();
}
get groupNames() { return ["timesNotEnough"] }
......@@ -20,16 +20,13 @@ export class timesNotEnoughPanel extends Panel {
sendLog("click",8);
var skin = RES.getSkinDataByName(this.skinName);
this.position.set(skin.x, skin.y);
// centerTextField(getObject(this,'cost_tips'),496);
}
initEvents() {
super.initEvents();
// getObject(this, 'share_fail_btn').addEventListener(FYGE.MouseEvent.CLICK, this.share_share_go, this);
}
removeEvents() {
super.removeEvents();
// getObject(this, 'share_fail_btn').removeEventListener(FYGE.MouseEvent.CLICK, this.share_share_go, this);
}
protected get closeBtns(): any[] {
......
......@@ -2,7 +2,9 @@ import { showPanel } from "../../module/ctrls";
import { RES } from "../../module/RES";
import { delayClick } from "../common/delayClick";
import { CostPanel } from "../panels/cost";
import { getTimesPanel } from "../panels/getTimes";
import { notEnoughMoneyPanel } from "../panels/notEnoughMoney";
import { timesNotEnoughPanel } from "../panels/timesNotEnough";
import { getWebData } from "../WebNet";
import { WebNetName } from "../WebNetName";
import { Box } from "./Box";
......@@ -78,17 +80,27 @@ export class BoxGroup extends FYGE.Sprite {
handleClick(e) {
delayClick(e.target.stage);
const indexsvga = this.indexsvga = new FYGE.MovieClip(RES.getRes('盲盒选中-输出.svga'));
this.dispatchEvent("stopIndexEnterFrame", { });
this.dispatchEvent("stopIndexEnterFrame", {});
indexsvga.mouseChildren = indexsvga.mouseEnable = false;
indexsvga.position.set(e.target.x-200,e.target.y-190)
indexsvga.position.set(e.target.x - 200, e.target.y - 190)
this.addChild(indexsvga);
indexsvga.startAniRange(1, indexsvga.totalFrames, 1, () => {
const result = getWebData(WebNetName.index);
if (result.data.surplusCount <= 0) {
if(result.data.type==2)
showPanel(timesNotEnoughPanel)
else
showPanel(getTimesPanel);
} else {
if (result.data.needCredits > result.data.credits) {
showPanel(notEnoughMoneyPanel);
} else {
showPanel(CostPanel);
}
}
});
}
}
......@@ -114,7 +114,9 @@ export class IndexScene extends Scene {
}
onRestartFrame() {
if(boxGroup.indexsvga.parent)
boxGroup.removeChild(boxGroup.indexsvga);
if(!this.hasEventListener(FYGE.Event.ENTER_FRAME))
this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
}
......
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