Commit e70af9c8 authored by shunx 马's avatar shunx 马

111

parent 7840f124
{
"editor.formatOnSave": true,
"brace_style": "none,preserve-inline",
"indent_size": 2,
"indent_char": " ",
"jslint_happy": true,
"unformatted": [""],
"css": {
"indent_size": 2
},
"beautify.language": {
"js": {
"type": [
"javascript",
"json",
"jsonc"
],
"filename": [
".jshintrc",
".jsbeautifyrc"
]
},
"css": [
"css",
"less",
"scss"
],
"html": [
"htm",
"html",
"react"
]
}
}
\ No newline at end of file
...@@ -56,6 +56,10 @@ ...@@ -56,6 +56,10 @@
"keys": "share_bg.png,share_close.png,share_go.png", "keys": "share_bg.png,share_close.png,share_go.png",
"name": "share" "name": "share"
}, },
{
"keys": "盲盒开启-打开-输出.svga,盲盒选中-输出.svga,首页元素循环-输出.svga",
"name": "svga"
},
{ {
"keys": "timesNotEnough_bg.png,timesNotEnough_close.png,timesNotEnough_ok.png", "keys": "timesNotEnough_bg.png,timesNotEnough_close.png,timesNotEnough_ok.png",
"name": "timesNotEnough" "name": "timesNotEnough"
......
...@@ -56,6 +56,10 @@ export const ResJson = { ...@@ -56,6 +56,10 @@ export const ResJson = {
"keys": "share_bg.png,share_close.png,share_go.png", "keys": "share_bg.png,share_close.png,share_go.png",
"name": "share" "name": "share"
}, },
{
"keys": "盲盒开启-打开-输出.svga,盲盒选中-输出.svga,首页元素循环-输出.svga",
"name": "svga"
},
{ {
"keys": "timesNotEnough_bg.png,timesNotEnough_close.png,timesNotEnough_ok.png", "keys": "timesNotEnough_bg.png,timesNotEnough_close.png,timesNotEnough_ok.png",
"name": "timesNotEnough" "name": "timesNotEnough"
......
...@@ -5,37 +5,54 @@ import getObject from "../common/getObject"; ...@@ -5,37 +5,54 @@ import getObject from "../common/getObject";
let section; let section;
export class CostPanel extends Panel { export class CostPanel extends Panel {
start() {
start(){
super.start(); super.start();
const cost = 1234567890; const cost = 1234567890;
getObject(this,'cost_tips').text = `消耗${cost}积分拆开1个盲盒` getObject(this, "cost_tips").text = `消耗${cost}积分拆开1个盲盒`;
} }
cost_open(){ cost_open() {
console.log('cost_open'); const indexsvga = new FYGE.MovieClip(RES.getRes("盲盒开启-打开-输出.svga"));
indexsvga.mouseChildren = indexsvga.mouseEnable = false;
// indexsvga.position.set(100,100)
this.addChild(indexsvga);
indexsvga.startAniRange(1, indexsvga.totalFrames, 1, () => {
});
} }
get groupNames() { return ["cost"] } get groupNames() {
get skinName() { return "cost" } return ["cost"];
}
get skinName() {
return "cost";
}
initUi() { initUi() {
super.initUi(); super.initUi();
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); centerTextField(getObject(this, "cost_tips"), 496);
} }
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
getObject(this, 'cost_open').addEventListener(FYGE.MouseEvent.CLICK, this.cost_open, this); getObject(this, "cost_open").addEventListener(
FYGE.MouseEvent.CLICK,
this.cost_open,
this
);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
getObject(this, 'cost_open').removeEventListener(FYGE.MouseEvent.CLICK, this.cost_open, this); getObject(this, "cost_open").removeEventListener(
FYGE.MouseEvent.CLICK,
this.cost_open,
this
);
} }
protected get closeBtns(): any[] { protected get closeBtns(): any[] {
return [getObject(this,'cost_close')] return [getObject(this, "cost_close")];
} }
} }
import { showPanel } from "../../module/ctrls";
import { RES } from "../../module/RES";
import { CostPanel } from "../panels/cost";
import { Box } from "./Box"; import { Box } from "./Box";
export interface Move { export interface Move {
...@@ -18,19 +21,22 @@ export class BoxGroup extends FYGE.Sprite { ...@@ -18,19 +21,22 @@ export class BoxGroup extends FYGE.Sprite {
initBox() { initBox() {
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i++) {
let box = new Box(); let box = new Box();
box.position.set(40, 0+i*238); box.position.set(40, 0 + i * 238);
box.addEventListener(FYGE.MouseEvent.CLICK, this.handleClick, this);
this.addChild(box); this.addChild(box);
boxGroupUpLeft.push(box); boxGroupUpLeft.push(box);
} }
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i++) {
let box = new Box(); let box = new Box();
box.position.set(230, 0+i*238); box.position.set(230, 0 + i * 238);
box.addEventListener(FYGE.MouseEvent.CLICK, this.handleClick, this);
this.addChild(box); this.addChild(box);
boxGroupDown.push(box); boxGroupDown.push(box);
} }
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i++) {
let box = new Box(); let box = new Box();
box.position.set(427, 0+i*238); box.position.set(427, 0 + i * 238);
box.addEventListener(FYGE.MouseEvent.CLICK, this.handleClick, this);
this.addChild(box); this.addChild(box);
boxGroupUpRight.push(box); boxGroupUpRight.push(box);
} }
...@@ -62,4 +68,12 @@ export class BoxGroup extends FYGE.Sprite { ...@@ -62,4 +68,12 @@ export class BoxGroup extends FYGE.Sprite {
boxGroupUpRight.push(popBox); boxGroupUpRight.push(popBox);
} }
} }
handleClick() {
// const indexsvga = new FYGE.MovieClip(RES.getRes('盲盒开启-打开-输出.svga'));
// indexsvga.mouseChildren = indexsvga.mouseEnable = false;
// // indexsvga.position.set(100,100)
// this.addChild(indexsvga);
showPanel(CostPanel);
}
} }
...@@ -31,13 +31,8 @@ export class IndexScene extends Scene { ...@@ -31,13 +31,8 @@ export class IndexScene extends Scene {
start() { start() {
super.start(); super.start();
<<<<<<< HEAD
this.getIndex(); this.getIndex();
// showPanel(SharePanel); // showPanel(SharePanel);
=======
showPanel(PrizePanel);
>>>>>>> 4445b545174f45bdb5de86ca86be78b8f149ecec
getObject(this,'index_sharetips').visible=false; getObject(this,'index_sharetips').visible=false;
this.initContainer(); this.initContainer();
this.initmask(); this.initmask();
...@@ -94,4 +89,6 @@ export class IndexScene extends Scene { ...@@ -94,4 +89,6 @@ export class IndexScene extends Scene {
} }
} }
} }
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