Commit c4bfd66a authored by wildfirecode13's avatar wildfirecode13

update

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