Commit e57f6b05 authored by wildfirecode13's avatar wildfirecode13

update

parent 55cde038
import { layers, destroyLayers } from "../module/views/layers"; import { changeScene, destroyAllCtrls } from "../module/ctrls";
import { RES } from "../module/RES"; import { RES } from "../module/RES";
import { changeScene, showWaiting, destroyAllCtrls, showPanel, hideWaiting } from "../module/ctrls"; import { destroyLayers, layers } from "../module/views/layers";
import getQueryParams from "./getQueryParams";
import { ResJson } from "./ResJson"; import { ResJson } from "./ResJson";
import { SkinJson } from "./SkinJson";
import { LoadingScene } from "./template/LoadingScene";
import { destroyWebNetData, sendWebNet, WebNetName } from "./WebNet";
import { StartScene } from "./template/StartScene";
import { NewbieScene } from "./scenes/NewbieScene";
import { IndexScene } from "./scenes/IndexScene"; import { IndexScene } from "./scenes/IndexScene";
import { NewbieScene } from "./scenes/NewbieScene";
import { ShareScene } from "./scenes/ShareScene"; import { ShareScene } from "./scenes/ShareScene";
import { ShareFailPanel } from "./panels/share_fail"; import { SkinJson } from "./SkinJson";
import { ShareSuccessPanel } from "./panels/share_success";
import { isFromShare } from "duiba-utils";
import getQueryParams from "./getQueryParams";
import updateShare from "./updateShare"; import updateShare from "./updateShare";
import ShareMask from "./common/ShareMask"; import { destroyWebNetData, sendWebNet, WebNetName } from "./WebNet";
const isShare = () => { const isShare = () => {
const query = getQueryParams(); const query = getQueryParams();
......
const w = 500;
const h = 50;
const gap = 10;
export default class Marquee2 extends FYGE.Sprite {
textwrapper: FYGE.Sprite;
datas: string[];
buttonTxt1: FYGE.TextField;
buttonTxt2: FYGE.TextField;
time: number;
constructor(datas: string[], time: number = 5000, direction = 'left') {
super();
this.datas = datas;
this.time = time;
this.initUI();
this.start();
}
start() {
let next;
next = () => {
const item1 = this.datas.shift();
this.datas.push(item1);
const item2 = this.datas.shift();
this.datas.push(item2);
this.buttonTxt1.text = item1;
this.buttonTxt2.text = item2;
this.buttonTxt1.y=0;
this.buttonTxt2.y=this.buttonTxt1.textHeight;
FYGE.Tween.removeTweens(this.buttonTxt1);
FYGE.Tween.removeTweens(this.buttonTxt2);
FYGE.Tween.get(this.buttonTxt1)
.to({ y: -this.buttonTxt1.textHeight }, this.time)
FYGE.Tween.get(this.buttonTxt2)
.to({ y: -this.buttonTxt2.textHeight }, this.time)
.wait(1000)
.call(next);
}
next();
}
initUI() {
const bg = new FYGE.Shape();
bg.beginFill(0, 1);
bg.drawRoundedRect(0, 0, w, h, 5, 5, 5, 5);
bg.endFill();
this.addChild(bg);
this.textwrapper = new FYGE.Sprite();
this.textwrapper.x = gap;
this.addChild(this.textwrapper);
const mask = new FYGE.Shape();
mask.beginFill(0, 1);
mask.drawRoundedRect(0, 0, w - gap * 2, h, 5, 5, 5, 5);
mask.endFill();
this.textwrapper.addChild(mask);
this.textwrapper.mask = mask;
const buttonTxt = new FYGE.TextField;
buttonTxt.textHeight = h;
buttonTxt.size = 20;
buttonTxt.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt.fillColor = '0xffffff';
this.textwrapper.addChild(buttonTxt);
this.buttonTxt = buttonTxt;
const buttonTxt2 = new FYGE.TextField;
buttonTxt2.textHeight = h;
buttonTxt2.size = 20;
buttonTxt2.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt2.fillColor = '0xffffff';
this.textwrapper.addChild(buttonTxt2);
this.buttonTxt2 = buttonTxt2;
}
dispose() {
}
}
\ No newline at end of file
...@@ -11,7 +11,10 @@ export default class ShareMask extends FYGE.Sprite { ...@@ -11,7 +11,10 @@ export default class ShareMask extends FYGE.Sprite {
bg.endFill(); bg.endFill();
this.addChild(bg); this.addChild(bg);
this.addChild(new TestLabel('这是个分享引导蒙层','0xffffff')); this.addChild(new TestLabel({
text:'这是个分享引导蒙层',
color:'0xffffff',w:750,h:1624
}));
if (container) if (container)
container.addChild(this); container.addChild(this);
......
export default class TestLabel extends FYGE.Sprite { export default class TestLabel extends FYGE.Sprite {
constructor(txt, color='0x000000', parent?) { textfield:FYGE.TextField;
constructor({text,color,w,h,size}:any, parent?) {
super(); super();
this['w']=w;
this['h']=h;
const buttonTxt = new FYGE.TextField; const buttonTxt = new FYGE.TextField;
buttonTxt.text = txt; buttonTxt.text = text;
buttonTxt.textWidth = 750; buttonTxt.textWidth = w;
buttonTxt.textHeight = 1624; buttonTxt.textHeight = h;
buttonTxt.size = 50; buttonTxt.size = size||30;
buttonTxt.textAlign = FYGE.TEXT_ALIGN.CENTER; buttonTxt.textAlign = FYGE.TEXT_ALIGN.CENTER;
buttonTxt.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE; buttonTxt.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt.fillColor = color; buttonTxt.fillColor = color;
this.addChild(buttonTxt); this.addChild(buttonTxt);
this.textfield = buttonTxt
if (parent) if (parent)
parent.addChild(this) parent.addChild(this)
} }
getRect(){
return [this['w'],this['h']]
}
} }
\ No newline at end of file
import { changeScene } from "../../module/ctrls"; import { changeScene } from "../../module/ctrls";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import Group from "../common/Group";
import TestButton from "../common/TestButton"; import TestButton from "../common/TestButton";
import TestLabel from "../common/TestLabel";
import getObject from "../getObject"; import getObject from "../getObject";
import { IndexScene } from "../scenes/IndexScene"; import { IndexScene } from "../scenes/IndexScene";
import { Tools } from "../Tools"; import { Tools } from "../Tools";
...@@ -9,15 +11,38 @@ import updateShare from "../updateShare"; ...@@ -9,15 +11,38 @@ import updateShare from "../updateShare";
import { getWebData, sendWebNet, WebNetName } from "../WebNet"; import { getWebData, sendWebNet, WebNetName } from "../WebNet";
export class PrizePanel extends Panel { export class PrizePanel extends Panel {
amountTxt:FYGE.TextField;
percentTxt:FYGE.TextField;
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);
const group = new Group();
this.addChild(group)
const prizeBtn = new TestButton('立即拆开');
group.add(prizeBtn);
const label = new TestLabel({
text:'1000元', color:'0x000000',w:500,h:100,size:50
});
group.add(label);
this.amountTxt = label.textfield;
const label2 = new TestLabel({
text:'1000/1000000', color:'0x000000',w:500,h:100,size:50
});
group.add(label2);
this.percentTxt = label2.textfield;
} }
get groupNames() { return ["prize"] } get groupNames() { return ["prize"] }
get skinName() { return "prize" } get skinName() { return "prize" }
//两个按钮都是关闭作用 //两个按钮都是关闭作用
get closeBtns() { get closeBtns() {
...@@ -27,13 +52,13 @@ export class PrizePanel extends Panel { ...@@ -27,13 +52,13 @@ export class PrizePanel extends Panel {
async start(data) { async start(data) {
super.start(); super.start();
const indexResult = await sendWebNet(WebNetName.index) const indexResult = await sendWebNet(WebNetName.index)
updateShare('inPrizePanel',data.shareCode,indexResult.data.amount1,indexResult.data.amount2) updateShare('inPrizePanel', data.shareCode, indexResult.data.amount1, indexResult.data.amount2)
} }
hidePanel(){ hidePanel() {
super.hidePanel(); super.hidePanel();
changeScene(IndexScene); changeScene(IndexScene);
} }
} }
\ 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