Commit 73ce2275 authored by wildfirecode13's avatar wildfirecode13

u

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