Commit 71900eb4 authored by haiyoucuv's avatar haiyoucuv

礼盒loading引导

parent 3b0dd171
This diff is collapsed.
......@@ -23850,8 +23850,10 @@ var PlayScene = (function (_super) {
level: this.chapter,
prizeDataType: 1
}, function (success, res) {
if (success && res.data)
if (success && res.data) {
_this.redBombPanelMark = true;
_this.openRedBombPanel();
}
});
}
}
This diff is collapsed.
......@@ -287,6 +287,11 @@ export function destroyNetData() {
async function fetchAsync(url: string) {
// await response of fetch call
// await new Promise(resolve => {
// setTimeout(()=>{
// resolve();
// }, 500);
// });
let response = await fetch(url);
// only proceed once promise is resolved
let data = await response.json();
......
......@@ -2721,7 +2721,21 @@ export class PlayScene extends Scene {
*/
openRedBombPanel(callback: Function = null) {
if (this.redBombPanelMark) {
showPanel(FesRedPrizePanel, {callback: callback});
sendTbNet(TbNetName.drawLotteryPrize, {
level: this.chapter,
prizeDataType: 1
},
(success, res) => {
if (success && res.data) {
showPanel(FesRedPrizePanel, {callback: callback});
} else {
callback();
}
}
);
// showPanel(FesRedPrizePanel, {callback: callback});
this.redBombPanelMark = false;
return true;
}
......@@ -2919,19 +2933,26 @@ export class PlayScene extends Scene {
.call(() => {
this.removeChild(eleC);
this.festivalTarget.count--;
});
//完成了,发接口,到时需要修改,对于接口没成功的不设置
if (this.festivalTargetNum <= 0) {
sendTbNet(TbNetName.drawLotteryPrize, {
level: this.chapter,
prizeDataType: 1
},
(success, res) => {
if (success && res.data) this.redBombPanelMark = true;
}
);
this.redBombPanelMark = true;
// sendTbNet(TbNetName.drawLotteryPrize, {
// level: this.chapter,
// prizeDataType: 1
// },
// (success, res) => {
// if (success && res.data) {
// this.redBombPanelMark = true;
// this.openRedBombPanel();
// }
// }
// );
}
}
}
......
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