Commit e39c2fb3 authored by wildfirecode13's avatar wildfirecode13

update

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