Commit 4fbaa156 authored by wildfirecode13's avatar wildfirecode13

update

parent 3cb67a0a
......@@ -840,15 +840,6 @@ export const SkinJson ={
"source": "index_drawBtn.png"
}
},
{
"name": "index_drawGrayBtn",
"x": 205,
"y": 693,
"type": "sprite",
"props": {
"source": "index_drawGrayBtn.png"
}
},
{
"name": "index_inviteBtn",
"x": 205,
......
......@@ -18,9 +18,9 @@ import updateShareFunc from '../share';
import { getPxTokenSave, getWebData, sendWebNet, WebNetName } from '../WebNet';
export class IndexScene extends Scene {
updateIndexUI({alreadyOpenAccount, experienceAmount:experienceAmount2, yesterdayIncome, sumIncome, sevenDayAnnualization, assistFriendNum, otherExperienceAmount, canWithdraw }) {
this['index_task2new'].visible=this['index_task1'].visible=!alreadyOpenAccount;
this['index_task2'].visible=alreadyOpenAccount;
updateIndexUI({ alreadyOpenAccount, experienceAmount: experienceAmount2, yesterdayIncome, sumIncome, sevenDayAnnualization, assistFriendNum, otherExperienceAmount, canWithdraw }) {
this['index_task2new'].visible = this['index_task1'].visible = !alreadyOpenAccount;
this['index_task2'].visible = alreadyOpenAccount;
const experienceAmount = getWebData(WebNetName.acquireOtherExperienceAmount).data;
getObject(this, 'index_experienceAmountTips').text = experienceAmount || "0";
......@@ -30,9 +30,6 @@ export class IndexScene extends Scene {
getObject(this, 'index_invitePercentTips').text = `${experienceAmount}/${MAX_MONEY}`;
getObject(this, 'index_inviteTips').text = `已有${assistFriendNum}位好友助力,体验金增加${otherExperienceAmount}元`;
getObject(this, 'index_drawGrayBtn').visible = !canWithdraw;
getObject(this, 'index_drawBtn').visible = canWithdraw;
const index_experienceAmountTips2 = getObject(this, 'index_experienceAmountTips2');
const index_experienceAmountTips = getObject(this, 'index_experienceAmountTips');
index_experienceAmountTips2.x = 375 + experienceAmount.toString().length * 18;
......@@ -57,21 +54,14 @@ export class IndexScene extends Scene {
showShareMask();
}
onclick_index_drawBtn() {
const { canWithdraw } = getWebData(WebNetName.myWallet).data;
if (canWithdraw) {
showWaiting();
getPxTokenSave().then(token => {
sendWebNet(WebNetName.withDraw, { token: token }).then(res => {
hideWaiting();
if (res.success)
showPanel(DrawPanel, res.data);
});
})
} else {
showToast('收益未满7天,不能提现哦~')
}
showWaiting();
getPxTokenSave().then(token => {
sendWebNet(WebNetName.withDraw, { token: token }).then(res => {
hideWaiting();
if (res.success)
showPanel(DrawPanel, res.data);
});
});
}
page: FYGE.ScrollPage;
......@@ -84,9 +74,6 @@ export class IndexScene extends Scene {
this.page.view.addChild(getObject(this, 'index_wrapper'));
getObject(this, 'index_drawGrayBtn').visible = false;
getObject(this, 'index_drawBtn').visible = false;
centerTextField(getObjects(this, [
'index_yesterdayIncomeTips',
'index_invitePercentTips',
......@@ -118,7 +105,7 @@ export class IndexScene extends Scene {
getPxTokenSave().then(token => {
sendWebNet(WebNetName.acquireOtherExperienceAmount, { token: token }).then(acquireOtherExperienceAmountRes => {
getPxTokenSave().then(token => {
sendWebNet(WebNetName.myWallet, { token: token }).then(myWalletResult => {
console.log('获取钱包信息');
......@@ -169,8 +156,8 @@ export class IndexScene extends Scene {
showPanel(RulePanel);
}
index_task1btn(){
location.href=KAIHU_URL;
index_task1btn() {
location.href = KAIHU_URL;
}
initEvents() {
......@@ -178,7 +165,6 @@ export class IndexScene extends Scene {
watchPageVisibility(this.onPageVisibilityChange);
getObject(this, 'index_task1btn').addEventListener(FYGE.MouseEvent.CLICK, this.index_task1btn, this)
getObject(this, 'index_drawBtn').addEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_drawBtn, this)
getObject(this, 'index_drawGrayBtn').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_inviteBtn').addEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_inviteBtn, this)
}
......@@ -189,7 +175,6 @@ export class IndexScene extends Scene {
getObject(this, 'index_task1btn').removeEventListener(FYGE.MouseEvent.CLICK, this.index_task1btn, this)
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_drawGrayBtn').removeEventListener(FYGE.MouseEvent.CLICK, this.onclick_index_drawBtn, 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