Commit 73ce2275 authored by wildfirecode13's avatar wildfirecode13

u

parent 3adad886
{ {
"code": null, "code": null,
"data": 500000, "data": 1000,
"message": 123, "message": 123,
"success": true "success": true
} }
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"alreadyOpenAccount": false, "alreadyOpenAccount": false,
"assistFriendNum": 1, "assistFriendNum": 1,
"canWithdraw": true, "canWithdraw": true,
"experienceAmount": 51200, "experienceAmount": 1000,
"maxExperienceAmount": 2500, "maxExperienceAmount": 2500,
"millionShares": null, "millionShares": null,
"otherExperienceAmount": 1, "otherExperienceAmount": 1,
......
export default class Mask extends FYGE.Sprite {
constructor(color = 0, alpha = .7, container?) {
super();
const bg = new FYGE.Shape();
bg.beginFill(color, alpha);
bg.drawRect(0, 0, 750, 1624);
bg.endFill();
this.addChild(bg);
if (container)
container.addChild(this);
}
}
export const MAX_MONEY=10*10000; export const MAX_MONEY=10*10000;
export const MONEY_PERCENT=0.1;
\ No newline at end of file
...@@ -4,6 +4,7 @@ import { Panel } from "../../module/views/Panel"; ...@@ -4,6 +4,7 @@ import { Panel } from "../../module/views/Panel";
import getObject from "../common/getObject"; import getObject from "../common/getObject";
import { ProgressBarS } from "../common/ProgressBarS"; import { ProgressBarS } from "../common/ProgressBarS";
import { showShareMask } from "../common/ShareMask"; import { showShareMask } from "../common/ShareMask";
import { MONEY_PERCENT } from "../datas";
import { IndexScene } from "../scenes/IndexScene"; import { IndexScene } from "../scenes/IndexScene";
import updateShareFunc from "../share"; import updateShareFunc from "../share";
import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet"; import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet";
...@@ -11,11 +12,33 @@ export class PrizePanel extends Panel { ...@@ -11,11 +12,33 @@ export class PrizePanel extends Panel {
amountTxt: FYGE.TextField; amountTxt: FYGE.TextField;
percentTxt: FYGE.TextField; percentTxt: FYGE.TextField;
inviteBtn; inviteBtn;
wrapper;
showAni() {
if (this.isShowing) return;
this.isShowing = true;
let oriY = this.y || 0;
var skin = RES.getSkinDataByName(this.skinName);
this.position.set(750 / 2, 1624 / 2);
FYGE.Tween.get(this)
.to({ scaleX: 1, scaleY: 1, x: skin.x, y: skin.y }, 300, FYGE.Ease.getBackOut(2))
.call(() => {
this.isShowing = false;
})
}
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);
this.inviteBtn = getObject(this, 'prize_invite'); this.inviteBtn = getObject(this, 'prize_invite');
this.scaleX = 0;
this.scaleY = 0;
this.anchorX = -1;
this.anchorY = -1;
} }
async start(data) { async start(data) {
...@@ -33,7 +56,7 @@ export class PrizePanel extends Panel { ...@@ -33,7 +56,7 @@ export class PrizePanel extends Panel {
prize_tip3.x = 0; prize_tip3.x = 0;
prize_tip3.textAlign = 'center'; prize_tip3.textAlign = 'center';
prize_tip3.text = `${data}/1000000`; prize_tip3.text = `${data}/1000000`;
let percent = 0.05; let percent = MONEY_PERCENT;
if (data / 1000000 > percent) { if (data / 1000000 > percent) {
percent = data / 1000000; percent = data / 1000000;
} }
...@@ -42,7 +65,7 @@ export class PrizePanel extends Panel { ...@@ -42,7 +65,7 @@ export class PrizePanel extends Panel {
progressBar.value = percent; progressBar.value = percent;
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.createItem,{token:token}).then(createItemResult => { sendWebNet(WebNetName.createItem, { token: token }).then(createItemResult => {
updateShareFunc('inPrizePanel', createItemResult.data) updateShareFunc('inPrizePanel', createItemResult.data)
}); });
}) })
......
...@@ -9,7 +9,7 @@ import Marquee from '../common/Marquee'; ...@@ -9,7 +9,7 @@ import Marquee from '../common/Marquee';
import { ProgressBarS } from '../common/ProgressBarS'; import { ProgressBarS } from '../common/ProgressBarS';
import { hideShareMask, showShareMask } from '../common/ShareMask'; import { hideShareMask, showShareMask } from '../common/ShareMask';
import { getStageHeight, getStageOffset } from '../common/stage'; import { getStageHeight, getStageOffset } from '../common/stage';
import { MAX_MONEY } from '../datas'; import { MAX_MONEY, MONEY_PERCENT } from '../datas';
import { DrawPanel } from '../panels/draw'; import { DrawPanel } from '../panels/draw';
import { RulePanel } from '../panels/rule'; import { RulePanel } from '../panels/rule';
import { ShareFailPanel } from '../panels/share_fail'; import { ShareFailPanel } from '../panels/share_fail';
...@@ -33,7 +33,7 @@ export class IndexScene extends Scene { ...@@ -33,7 +33,7 @@ export class IndexScene extends Scene {
// index_experienceAmountTips.x = (750 - w) / 2; // index_experienceAmountTips.x = (750 - w) / 2;
// index_experienceAmountTips2.x = index_experienceAmountTips.x + index_experienceAmountTips.textWidth; // index_experienceAmountTips2.x = index_experienceAmountTips.x + index_experienceAmountTips.textWidth;
let percent = 0.05; let percent = MONEY_PERCENT;
if (experienceAmount / MAX_MONEY > percent) { if (experienceAmount / MAX_MONEY > percent) {
percent = experienceAmount / MAX_MONEY; percent = experienceAmount / MAX_MONEY;
} }
......
import { unwatchPageVisibility, watchPageVisibility } from "@spark/utils"; import { unwatchPageVisibility, watchPageVisibility } from "@spark/utils";
import { changeScene, closeCurrentPanel, hideWaiting, showPanel, showWaiting } from "../../module/ctrls"; import { changeScene, closeCurrentPanel, hideWaiting, showPanel, showWaiting } from "../../module/ctrls";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import { Scene } from "../../module/views/Scene"; import { Scene } from "../../module/views/Scene";
import getObject from "../common/getObject"; import getObject from "../common/getObject";
import getQueryParams from "../common/getQueryParams"; import getQueryParams from "../common/getQueryParams";
import Marquee from "../common/Marquee"; import Marquee from "../common/Marquee";
import Mask from "../common/Mask";
import { hideShareMask } from "../common/ShareMask"; import { hideShareMask } from "../common/ShareMask";
import { PrizePanel } from "../panels/prize"; import { PrizePanel } from "../panels/prize";
import { RulePanel } from "../panels/rule"; import { RulePanel } from "../panels/rule";
...@@ -28,16 +30,10 @@ export class NewbieScene extends Scene { ...@@ -28,16 +30,10 @@ export class NewbieScene extends Scene {
async start(data) { async start(data) {
super.start(); super.start();
const query = getQueryParams(); const query = getQueryParams();
if (query.autoprize == 1) { if (query.autoprize == 1) {
this.openPrize(); this.openPrize();
} }
const indexsvga = new FYGE.MovieClip(RES.getRes('index.svga'));
indexsvga.mouseChildren = indexsvga.mouseEnable = false;
this.addChild(indexsvga);
} }
openPrize() { openPrize() {
...@@ -46,8 +42,26 @@ export class NewbieScene extends Scene { ...@@ -46,8 +42,26 @@ export class NewbieScene extends Scene {
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.acquireExperienceAmount, { token: token }).then(acquireExperienceAmount => { sendWebNet(WebNetName.acquireExperienceAmount, { token: token }).then(acquireExperienceAmount => {
hideWaiting(); hideWaiting();
const mask = new Mask();
layers.topLayer.addChild(mask);
const opensvga = new FYGE.MovieClip(RES.getRes('open.svga'));
opensvga.mouseChildren = opensvga.mouseEnable = false;
layers.topLayer.addChild(opensvga);
opensvga.startAniRange(1, opensvga.totalFrames, 1, () => {
FYGE.Tween.get(opensvga).to({alpha:0},200).call(()=>{layers.topLayer.removeChild(opensvga);})
});
const func = () => {
if (opensvga.currentFrame == 70) {
opensvga.removeEventListener(FYGE.Event.ENTER_FRAME, func, this);
layers.topLayer.removeChild(mask);
if (acquireExperienceAmount.success) if (acquireExperienceAmount.success)
showPanel(PrizePanel, acquireExperienceAmount.data); showPanel(PrizePanel, acquireExperienceAmount.data);
}
};
opensvga.addEventListener(FYGE.Event.ENTER_FRAME, func, this);
}) })
}) })
...@@ -64,10 +78,12 @@ export class NewbieScene extends Scene { ...@@ -64,10 +78,12 @@ export class NewbieScene extends Scene {
initUi() { initUi() {
super.initUi(); super.initUi();
const layer = new FYGE.Sprite;
layer.mouseEnable = layer.mouseChildren = false;
this.addChild(layer);
sendWebNet(WebNetName.carouselInfo).then(res => { sendWebNet(WebNetName.carouselInfo).then(res => {
const template = '{phone}邀请了1位好友,获得了{amount}体验金'; const template = '{phone}邀请了1位好友,获得了{amount}体验金';
const datas = res.data.map(item => { const datas = res.data.map(item => {
let str = template.replace('{phone}', item.nickname); let str = template.replace('{phone}', item.nickname);
...@@ -75,10 +91,16 @@ export class NewbieScene extends Scene { ...@@ -75,10 +91,16 @@ export class NewbieScene extends Scene {
str = str.replace('{amount}', item.amount); str = str.replace('{amount}', item.amount);
return str return str
}); });
const q = this.addChild(new Marquee(datas)); const q = layer.addChild(new Marquee(datas));
q.x = 135; q.y = 448; q.x = 135; q.y = 448;
window['q'] = q; window['q'] = q;
}); });
const indexsvga = new FYGE.MovieClip(RES.getRes('index.svga'));
indexsvga.mouseChildren = indexsvga.mouseEnable = false;
this.addChild(indexsvga);
this.addChild(getObject(this,'newbie_pic2'));
} }
initEvents() { initEvents() {
......
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