Commit 8e7bf13f authored by wildfirecode13's avatar wildfirecode13

update

parent 5c8e1ed0
...@@ -10,7 +10,7 @@ import getObject from "../getObject"; ...@@ -10,7 +10,7 @@ import getObject from "../getObject";
import { IndexScene } from "../scenes/IndexScene"; import { IndexScene } from "../scenes/IndexScene";
import { Tools } from "../Tools"; import { Tools } from "../Tools";
import updateShare from "../updateShare"; import updateShare from "../updateShare";
import { getWebData, sendWebNet, WebNetName } from "../WebNet"; import { getPxTokenSave, getWebData, sendWebNet, WebNetName } from "../WebNet";
let createItemResultComplete, myWalletResultComplete; let createItemResultComplete, myWalletResultComplete;
const checkUpdateShare = () => { const checkUpdateShare = () => {
...@@ -42,27 +42,31 @@ export class PrizePanel extends Panel { ...@@ -42,27 +42,31 @@ export class PrizePanel extends Panel {
const w = prize_tips1.textWidth + prize_tips2.textWidth; const w = prize_tips1.textWidth + prize_tips2.textWidth;
prize_tips2.x = (595 - w) / 2; prize_tips2.x = (595 - w) / 2;
prize_tips1.x = prize_tips2.x + prize_tips2.textWidth; prize_tips1.x = prize_tips2.x + prize_tips2.textWidth;
prize_tip3.textWidth=595; prize_tip3.textWidth = 595;
prize_tip3.x=0; prize_tip3.x = 0;
prize_tip3.textAlign='center'; prize_tip3.textAlign = 'center';
prize_tip3.text=`${data}/1000000`; prize_tip3.text = `${data}/1000000`;
let percent = 0.05; let percent = 0.05;
if(data/1000000 > percent) { if (data / 1000000 > percent) {
percent = data/1000000; percent = data / 1000000;
} }
const progressBar = new ProgressBarS(getObject(this,'prize_progress')); const progressBar = new ProgressBarS(getObject(this, 'prize_progress'));
progressBar.value=percent; progressBar.value = percent;
sendWebNet(WebNetName.createItem).then(createItemResult => { getPxTokenSave().then(token => {
createItemResultComplete = createItemResult; sendWebNet(WebNetName.createItem).then(createItemResult => {
checkUpdateShare(); createItemResultComplete = createItemResult;
}); checkUpdateShare();
});
sendWebNet(WebNetName.myWallet).then(myWalletResult => { })
myWalletResultComplete = myWalletResult;
checkUpdateShare(); getPxTokenSave().then(token => {
}); sendWebNet(WebNetName.myWallet, { token: token }).then(myWalletResult => {
myWalletResultComplete = myWalletResult;
checkUpdateShare();
});
})
getObject(this, 'prize_close').addEventListener(FYGE.MouseEvent.CLICK, () => { getObject(this, 'prize_close').addEventListener(FYGE.MouseEvent.CLICK, () => {
......
...@@ -11,7 +11,7 @@ import { ShareFailPanel } from '../panels/share_fail'; ...@@ -11,7 +11,7 @@ import { ShareFailPanel } from '../panels/share_fail';
import { ShareSuccessPanel } from '../panels/share_success'; import { ShareSuccessPanel } from '../panels/share_success';
import { getStageHeight, getStageOffset } from '../stage'; import { getStageHeight, getStageOffset } from '../stage';
import updateShare from '../updateShare'; import updateShare from '../updateShare';
import { sendWebNet, WebNetName } from '../WebNet'; import { getPxTokenSave, sendWebNet, WebNetName } from '../WebNet';
let createItemResultComplete, myWalletResultComplete; let createItemResultComplete, myWalletResultComplete;
const checkUpdateShare = () => { const checkUpdateShare = () => {
...@@ -26,9 +26,11 @@ export class IndexScene extends Scene { ...@@ -26,9 +26,11 @@ export class IndexScene extends Scene {
onclick_index_drawBtn(){ onclick_index_drawBtn(){
sendWebNet(WebNetName.withDraw).then(res=>{ getPxTokenSave().then(token=>{
showPanel(DrawPanel); sendWebNet(WebNetName.withDraw,{token:token}).then(res=>{
}); showPanel(DrawPanel);
});
})
} }
page:FYGE.ScrollPage; page:FYGE.ScrollPage;
...@@ -77,26 +79,35 @@ export class IndexScene extends Scene { ...@@ -77,26 +79,35 @@ export class IndexScene extends Scene {
}); });
sendWebNet(WebNetName.createItem).then(createItemResult => { getPxTokenSave().then(token => {
createItemResultComplete = createItemResult; sendWebNet(WebNetName.createItem).then(createItemResult => {
checkUpdateShare(); createItemResultComplete = createItemResult;
}); checkUpdateShare();
});
})
sendWebNet(WebNetName.myWallet).then(myWalletResult => { getPxTokenSave().then(token=>{
myWalletResultComplete = myWalletResult; sendWebNet(WebNetName.myWallet,{token:token}).then(myWalletResult => {
checkUpdateShare(); myWalletResultComplete = myWalletResult;
}); checkUpdateShare();
});
})
} }
async showSharePanel() { async showSharePanel() {
sendWebNet(WebNetName.myWallet).then(myWalletResult => { getPxTokenSave().then(token=>{
if(myWalletResult.data.experienceAmount >= myWalletResult.data.maxExperienceAmount ){ sendWebNet(WebNetName.myWallet,{token:token}).then(myWalletResult => {
showPanel(ShareFailPanel); if(myWalletResult.data.experienceAmount >= myWalletResult.data.maxExperienceAmount ){
}else{ showPanel(ShareFailPanel);
showPanel(ShareSuccessPanel); }else{
} showPanel(ShareSuccessPanel);
}); }
});
})
} }
onPageVisibilityChange = async (visible) => { onPageVisibilityChange = async (visible) => {
......
...@@ -8,7 +8,7 @@ import TestButton from "../common/TestButton"; ...@@ -8,7 +8,7 @@ import TestButton from "../common/TestButton";
import getQueryParams from "../getQueryParams"; import getQueryParams from "../getQueryParams";
import { PrizePanel } from "../panels/prize"; import { PrizePanel } from "../panels/prize";
import { RulePanel } from "../panels/rule"; import { RulePanel } from "../panels/rule";
import { sendWebNet, WebNetName } from "../WebNet"; import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet";
import { IndexScene } from "./IndexScene"; import { IndexScene } from "./IndexScene";
let prize; let prize;
export class NewbieScene extends Scene { export class NewbieScene extends Scene {
...@@ -38,9 +38,12 @@ export class NewbieScene extends Scene { ...@@ -38,9 +38,12 @@ export class NewbieScene extends Scene {
openPrize() { openPrize() {
prize = 1; prize = 1;
sendWebNet(WebNetName.acquireExperienceAmount).then(acquireExperienceAmount => { getPxTokenSave().then(token=>{
showPanel(PrizePanel, acquireExperienceAmount.data); sendWebNet(WebNetName.acquireExperienceAmount,{token:token}).then(acquireExperienceAmount => {
}) showPanel(PrizePanel, acquireExperienceAmount.data);
})
})
} }
onClick_prizeBtn() { onClick_prizeBtn() {
......
...@@ -4,14 +4,17 @@ import Marquee from "../common/Marquee"; ...@@ -4,14 +4,17 @@ import Marquee from "../common/Marquee";
import getObject from "../getObject"; import getObject from "../getObject";
import getQueryParams from "../getQueryParams"; import getQueryParams from "../getQueryParams";
import { AssistPanel } from "../panels/assist"; import { AssistPanel } from "../panels/assist";
import { sendWebNet, WebNetName } from "../WebNet"; import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet";
export class ShareScene extends Scene { export class ShareScene extends Scene {
onClick_share_assist(){ onClick_share_assist(){
const query = getQueryParams(); const query = getQueryParams();
sendWebNet(WebNetName.assist,{code:query.shareCode}).then(res=>{ getPxTokenSave().then(token=>{
showPanel(AssistPanel) sendWebNet(WebNetName.assist,{code:query.shareCode}).then(res=>{
showPanel(AssistPanel)
})
}) })
} }
get groupNames() { return ["share"] } get groupNames() { return ["share"] }
get skinName() { return "share" } get skinName() { return "share" }
...@@ -25,7 +28,10 @@ export class ShareScene extends Scene { ...@@ -25,7 +28,10 @@ export class ShareScene extends Scene {
super.start(); super.start();
console.log('ShareScene query>>',JSON.stringify(data.query)); console.log('ShareScene query>>',JSON.stringify(data.query));
sendWebNet(WebNetName.shareInfo,{code:getQueryParams().shareCode}).then(res => {}); getPxTokenSave().then(token=>{
sendWebNet(WebNetName.shareInfo,{code:getQueryParams().shareCode,token:token}).then(res => {});
})
sendWebNet(WebNetName.carouselInfo).then(res => { sendWebNet(WebNetName.carouselInfo).then(res => {
console.log('carouselInfo ', res); console.log('carouselInfo ', res);
......
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