Commit babc1208 authored by 王炽's avatar 王炽

6666666

parent f61c976d
{ {
"type": "activity", "type": "activity",
"name": "feedingFrenzy1.0" "name": "dayuchixiaoyu_haixin"
} }
\ No newline at end of file
...@@ -53,22 +53,7 @@ class Main extends MainBase { ...@@ -53,22 +53,7 @@ class Main extends MainBase {
console.log(GameConst.stage.width,GameConst.stage.height) console.log(GameConst.stage.width,GameConst.stage.height)
}, 100); }, 100);
NetManager.ins.getInfo(()=>{ SceneCtrl.instance.change(ModuleTypes.START_SCENE);
if (DataManager.ins.getInfoData.status.code == 5) {
// 活动结束已开奖
NetManager.ins.winRanks(() => {
SceneCtrl.instance.change(ModuleTypes.GAMEEND_SCENE);
});
} else {
if (DataManager.ins.getInfoData.status.code == 4) {
// 活动结束未开奖
SceneCtrl.instance.change(ModuleTypes.GAMEENDWAITING_SCENE);
} else {
// 创建开始场景
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
}
}
});
} }
......
...@@ -520,7 +520,8 @@ export default class PlayScene extends Scene { ...@@ -520,7 +520,8 @@ export default class PlayScene extends Scene {
} else { } else {
GCache.writeCache(`maxLevel`, this.currLevel); GCache.writeCache(`maxLevel`, this.currLevel);
} }
this.gameSubmit(this.gameSubmitResult, this.currLevel); PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL, { score: this.currLevel });
// this.gameSubmit(this.gameSubmitResult, this.currLevel);
} }
// 提交成绩的回调 // 提交成绩的回调
......
...@@ -22,8 +22,8 @@ export default class PrizePanel extends Panel { ...@@ -22,8 +22,8 @@ export default class PrizePanel extends Panel {
// 开始 // 开始
start(data) { start(data) {
const lottery = DataManager.ins.gameGetSubmitResultData.lottery; // const lottery = DataManager.ins.gameGetSubmitResultData.lottery;
this.data = lottery; // this.data = lottery;
// 分数文案 // 分数文案
if(this.scoreTxt){ if(this.scoreTxt){
...@@ -32,33 +32,34 @@ export default class PrizePanel extends Panel { ...@@ -32,33 +32,34 @@ export default class PrizePanel extends Panel {
// 最高分文案 // 最高分文案
if(this.maxScoreTxt){ if(this.maxScoreTxt){
if(DataManager.ins.getInfoData && DataManager.ins.getInfoData.maxScore){ // if(DataManager.ins.getInfoData && DataManager.ins.getInfoData.maxScore){
if(Number(DataManager.ins.getInfoData.maxScore) < data.score){ // if(Number(DataManager.ins.getInfoData.maxScore) < data.score){
this.maxScoreTxt.text = `我的最高分:${data.score}分`;; // this.maxScoreTxt.text = `我的最高分:${data.score}分`;;
}else{ // }else{
this.maxScoreTxt.text = `我的最高分:${DataManager.ins.getInfoData.maxScore}分`; // this.maxScoreTxt.text = `我的最高分:${DataManager.ins.getInfoData.maxScore}分`;
} // }
}else{ // }else{
this.maxScoreTxt.visible = false; // this.maxScoreTxt.visible = false;
} // }
this.maxScoreTxt.visible = false;
} }
const sizeType = getOptionImgSize(lottery); // const sizeType = getOptionImgSize(lottery);
if (ImgSizeType.BIG === sizeType) { // if (ImgSizeType.BIG === sizeType) {
this.img.width = this.picBigWidth; // this.img.width = this.picBigWidth;
this.img.height = this.picBigWidth / this.bigPicRatio; // this.img.height = this.picBigWidth / this.bigPicRatio;
} else { // } else {
this.img.width = this.img.height = this.picWidth; // this.img.width = this.img.height = this.picWidth;
} // }
this.img.y = 480; // this.img.y = 480;
this.prizeName.y = 480 + 15 + this.img.height; // this.prizeName.y = 480 + 15 + this.img.height;
showLog(lottery); // showLog(lottery);
if(lottery.type == 'collectGoods'){ // if(lottery.type == 'collectGoods'){
this.useBtn.visible = false; // this.useBtn.visible = false;
} // }
} }
get picWidth() { return 240 }; get picWidth() { return 240 };
...@@ -68,32 +69,35 @@ export default class PrizePanel extends Panel { ...@@ -68,32 +69,35 @@ export default class PrizePanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.useBtn.once(egret.TouchEvent.TOUCH_TAP, this.onUse, this); this.useBtn.once(egret.TouchEvent.TOUCH_TAP, this.onUse, this);
this.img.once(egret.TouchEvent.TOUCH_TAP, this.onUse, this); // this.img.once(egret.TouchEvent.TOUCH_TAP, this.onUse, this);
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_CloseBtn, this) this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_CloseBtn, this)
} }
private onTap_CloseBtn(e:egret.TouchEvent){ private onTap_CloseBtn(e:egret.TouchEvent){
this.hidePanel();
SceneCtrl.instance.change(ModuleTypes.START_SCENE); SceneCtrl.instance.change(ModuleTypes.START_SCENE);
} }
onUse() { onUse() {
const lottery = DataManager.ins.gameGetSubmitResultData.lottery; this.hidePanel();
if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) { SceneCtrl.instance.change(ModuleTypes.START_SCENE);
window["downloadAppConfig"] = // const lottery = DataManager.ins.gameGetSubmitResultData.lottery;
{ // if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) {
openUrl: lottery.openUrl, // window["downloadAppConfig"] =
iosDownloadUrl: lottery.iosDownloadUrl, // {
androidDownloadUrl: lottery.androidDownloadUrl, // openUrl: lottery.openUrl,
confirm: lottery.confirm ? lottery.confirm : false // iosDownloadUrl: lottery.iosDownloadUrl,
}; // androidDownloadUrl: lottery.androidDownloadUrl,
window["downloadApp"](); // confirm: lottery.confirm ? lottery.confirm : false
if (lottery.type == "lucky") { // };
NetManager.ins.spmclick(DataManager.ins.gameGetSubmitResultData.exposure); // window["downloadApp"]();
} // if (lottery.type == "lucky") {
} // NetManager.ins.spmclick(DataManager.ins.gameGetSubmitResultData.exposure);
else { // }
window.location.href = lottery.link; // }
} // else {
// window.location.href = lottery.link;
// }
} }
......
...@@ -128,26 +128,30 @@ export default class ExStartScene extends StartScene { ...@@ -128,26 +128,30 @@ export default class ExStartScene extends StartScene {
updateCostTxt() { updateCostTxt() {
// 更新开始按钮的字 // 更新开始按钮的字
let txt: string; // let txt: string;
if (DataManager.ins.getInfoData.status.code != 0) { // if (DataManager.ins.getInfoData.status.code != 0) {
txt = DataManager.ins.getInfoData.status.btnText; // txt = DataManager.ins.getInfoData.status.btnText;
} else { // } else {
txt = DataManager.ins.getInfoData.status.text; // txt = DataManager.ins.getInfoData.status.text;
} // }
this.startBtn['gameInfoTxt'].text = txt; // this.startBtn['gameInfoTxt'].text = txt;
this.startBtn['gameInfoTxt'].visible = false;
} }
updateMyCredits() { updateMyCredits() {
if (DataManager.ins.getCreditsData && DataManager.ins.getCreditsData.unitName) { // if (DataManager.ins.getCreditsData && DataManager.ins.getCreditsData.unitName) {
this.myCreditsTxt.text = `我的${DataManager.ins.getCreditsData.unitName}:${DataManager.ins.getInfoData.credits}`; // this.myCreditsTxt.text = `我的${DataManager.ins.getCreditsData.unitName}:${DataManager.ins.getInfoData.credits}`;
} else { // } else {
NetManager.ins.getCredits(() => { // NetManager.ins.getCredits(() => {
// console.log(data) // // console.log(data)
this.myCreditsTxt.text = `我的${DataManager.ins.getCreditsData.unitName}:${DataManager.ins.getInfoData.credits}`; // this.myCreditsTxt.text = `我的${DataManager.ins.getCreditsData.unitName}:${DataManager.ins.getInfoData.credits}`;
}) // })
} // }
// this.myCreditsTxt.text = `我的积分:${DataManager.ins.getInfoData.credits}`; // this.myCreditsTxt.text = `我的积分:${DataManager.ins.getInfoData.credits}`;
this.myCreditsTxt.visible = false;
} }
isIOS() { isIOS() {
......
...@@ -26,6 +26,29 @@ export default class StartScene extends Scene { ...@@ -26,6 +26,29 @@ export default class StartScene extends Scene {
* @param data 从上个panel或者Scene传入的数据 * @param data 从上个panel或者Scene传入的数据
*/ */
async start(data?) { async start(data?) {
this.percentWidth = 100;
this.percentHeight = 100;
}
protected onSkinComplete(): void {
super.onSkinComplete();
// setTimeout(() => {
// let scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
// window.scrollTo(0, Math.max(scrollHeight - 1, 0));
// }, 100);
// this.mainbg.texture = this.bgtexture;
this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
if (this.stage) {
this.onLoad();
}
}
private onLoad():void{
this.recordBtn.visible = false;
this.optionBtn.visible = false;
this.initUI(); this.initUI();
} }
...@@ -33,8 +56,6 @@ export default class StartScene extends Scene { ...@@ -33,8 +56,6 @@ export default class StartScene extends Scene {
* 初始化UI * 初始化UI
*/ */
protected initUI() { protected initUI() {
this.percentWidth = 100;
this.percentHeight = 100;
} }
/** /**
...@@ -135,31 +156,10 @@ export default class StartScene extends Scene { ...@@ -135,31 +156,10 @@ export default class StartScene extends Scene {
*/ */
protected onTap_startBtn(e: egret.Event){ protected onTap_startBtn(e: egret.Event){
this.startBtn.touchEnabled = false; this.startBtn.touchEnabled = false;
if(window['requirelogin']) { setTimeout(() => {
window['requirelogin']();
return;
}
if(DataManager.ins.getInfoData.status.code == 3){
// 参与次数已用完
let data = {msg:`今日次数已用完\n明日再来吧~`, type:'err'}
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, data);
this.startBtn.touchEnabled = true; this.startBtn.touchEnabled = true;
return; }, 500);
}else if(DataManager.ins.getInfoData.status.code == 2){ SceneCtrl.instance.change(ModuleTypes.PLAY_SCENE);
// 积分不足
let data = {msg:`积分不足\n去赚积分吧`, type:'creditsOut'}
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, data);
this.startBtn.touchEnabled = true;
return;
}else if(DataManager.ins.getInfoData.status.code == 1){
// 未登录
let data = {msg:`未登录账号\n请先登录`, type:'requirelogin'}
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, data);
this.startBtn.touchEnabled = true;
return;
}else{
this.doStart(this.doStartResult.bind(this),false)
}
} }
/** /**
......
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