Commit 841774fe authored by wildfirecode13's avatar wildfirecode13

u

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