Commit babc1208 authored by 王炽's avatar 王炽

6666666

parent f61c976d
{
"type": "activity",
"name": "feedingFrenzy1.0"
"name": "dayuchixiaoyu_haixin"
}
\ No newline at end of file
......@@ -53,23 +53,8 @@ class Main extends MainBase {
console.log(GameConst.stage.width,GameConst.stage.height)
}, 100);
NetManager.ins.getInfo(()=>{
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 {
} else {
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 {
// 开始
start(data) {
const lottery = DataManager.ins.gameGetSubmitResultData.lottery;
this.data = lottery;
// const lottery = DataManager.ins.gameGetSubmitResultData.lottery;
// this.data = lottery;
// 分数文案
if(this.scoreTxt){
......@@ -32,33 +32,34 @@ export default class PrizePanel extends Panel {
// 最高分文案
if(this.maxScoreTxt){
if(DataManager.ins.getInfoData && DataManager.ins.getInfoData.maxScore){
if(Number(DataManager.ins.getInfoData.maxScore) < data.score){
this.maxScoreTxt.text = `我的最高分:${data.score}分`;;
}else{
this.maxScoreTxt.text = `我的最高分:${DataManager.ins.getInfoData.maxScore}分`;
}
}else{
// if(DataManager.ins.getInfoData && DataManager.ins.getInfoData.maxScore){
// if(Number(DataManager.ins.getInfoData.maxScore) < data.score){
// this.maxScoreTxt.text = `我的最高分:${data.score}分`;;
// }else{
// this.maxScoreTxt.text = `我的最高分:${DataManager.ins.getInfoData.maxScore}分`;
// }
// }else{
// this.maxScoreTxt.visible = false;
// }
this.maxScoreTxt.visible = false;
}
}
const sizeType = getOptionImgSize(lottery);
if (ImgSizeType.BIG === sizeType) {
this.img.width = this.picBigWidth;
this.img.height = this.picBigWidth / this.bigPicRatio;
} else {
this.img.width = this.img.height = this.picWidth;
}
this.img.y = 480;
this.prizeName.y = 480 + 15 + this.img.height;
// const sizeType = getOptionImgSize(lottery);
// if (ImgSizeType.BIG === sizeType) {
// this.img.width = this.picBigWidth;
// this.img.height = this.picBigWidth / this.bigPicRatio;
// } else {
// this.img.width = this.img.height = this.picWidth;
// }
// this.img.y = 480;
// this.prizeName.y = 480 + 15 + this.img.height;
showLog(lottery);
// showLog(lottery);
if(lottery.type == 'collectGoods'){
this.useBtn.visible = false;
}
// if(lottery.type == 'collectGoods'){
// this.useBtn.visible = false;
// }
}
get picWidth() { return 240 };
......@@ -68,32 +69,35 @@ export default class PrizePanel extends Panel {
initEvents() {
super.initEvents();
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)
}
private onTap_CloseBtn(e:egret.TouchEvent){
this.hidePanel();
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
}
onUse() {
const lottery = DataManager.ins.gameGetSubmitResultData.lottery;
if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) {
window["downloadAppConfig"] =
{
openUrl: lottery.openUrl,
iosDownloadUrl: lottery.iosDownloadUrl,
androidDownloadUrl: lottery.androidDownloadUrl,
confirm: lottery.confirm ? lottery.confirm : false
};
window["downloadApp"]();
if (lottery.type == "lucky") {
NetManager.ins.spmclick(DataManager.ins.gameGetSubmitResultData.exposure);
}
}
else {
window.location.href = lottery.link;
}
this.hidePanel();
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
// const lottery = DataManager.ins.gameGetSubmitResultData.lottery;
// if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) {
// window["downloadAppConfig"] =
// {
// openUrl: lottery.openUrl,
// iosDownloadUrl: lottery.iosDownloadUrl,
// androidDownloadUrl: lottery.androidDownloadUrl,
// confirm: lottery.confirm ? lottery.confirm : false
// };
// window["downloadApp"]();
// if (lottery.type == "lucky") {
// NetManager.ins.spmclick(DataManager.ins.gameGetSubmitResultData.exposure);
// }
// }
// else {
// window.location.href = lottery.link;
// }
}
......
......@@ -128,26 +128,30 @@ export default class ExStartScene extends StartScene {
updateCostTxt() {
// 更新开始按钮的字
let txt: string;
if (DataManager.ins.getInfoData.status.code != 0) {
txt = DataManager.ins.getInfoData.status.btnText;
} else {
txt = DataManager.ins.getInfoData.status.text;
}
this.startBtn['gameInfoTxt'].text = txt;
// let txt: string;
// if (DataManager.ins.getInfoData.status.code != 0) {
// txt = DataManager.ins.getInfoData.status.btnText;
// } else {
// txt = DataManager.ins.getInfoData.status.text;
// }
// this.startBtn['gameInfoTxt'].text = txt;
this.startBtn['gameInfoTxt'].visible = false;
}
updateMyCredits() {
if (DataManager.ins.getCreditsData && DataManager.ins.getCreditsData.unitName) {
this.myCreditsTxt.text = `我的${DataManager.ins.getCreditsData.unitName}:${DataManager.ins.getInfoData.credits}`;
} else {
NetManager.ins.getCredits(() => {
// console.log(data)
this.myCreditsTxt.text = `我的${DataManager.ins.getCreditsData.unitName}:${DataManager.ins.getInfoData.credits}`;
})
}
// if (DataManager.ins.getCreditsData && DataManager.ins.getCreditsData.unitName) {
// this.myCreditsTxt.text = `我的${DataManager.ins.getCreditsData.unitName}:${DataManager.ins.getInfoData.credits}`;
// } else {
// NetManager.ins.getCredits(() => {
// // console.log(data)
// this.myCreditsTxt.text = `我的${DataManager.ins.getCreditsData.unitName}:${DataManager.ins.getInfoData.credits}`;
// })
// }
// this.myCreditsTxt.text = `我的积分:${DataManager.ins.getInfoData.credits}`;
this.myCreditsTxt.visible = false;
}
isIOS() {
......
......@@ -26,6 +26,29 @@ export default class StartScene extends Scene {
* @param data 从上个panel或者Scene传入的数据
*/
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();
}
......@@ -33,8 +56,6 @@ export default class StartScene extends Scene {
* 初始化UI
*/
protected initUI() {
this.percentWidth = 100;
this.percentHeight = 100;
}
/**
......@@ -135,31 +156,10 @@ export default class StartScene extends Scene {
*/
protected onTap_startBtn(e: egret.Event){
this.startBtn.touchEnabled = false;
if(window['requirelogin']) {
window['requirelogin']();
return;
}
if(DataManager.ins.getInfoData.status.code == 3){
// 参与次数已用完
let data = {msg:`今日次数已用完\n明日再来吧~`, type:'err'}
PanelCtrl.instance.show(ModuleTypes.MSG_PANEL, data);
setTimeout(() => {
this.startBtn.touchEnabled = true;
return;
}else if(DataManager.ins.getInfoData.status.code == 2){
// 积分不足
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)
}
}, 500);
SceneCtrl.instance.change(ModuleTypes.PLAY_SCENE);
}
/**
......
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