Commit e39c2fb3 authored by wildfirecode13's avatar wildfirecode13

update

parent 8e7bf13f
......@@ -3,7 +3,6 @@
"message": "",
"code": "",
"data": {
"shareCode":"d8kadf2",
"isNewbie":1,
"amount":1000
}
......
......@@ -78,7 +78,7 @@ export class Main {
const alreadyAcquiredResult = await sendWebNet(WebNetName.alreadyAcquired)
if (!alreadyAcquiredResult.data) {
updateShare('inNewbieScene', '', 0, 0);
updateShare('inNewbieScene', '');
changeScene(NewbieScene);
}
else {
......
......@@ -820,5 +820,5 @@ export const ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1628218126/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/template/1628230044/resource/"
}
\ No newline at end of file
import { changeScene } from "../../module/ctrls";
import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel";
import Group from "../common/Group";
import { ProgressBarS } from "../common/ProgressBarS";
import { showShareMask } from "../common/ShareMask";
import TestButton from "../common/TestButton";
import TestLabel from "../common/TestLabel";
import getObject from "../getObject";
import { IndexScene } from "../scenes/IndexScene";
import { Tools } from "../Tools";
import updateShare from "../updateShare";
import { getPxTokenSave, getWebData, sendWebNet, WebNetName } from "../WebNet";
let createItemResultComplete, myWalletResultComplete;
const checkUpdateShare = () => {
if (createItemResultComplete && myWalletResultComplete) {
updateShare('inPrizePanel',
createItemResultComplete.data,
myWalletResultComplete.data.sumIncome, myWalletResultComplete.data.experienceAmount)
}
}
import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet";
export class PrizePanel extends Panel {
amountTxt: FYGE.TextField;
percentTxt: FYGE.TextField;
......@@ -56,15 +42,7 @@ export class PrizePanel extends Panel {
getPxTokenSave().then(token => {
sendWebNet(WebNetName.createItem).then(createItemResult => {
createItemResultComplete = createItemResult;
checkUpdateShare();
});
})
getPxTokenSave().then(token => {
sendWebNet(WebNetName.myWallet, { token: token }).then(myWalletResult => {
myWalletResultComplete = myWalletResult;
checkUpdateShare();
updateShare('inPrizePanel', createItemResult.data)
});
})
......
......@@ -12,16 +12,6 @@ import { ShareSuccessPanel } from '../panels/share_success';
import { getStageHeight, getStageOffset } from '../stage';
import updateShare from '../updateShare';
import { getPxTokenSave, sendWebNet, WebNetName } from '../WebNet';
let createItemResultComplete, myWalletResultComplete;
const checkUpdateShare = () => {
if (createItemResultComplete && myWalletResultComplete) {
updateShare('inIndexScene',
createItemResultComplete.data,
myWalletResultComplete.data.sumIncome, myWalletResultComplete.data.experienceAmount)
}
}
export class IndexScene extends Scene {
onclick_index_drawBtn(){
......@@ -81,21 +71,9 @@ export class IndexScene extends Scene {
getPxTokenSave().then(token => {
sendWebNet(WebNetName.createItem).then(createItemResult => {
createItemResultComplete = createItemResult;
checkUpdateShare();
updateShare('inIndexScene', createItemResult.data,)
});
})
getPxTokenSave().then(token=>{
sendWebNet(WebNetName.myWallet,{token:token}).then(myWalletResult => {
myWalletResultComplete = myWalletResult;
checkUpdateShare();
});
})
}
async showSharePanel() {
......
......@@ -10,7 +10,7 @@ export class ShareScene extends Scene {
onClick_share_assist(){
const query = getQueryParams();
getPxTokenSave().then(token=>{
sendWebNet(WebNetName.assist,{code:query.shareCode}).then(res=>{
sendWebNet(WebNetName.assist,{code:query.code}).then(res=>{
showPanel(AssistPanel)
})
})
......@@ -29,7 +29,7 @@ export class ShareScene extends Scene {
console.log('ShareScene query>>',JSON.stringify(data.query));
getPxTokenSave().then(token=>{
sendWebNet(WebNetName.shareInfo,{code:getQueryParams().shareCode,token:token}).then(res => {});
sendWebNet(WebNetName.shareInfo,{code:getQueryParams().code,token:token}).then(res => {});
})
......
const updateShare = (type, shareCode, sumIncome, experienceAmount) => {
console.log('updateShare', 'type=', type, 'shareCode=', shareCode, 'sumIncome=', sumIncome, 'experienceAmount=', experienceAmount)
const updateShare = (type, code) => {
console.log('updateShare', 'type=', type, 'code=', code)
}
export default updateShare
\ No newline at end of file
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