Commit 5e928fba authored by wildfirecode13's avatar wildfirecode13

u

parent 841774fe
{ {
"code": "200010", "code": "200010",
"data": 1000, "data": 2000,
"message": "收益未满7天不能提现", "message": "收益未满7天不能提现",
"success": true "success": true
} }
\ No newline at end of file
export const MAX_MONEY=10*10000;
\ No newline at end of file
...@@ -10,7 +10,7 @@ export class DrawPanel extends Panel { ...@@ -10,7 +10,7 @@ export class DrawPanel extends Panel {
} }
//两个按钮都是关闭作用 //两个按钮都是关闭作用
get closeBtns() { get closeBtns() {
return [getObject(this, 'draw_closebtn'), getObject(this, 'draw_okbtn')]; return [getObject(this, 'draw_close'),getObject(this, 'draw_ok')];
} }
get groupNames() { return ["draw"] } get groupNames() { return ["draw"] }
...@@ -19,6 +19,6 @@ export class DrawPanel extends Panel { ...@@ -19,6 +19,6 @@ export class DrawPanel extends Panel {
async start(data) { async start(data) {
super.start(data); super.start(data);
getObject(this,'draw_tips').text = `成功获得奖励金${data}元\n奖励将于24小时内发放到您的账户`
} }
} }
\ No newline at end of file
...@@ -4,7 +4,8 @@ import PanelCtrl from '../../module/ctrls/panelCtrl'; ...@@ -4,7 +4,8 @@ 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 { ProgressBarS } from '../common/ProgressBarS';
import { hideShareMask } from '../common/ShareMask'; import { hideShareMask, showShareMask } from '../common/ShareMask';
import { MAX_MONEY } from '../datas';
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';
...@@ -16,24 +17,29 @@ import updateShare from '../updateShare'; ...@@ -16,24 +17,29 @@ 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 {
updateIndexUI({experienceAmount,yesterdayIncome,sumIncome,sevenDayAnnualization}) { updateIndexUI({experienceAmount,yesterdayIncome,sumIncome,sevenDayAnnualization,assistFriendNum,otherExperienceAmount}) {
getObject(this,'index_experienceAmountTips').text = experienceAmount; getObject(this,'index_experienceAmountTips').text = experienceAmount;
getObject(this,'index_sumIncomeTips').text = sumIncome || '0'; getObject(this,'index_sumIncomeTips').text = sumIncome || '0';
getObject(this,'index_sevenDayAnnualizationTips').text = sevenDayAnnualization; getObject(this,'index_sevenDayAnnualizationTips').text = sevenDayAnnualization;
getObject(this,'index_yesterdayIncomeTips').text = `昨日收益:${yesterdayIncome||'0'}元`; getObject(this,'index_yesterdayIncomeTips').text = `昨日收益:${yesterdayIncome||'0'}元`;
getObject(this,'index_invitePercentTips').text = `${experienceAmount}/1000000`;
getObject(this,'index_inviteTips').text = `已有${assistFriendNum}位好友助力,体验金增加${otherExperienceAmount}元`;
let percent = 0.05; let percent = 0.05;
if (experienceAmount / 1000000 > percent) { if (experienceAmount / MAX_MONEY > percent) {
percent = experienceAmount / 1000000; percent = experienceAmount / MAX_MONEY;
} }
const progressBar = new ProgressBarS(getObject(this, 'index_progress')); const progressBar = new ProgressBarS(getObject(this, 'index_progress'));
progressBar.value = percent; progressBar.value = percent;
} }
onclick_index_inviteBtn() {
showShareMask();
}
onclick_index_drawBtn() { 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,res.data);
}); });
}) })
} }
...@@ -125,11 +131,13 @@ export class IndexScene extends Scene { ...@@ -125,11 +131,13 @@ export class IndexScene extends Scene {
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) getObject(this, 'index_rulebtn').addEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_ruleBtn, this)
getObject(this, 'index_inviteBtn').addEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_inviteBtn, this)
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
unwatchPageVisibility(this.onPageVisibilityChange) unwatchPageVisibility(this.onPageVisibilityChange)
getObject(this, 'index_inviteBtn').removeEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_inviteBtn, this)
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) getObject(this, 'index_rulebtn').removeEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_ruleBtn, this)
} }
......
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