Commit 5806944f authored by wildfirecode13's avatar wildfirecode13

u

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