Commit 841774fe authored by wildfirecode13's avatar wildfirecode13

u

parent 2aa8705c
{ {
"code": null, "code": null,
"data": 1000, "data": 2000,
"message": null, "message": null,
"success": true "success": true
} }
\ No newline at end of file
{ {
"code": null, "code": null,
"data": false, "data": true,
"message": null, "message": null,
"success": true "success": true
} }
\ No newline at end of file
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
"alreadyOpenAccount": false, "alreadyOpenAccount": false,
"assistFriendNum": 0, "assistFriendNum": 0,
"canWithdraw": false, "canWithdraw": false,
"experienceAmount": 1000, "experienceAmount": 1234,
"maxExperienceAmount": 2500, "maxExperienceAmount": 2500,
"millionShares": null, "millionShares": null,
"otherExperienceAmount": 0, "otherExperienceAmount": 0,
"sevenDayAnnualization": "2.250%", "sevenDayAnnualization": "2.250%",
"sumIncome": 0.00, "sumIncome": 0.01,
"yesterdayIncome": 0.00 "yesterdayIncome": 0.012
}, },
"message": null, "message": null,
"success": true "success": true
......
This diff is collapsed.
...@@ -444,6 +444,7 @@ export const SkinJson ={ ...@@ -444,6 +444,7 @@ export const SkinJson ={
} }
}, },
{ {
"id": "ruleTxt",
"name": "rule_tips", "name": "rule_tips",
"x": 83, "x": 83,
"y": 240, "y": 240,
...@@ -456,6 +457,7 @@ export const SkinJson ={ ...@@ -456,6 +457,7 @@ export const SkinJson ={
} }
}, },
{ {
"id": "knowBtn",
"name": "rule_ok", "name": "rule_ok",
"x": 127, "x": 127,
"y": 713, "y": 713,
...@@ -465,6 +467,7 @@ export const SkinJson ={ ...@@ -465,6 +467,7 @@ export const SkinJson ={
} }
}, },
{ {
"id": "closeBtn",
"name": "rule_close", "name": "rule_close",
"x": 560, "x": 560,
"y": 0, "y": 0,
...@@ -890,7 +893,7 @@ export const SkinJson ={ ...@@ -890,7 +893,7 @@ export const SkinJson ={
"y": 560, "y": 560,
"type": "text", "type": "text",
"props": { "props": {
"text": "100", "text": "",
"size": 40, "size": 40,
"fillColor": "#c75b2b", "fillColor": "#c75b2b",
"textAlpha": 1 "textAlpha": 1
......
import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import { Tools } from "../Tools"; import { Tools } from "../Tools";
import { getWebData, sendWebNet, WebNetName } from "../WebNet"; import { getWebData, sendWebNet, WebNetName } from "../WebNet";
let section; let section;
export class RulePanel extends Panel { export class RulePanel extends Panel {
get groupNames() { return ["RulePanel"] } get groupNames() { return ["rule"] }
get skinName() { return "RulePanel" } get skinName() { return "rule" }
ruleTxt: FYGE.TextField; ruleTxt: FYGE.TextField;
knowBtn: FYGE.Button; knowBtn: FYGE.Button;
closeBtn: FYGE.Button; closeBtn: FYGE.Button;
...@@ -15,8 +16,15 @@ export class RulePanel extends Panel { ...@@ -15,8 +16,15 @@ export class RulePanel extends Panel {
return [this.closeBtn, this.knowBtn]; return [this.closeBtn, this.knowBtn];
} }
initUi(){
super.initUi();
var skin = RES.getSkinDataByName(this.skinName);
this.position.set(skin.x, skin.y);
}
async start(data) { async start(data) {
super.start(); super.start();
//取接口数据 //取接口数据
const res = await sendWebNet(WebNetName.projectRule) const res = await sendWebNet(WebNetName.projectRule)
if (!res.success) return if (!res.success) return
...@@ -50,10 +58,10 @@ export class RulePanel extends Panel { ...@@ -50,10 +58,10 @@ export class RulePanel extends Panel {
section.id = "rule"; section.id = "rule";
section.style.overflowX = "hidden"; section.style.overflowX = "hidden";
section.style.overflowY = "auto"; section.style.overflowY = "auto";
section.style.width = 610 + "px"; section.style.width = 430 + "px";
section.style.height = 816 + "px"; section.style.height = 400 + "px";
section.style.lineHeight = 48 + "px"; section.style.lineHeight = 40 + "px";
section.style.fontSize = this.ruleTxt.size + 'px'; section.style.fontSize = 30 + 'px';
section.style.color = this.ruleTxt.fillColor; section.style.color = this.ruleTxt.fillColor;
section.style.whiteSpace = "pre-line"; section.style.whiteSpace = "pre-line";
section.innerHTML = ruleStr; section.innerHTML = ruleStr;
......
...@@ -3,10 +3,12 @@ import { showPanel } from "../../module/ctrls"; ...@@ -3,10 +3,12 @@ import { showPanel } from "../../module/ctrls";
import PanelCtrl from '../../module/ctrls/panelCtrl'; import PanelCtrl from '../../module/ctrls/panelCtrl';
import { Scene } from "../../module/views/Scene"; import { Scene } from "../../module/views/Scene";
import Marquee from '../common/Marquee'; import Marquee from '../common/Marquee';
import { ProgressBarS } from '../common/ProgressBarS';
import { hideShareMask } from '../common/ShareMask'; import { hideShareMask } from '../common/ShareMask';
import getObject from '../getObject'; import getObject from '../getObject';
import getQueryParams from '../getQueryParams'; import getQueryParams from '../getQueryParams';
import { DrawPanel } from '../panels/draw'; import { DrawPanel } from '../panels/draw';
import { RulePanel } from '../panels/rule';
import { ShareFailPanel } from '../panels/share_fail'; import { ShareFailPanel } from '../panels/share_fail';
import { ShareSuccessPanel } from '../panels/share_success'; import { ShareSuccessPanel } from '../panels/share_success';
import { getStageHeight, getStageOffset } from '../stage'; import { getStageHeight, getStageOffset } from '../stage';
...@@ -14,8 +16,21 @@ import updateShare from '../updateShare'; ...@@ -14,8 +16,21 @@ import updateShare from '../updateShare';
import { getPxTokenSave, sendWebNet, WebNetName } from '../WebNet'; import { getPxTokenSave, sendWebNet, WebNetName } from '../WebNet';
export class IndexScene extends Scene { export class IndexScene extends Scene {
onclick_index_drawBtn() { updateIndexUI({experienceAmount,yesterdayIncome,sumIncome,sevenDayAnnualization}) {
getObject(this,'index_experienceAmountTips').text = experienceAmount;
getObject(this,'index_sumIncomeTips').text = sumIncome || '0';
getObject(this,'index_sevenDayAnnualizationTips').text = sevenDayAnnualization;
getObject(this,'index_yesterdayIncomeTips').text = `昨日收益:${yesterdayIncome||'0'}元`;
let percent = 0.05;
if (experienceAmount / 1000000 > percent) {
percent = experienceAmount / 1000000;
}
const progressBar = new ProgressBarS(getObject(this, 'index_progress'));
progressBar.value = percent;
}
onclick_index_drawBtn() {
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.withDraw, { token: token }).then(res => { sendWebNet(WebNetName.withDraw, { token: token }).then(res => {
showPanel(DrawPanel); showPanel(DrawPanel);
...@@ -33,13 +48,7 @@ export class IndexScene extends Scene { ...@@ -33,13 +48,7 @@ export class IndexScene extends Scene {
this.page.view.addChild(getObject(this, 'index_wrapper')); this.page.view.addChild(getObject(this, 'index_wrapper'));
getObject(this, 'index_millionSharesTips').visible = false;
getObject(this, 'index_drawGrayBtn').visible = false; getObject(this, 'index_drawGrayBtn').visible = false;
getObject(this.page, 'index_task1').visible = false;
// getObject(this.page,'task2new').visible=false;
getObject(this.page, 'index_task2').visible = false;
} }
async start(data) { async start(data) {
...@@ -71,6 +80,7 @@ export class IndexScene extends Scene { ...@@ -71,6 +80,7 @@ export class IndexScene extends Scene {
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.myWallet, { token: token }).then(myWalletResult => { sendWebNet(WebNetName.myWallet, { token: token }).then(myWalletResult => {
console.log('获取钱包信息'); console.log('获取钱包信息');
this.updateIndexUI(myWalletResult.data);
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.createItem, { token: token }).then(createItemResult => { sendWebNet(WebNetName.createItem, { token: token }).then(createItemResult => {
updateShare('inIndexScene', createItemResult.data,) updateShare('inIndexScene', createItemResult.data,)
...@@ -106,16 +116,22 @@ export class IndexScene extends Scene { ...@@ -106,16 +116,22 @@ export class IndexScene extends Scene {
} }
} }
onclick_index_ruleBtn() {
showPanel(RulePanel);
}
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
watchPageVisibility(this.onPageVisibilityChange); watchPageVisibility(this.onPageVisibilityChange);
getObject(this, 'index_drawBtn').addEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_drawBtn, this) getObject(this, 'index_drawBtn').addEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_drawBtn, this)
getObject(this, 'index_rulebtn').addEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_ruleBtn, this)
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
unwatchPageVisibility(this.onPageVisibilityChange) unwatchPageVisibility(this.onPageVisibilityChange)
getObject(this, 'index_drawBtn').removeEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_drawBtn, this) getObject(this, 'index_drawBtn').removeEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_drawBtn, this)
getObject(this, 'index_rulebtn').removeEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_ruleBtn, this)
} }
get groupNames() { return ["index"] } get groupNames() { return ["index"] }
......
...@@ -5,6 +5,7 @@ import Group from "../common/Group"; ...@@ -5,6 +5,7 @@ import Group from "../common/Group";
import Marquee from "../common/Marquee"; import Marquee from "../common/Marquee";
import { hideShareMask } from "../common/ShareMask"; import { hideShareMask } from "../common/ShareMask";
import TestButton from "../common/TestButton"; import TestButton from "../common/TestButton";
import getObject from "../getObject";
import getQueryParams from "../getQueryParams"; import getQueryParams from "../getQueryParams";
import { PrizePanel } from "../panels/prize"; import { PrizePanel } from "../panels/prize";
import { RulePanel } from "../panels/rule"; import { RulePanel } from "../panels/rule";
...@@ -12,8 +13,6 @@ import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet"; ...@@ -12,8 +13,6 @@ import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet";
import { IndexScene } from "./IndexScene"; import { IndexScene } from "./IndexScene";
let prize; let prize;
export class NewbieScene extends Scene { export class NewbieScene extends Scene {
prizeBtn: FYGE.Sprite;
ruleBtn: FYGE.Sprite;
onPageVisibilityChange = async (visible) => { onPageVisibilityChange = async (visible) => {
if (getQueryParams().disablewatch == 1) { console.log('disable watch'); return; } if (getQueryParams().disablewatch == 1) { console.log('disable watch'); return; }
console.log('页面visible', visible); console.log('页面visible', visible);
...@@ -46,7 +45,7 @@ export class NewbieScene extends Scene { ...@@ -46,7 +45,7 @@ export class NewbieScene extends Scene {
} }
onClick_prizeBtn() { onClick_openBtn() {
this.openPrize() this.openPrize()
} }
...@@ -56,13 +55,6 @@ export class NewbieScene extends Scene { ...@@ -56,13 +55,6 @@ export class NewbieScene extends Scene {
initUi() { initUi() {
super.initUi(); super.initUi();
const group = new Group();
this.addChild(group)
this.prizeBtn = new TestButton('立即拆开');
group.add(this.prizeBtn);
this.ruleBtn = new TestButton('规则按钮');
group.add(this.ruleBtn);
sendWebNet(WebNetName.carouselInfo).then(res => { sendWebNet(WebNetName.carouselInfo).then(res => {
console.log('carouselInfo ', res); console.log('carouselInfo ', res);
...@@ -83,14 +75,15 @@ export class NewbieScene extends Scene { ...@@ -83,14 +75,15 @@ export class NewbieScene extends Scene {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
watchPageVisibility(this.onPageVisibilityChange); watchPageVisibility(this.onPageVisibilityChange);
this.prizeBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onClick_prizeBtn, this); getObject(this,'newbie_open').addEventListener(FYGE.MouseEvent.CLICK, this.onClick_openBtn, this);
this.ruleBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onClick_ruleBtn, this); getObject(this,'newbie_rule').addEventListener(FYGE.MouseEvent.CLICK, this.onClick_ruleBtn, this);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
unwatchPageVisibility(this.onPageVisibilityChange) unwatchPageVisibility(this.onPageVisibilityChange)
this.prizeBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_prizeBtn, this); getObject(this,'newbie_open').removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_openBtn, this);
this.ruleBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_ruleBtn, this); getObject(this,'newbie_rule').removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_ruleBtn, this);
} }
get groupNames() { return ["newbie"] } get groupNames() { return ["newbie"] }
......
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