Commit 8e7bf13f authored by wildfirecode13's avatar wildfirecode13

update

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