Commit 71900eb4 authored by haiyoucuv's avatar haiyoucuv

礼盒loading引导

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