Commit c4bfd66a authored by wildfirecode13's avatar wildfirecode13

update

parent e39c2fb3
...@@ -41,7 +41,7 @@ export class PrizePanel extends Panel { ...@@ -41,7 +41,7 @@ export class PrizePanel extends Panel {
progressBar.value = percent; progressBar.value = percent;
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.createItem).then(createItemResult => { sendWebNet(WebNetName.createItem,{token:token}).then(createItemResult => {
updateShare('inPrizePanel', createItemResult.data) updateShare('inPrizePanel', createItemResult.data)
}); });
}) })
......
...@@ -14,32 +14,32 @@ import updateShare from '../updateShare'; ...@@ -14,32 +14,32 @@ 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(){ 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);
}); });
}) })
} }
page:FYGE.ScrollPage; page: FYGE.ScrollPage;
initUi() { initUi() {
super.initUi(); super.initUi();
const page = this.page = new FYGE.ScrollPage(750,getStageHeight(),1624,true,true); const page = this.page = new FYGE.ScrollPage(750, getStageHeight(), 1624, true, true);
this.addChild(page); this.addChild(page);
page.y = getStageOffset(); page.y = getStageOffset();
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_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, 'index_task1').visible = false;
// getObject(this.page,'task2new').visible=false; // getObject(this.page,'task2new').visible=false;
getObject(this.page,'index_task2').visible=false; getObject(this.page, 'index_task2').visible = false;
} }
async start(data) { async start(data) {
...@@ -63,33 +63,38 @@ export class IndexScene extends Scene { ...@@ -63,33 +63,38 @@ export class IndexScene extends Scene {
str = str.replace('{amount}', item.amount); str = str.replace('{amount}', item.amount);
return str return str
}); });
const q = getObject(this,'index_wrapper').addChild(new Marquee(datas)); const q = getObject(this, 'index_wrapper').addChild(new Marquee(datas));
q.x=135;q.y=191; q.x = 135; q.y = 191;
window['q'] = q; window['q'] = q;
}); });
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.createItem).then(createItemResult => { sendWebNet(WebNetName.myWallet, { token: token }).then(myWalletResult => {
updateShare('inIndexScene', createItemResult.data,) console.log('获取钱包信息');
getPxTokenSave().then(token => {
sendWebNet(WebNetName.createItem, { token: token }).then(createItemResult => {
updateShare('inIndexScene', createItemResult.data,)
});
})
}); });
}) })
} }
async showSharePanel() { async showSharePanel() {
getPxTokenSave().then(token=>{ getPxTokenSave().then(token => {
sendWebNet(WebNetName.myWallet,{token:token}).then(myWalletResult => { sendWebNet(WebNetName.myWallet, { token: token }).then(myWalletResult => {
if(myWalletResult.data.experienceAmount >= myWalletResult.data.maxExperienceAmount ){ if (myWalletResult.data.experienceAmount >= myWalletResult.data.maxExperienceAmount) {
showPanel(ShareFailPanel); showPanel(ShareFailPanel);
}else{ } else {
showPanel(ShareSuccessPanel); showPanel(ShareSuccessPanel);
} }
}); });
}) })
} }
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);
if (!visible) return; if (!visible) return;
const current = PanelCtrl.instance.current; const current = PanelCtrl.instance.current;
...@@ -104,13 +109,13 @@ export class IndexScene extends Scene { ...@@ -104,13 +109,13 @@ export class IndexScene extends Scene {
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)
} }
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)
} }
get groupNames() { return ["index"] } get groupNames() { return ["index"] }
......
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