Commit 814d3f13 authored by 邱旭's avatar 邱旭

Merge branch 'dev' of http://gitlab2.dui88.com/wanghongyuan/xiaoxiaole into dev

parents 596aab10 20af0cbc
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
<script src="libs/pad-zeropadding.js"></script> <script src="libs/pad-zeropadding.js"></script>
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" /> <img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" />
<script> <script>
// localStorage.clear();
window['isInvitePage']=0; window['isInvitePage']=0;
var targetUrl='https://gameact.suning.com/sngame-web/api/duiba/private/v1/getLoginUrl.do?appCode=duiba&activityCode=3651404'; var targetUrl='https://gameact.suning.com/sngame-web/api/duiba/private/v1/getLoginUrl.do?appCode=duiba&activityCode=3651404';
/* /*
......
...@@ -10,6 +10,7 @@ import getShowOffPic from "../../../src/getShowOffPic"; ...@@ -10,6 +10,7 @@ import getShowOffPic from "../../../src/getShowOffPic";
import { showShare } from "../../../src/shareCtrl"; import { showShare } from "../../../src/shareCtrl";
import { iswx } from "../../../src/iswx"; import { iswx } from "../../../src/iswx";
import wait from "../../new_tc/wait"; import wait from "../../new_tc/wait";
import { addAdComp } from "../../../src/panels/BoxPanel";
export default class NoPrizePanel extends Panel { export default class NoPrizePanel extends Panel {
_level; _level;
start(data) { start(data) {
...@@ -39,6 +40,7 @@ export default class NoPrizePanel extends Panel { ...@@ -39,6 +40,7 @@ export default class NoPrizePanel extends Panel {
changeMapScene(); changeMapScene();
}, this); }, this);
addAdComp(84,735.52,this);
} }
......
...@@ -10,6 +10,7 @@ import Panel from "./Panel"; ...@@ -10,6 +10,7 @@ import Panel from "./Panel";
import getShowOffPic from "../../../src/getShowOffPic"; import getShowOffPic from "../../../src/getShowOffPic";
import wait from "../../new_tc/wait"; import wait from "../../new_tc/wait";
import { changeMapScene } from "../../../src/startScene/StartScene"; import { changeMapScene } from "../../../src/startScene/StartScene";
import { addAdComp } from "../../../src/panels/BoxPanel";
export default class PrizePanel extends Panel { export default class PrizePanel extends Panel {
_level; _level;
start(data) { start(data) {
...@@ -41,6 +42,8 @@ export default class PrizePanel extends Panel { ...@@ -41,6 +42,8 @@ export default class PrizePanel extends Panel {
const hc_submitData = DataManager.ins.getData('hc_submit').data; const hc_submitData = DataManager.ins.getData('hc_submit').data;
this.setStar(hc_submitData.stars); this.setStar(hc_submitData.stars);
addAdComp(84,938.52,this);
} }
showlog() { showlog() {
......
import { ModuleTypes } from "../types/sceneTypes"; import { ModuleTypes } from "../types/sceneTypes";
import Panel from "../components/Panel"; import Panel from "../components/Panel";
import Loading from "../components/Loading"; import Loading from "../components/Loading";
import wait from "../../new_tc/wait";
export default class PanelCtrl { export default class PanelCtrl {
_panels:any[]
showPanels(panels: any[]) {
this._panels=panels;
const panel = this._panels.shift();
PanelCtrl.instance.show(panel);
}
checkPanels(){
if(this._panels.length <=0 ) return;
wait(300);
const panel = this._panels.shift();
PanelCtrl.instance.show(panel);
}
private _parent: egret.Sprite; private _parent: egret.Sprite;
private _mask: egret.Sprite; private _mask: egret.Sprite;
static _instance: PanelCtrl; static _instance: PanelCtrl;
...@@ -89,6 +105,7 @@ export default class PanelCtrl { ...@@ -89,6 +105,7 @@ export default class PanelCtrl {
panel.removeEventListener('onDestroy', this.onPanelHide, this); panel.removeEventListener('onDestroy', this.onPanelHide, this);
this.remove(panel); this.remove(panel);
this._current=null; this._current=null;
this.checkPanels();
} }
private _panelClassMap: any; private _panelClassMap: any;
......
...@@ -103,6 +103,10 @@ ...@@ -103,6 +103,10 @@
{ {
"keys": "inviterulebg_png", "keys": "inviterulebg_png",
"name": "inviterule" "name": "inviterule"
},
{
"name": "preload",
"keys": "ad_closebtn_png"
} }
], ],
"resources": [ "resources": [
...@@ -2215,6 +2219,11 @@ ...@@ -2215,6 +2219,11 @@
"url": "assets/inviterule/inviterulebg.png", "url": "assets/inviterule/inviterulebg.png",
"type": "image", "type": "image",
"name": "inviterulebg_png" "name": "inviterulebg_png"
},
{
"name": "ad_closebtn_png",
"type": "image",
"url": "assets/ad/ad_closebtn.png"
} }
] ]
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="Box2Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="Box2Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16ccc954c14"/> <w:Config id="16ccc954c14"/>
<e:Component y="739.52" skinName="ADSmallSkin" horizontalCenter="0"/> <e:Component id="ad" y="739.52" skinName="ADSmallSkin" x="84" visible="false"/>
<e:Image y="33.76" horizontalCenter="0" source="box2_bg_png"/> <e:Image y="33.76" horizontalCenter="0" source="box2_bg_png"/>
<e:Button id="closeBtn" label="" x="601.94" y="195.3"> <e:Button id="closeBtn" label="" x="601.94" y="195.3">
<e:skinName> <e:skinName>
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<e:Image source="namebg_png" horizontalCenter="-4" bottom="-4"/> <e:Image source="namebg_png" horizontalCenter="-4" bottom="-4"/>
<e:Label id="nameTxt" text="La121233bel" y="91.5" size="20" horizontalCenter="1"/> <e:Label id="nameTxt" text="La121233bel" y="91.5" size="20" horizontalCenter="1"/>
</e:Group> </e:Group>
<e:Image id="adBtn" y="519.02" source="ad_icon_png" right="12"/> <e:Image id="adBtn" y="519.02" source="ad_icon_png" right="12" width="143" height="122"/>
<e:Button id="taskBtn" label="" x="572.62" y="248.51" visible="false"> <e:Button id="taskBtn" label="" x="572.62" y="248.51" visible="false">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="NoPrizeSkin" width="750" height="1000" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="NoPrizeSkin" width="750" height="1000" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Component y="735.52" skinName="ADSmallSkin" horizontalCenter="0"/> <e:Component y="735.52" skinName="ADSmallSkin" x="84" visible="false"/>
<e:Image id="light" source="common_prizelight_png" x="374.19" y="329.51" anchorOffsetX="375.76" anchorOffsetY="327.27"/> <e:Image id="light" source="common_prizelight_png" x="374.19" y="329.51" anchorOffsetX="375.76" anchorOffsetY="327.27"/>
<e:Image y="109.55" source="擦肩而过弹窗 _png" horizontalCenter="0.5"/> <e:Image y="109.55" source="擦肩而过弹窗 _png" horizontalCenter="0.5"/>
<e:Button id="closeBtn" label="" x="617" y="279"> <e:Button id="closeBtn" label="" x="617" y="279">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="Prize2Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="Prize2Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="169005181d0"/> <w:Config id="169005181d0"/>
<e:Component y="849.52" skinName="ADSmallSkin" horizontalCenter="0"/> <e:Component y="849.52" skinName="ADSmallSkin" x="84" visible="false"/>
<e:Image id="light" source="common_prizelight_png" x="374.19" y="246.13" anchorOffsetX="375.76" anchorOffsetY="327.27"/> <e:Image id="light" source="common_prizelight_png" x="374.19" y="246.13" anchorOffsetX="375.76" anchorOffsetY="327.27"/>
<e:Image source="prizePanelbg_png" y="51.58" horizontalCenter="0.5"/> <e:Image source="prizePanelbg_png" y="51.58" horizontalCenter="0.5"/>
<e:Button id="closeBtn" label="" x="616" y="223.62"> <e:Button id="closeBtn" label="" x="616" y="223.62">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="PrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="PrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="169005181d0"/> <w:Config id="169005181d0"/>
<e:Component y="938.52" skinName="ADSmallSkin" horizontalCenter="0"/> <e:Component y="938.52" skinName="ADSmallSkin" x="84" visible="false"/>
<e:Image id="light" source="common_prizelight_png" x="374.19" y="329.51" anchorOffsetX="375.76" anchorOffsetY="327.27"/> <e:Image id="light" source="common_prizelight_png" x="374.19" y="329.51" anchorOffsetX="375.76" anchorOffsetY="327.27"/>
<e:Image source="prizePanelbg_png" y="136.9" horizontalCenter="0.5"/> <e:Image source="prizePanelbg_png" y="136.9" horizontalCenter="0.5"/>
<e:Button id="closeBtn" label="" x="618" y="311"> <e:Button id="closeBtn" label="" x="618" y="311">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="SignPrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="SignPrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16d5c2563cb"/> <w:Config id="16d5c2563cb"/>
<e:Component y="698.52" skinName="ADSmallSkin" horizontalCenter="0"/> <e:Component y="698.52" skinName="ADSmallSkin" x="84" visible="false"/>
<e:Image source="singprizebg_png" y="20" horizontalCenter="0"/> <e:Image source="singprizebg_png" y="20" horizontalCenter="0"/>
<e:Image id="img" y="297" touchEnabled="true" source="{data.img}" width="512" height="240" scaleX="1" scaleY="1" horizontalCenter="0" visible="false"/> <e:Image id="img" y="297" touchEnabled="true" source="{data.img}" width="512" height="240" scaleX="1" scaleY="1" horizontalCenter="0" visible="false"/>
<e:Image id="money" source="signprize元宝_png" y="234.88" horizontalCenter="0"/> <e:Image id="money" source="signprize元宝_png" y="234.88" horizontalCenter="0"/>
......
...@@ -6,7 +6,7 @@ export default class AdSmallComp extends ComponentBase { ...@@ -6,7 +6,7 @@ export default class AdSmallComp extends ComponentBase {
start(data?) { start(data?) {
let result; let result;
this.touchEnabled = this.touchChildren = false; // this.touchEnabled = this.touchChildren = false;
super.start(data); super.start(data);
NetManager.ins.hc_advert(() => { NetManager.ins.hc_advert(() => {
const { data } = DataManager.ins.getData('hc_advert'); const { data } = DataManager.ins.getData('hc_advert');
......
...@@ -33,10 +33,10 @@ export default class MapScene extends Scene { ...@@ -33,10 +33,10 @@ export default class MapScene extends Scene {
static iconHash: any = {}; static iconHash: any = {};
static starHash: any = {}; static starHash: any = {};
_data; _data;
sendInvite(){ sendInvite() {
const dojoin = DataManager.ins.getData('hc_doJoin'); const dojoin = DataManager.ins.getData('hc_doJoin');
if(!dojoin)return; if (!dojoin) return;
NetManager.ins.doHelp(()=>{},Utils.getRequestByKey("shareCode"),dojoin.data); NetManager.ins.doHelp(() => { }, Utils.getRequestByKey("shareCode"), dojoin.data);
} }
// 邀请有礼角标倒计时 // 邀请有礼角标倒计时
...@@ -46,7 +46,7 @@ export default class MapScene extends Scene { ...@@ -46,7 +46,7 @@ export default class MapScene extends Scene {
async start(data?) { async start(data?) {
super.start(); super.start();
this.sendInvite(); this.sendInvite();
this.updateMyInfo(); this.updateMyInfo();
...@@ -58,23 +58,34 @@ export default class MapScene extends Scene { ...@@ -58,23 +58,34 @@ export default class MapScene extends Scene {
// PanelCtrl.instance.show('StartPanel',1); // PanelCtrl.instance.show('StartPanel',1);
}, 1000); }, 1000);
if(getBgOn() && MapScene['firstPlayBgTag'] == true) { if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
playBg(); playBg();
} }
stopGamebg(); stopGamebg();
NetManager.ins.getSignInfo(() => { NetManager.ins.getSignInfo(() => {
const panels = [];
const date = new Date(); const date = new Date();
date.setHours(0, 0, 0, 0); date.setHours(0, 0, 0, 0);
const nowTimerStr = date.getTime() + ''; const nowTimerStr = date.getTime() + '';
const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId); const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId);
if(!readCache() && getHomeData().levels.length <= 0) { //引导 const nowTimerStr2 = date.getTime() + '';
const oldTimerStr2 = localStorage.getItem('nowTimer2Str' + window['CFG'].consumerId);
const hc_advert = DataManager.ins.getData('hc_advert').data;
const { popupAdvert } = hc_advert;
if (oldTimerStr2 != nowTimerStr2 && popupAdvert.enable) {
panels.push('ad');
localStorage.setItem('nowTimer2Str' + window['CFG'].consumerId, nowTimerStr2);
}
if (!readCache() && getHomeData().levels.length <= 0) { //引导
const guide = new GuideCon(() => { const guide = new GuideCon(() => {
const {signInfoVO} = DataManager.ins.getData('getSignInfo'); const { signInfoVO } = DataManager.ins.getData('getSignInfo');
if(signInfoVO.continueDay >= 7) return; if (signInfoVO.continueDay >= 7) return;
if(signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr) { if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr) {
PanelCtrl.instance.show('sign'); PanelCtrl.instance.show('sign');
localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr); localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr);
} }
...@@ -84,14 +95,16 @@ export default class MapScene extends Scene { ...@@ -84,14 +95,16 @@ export default class MapScene extends Scene {
guide.play(1) guide.play(1)
console.log(guide) console.log(guide)
} else { //不用引导 } else { //不用引导
const {signInfoVO} = DataManager.ins.getData('getSignInfo'); const { signInfoVO } = DataManager.ins.getData('getSignInfo');
if(signInfoVO.continueDay >= 7) return; if (signInfoVO.continueDay >= 7) return;
if(signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr) { if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr) {
PanelCtrl.instance.show('sign'); // PanelCtrl.instance.show('sign');
panels.push('sign');
localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr); localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr);
} }
} }
PanelCtrl.instance.showPanels(panels);
}, window['signActivityId']); }, window['signActivityId']);
...@@ -124,18 +137,18 @@ export default class MapScene extends Scene { ...@@ -124,18 +137,18 @@ export default class MapScene extends Scene {
let target; let target;
const homeData = getHomeData(); const homeData = getHomeData();
if(homeData.levels.length == 0) { if (homeData.levels.length == 0) {
target = 1; target = 1;
} else if(homeData.levels.length == window['total_level']) { } else if (homeData.levels.length == window['total_level']) {
target = window['total_level'] + 1; target = window['total_level'] + 1;
} else { } else {
target = homeData.levels.length + 1; target = homeData.levels.length + 1;
} }
for(const key in MapScene.iconHash) { for (const key in MapScene.iconHash) {
const levelOrder = parseInt(key); const levelOrder = parseInt(key);
const element = MapScene.iconHash[key]; const element = MapScene.iconHash[key];
element.addEventListener(egret.TouchEvent.TOUCH_TAP, () => { element.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if( if (
(levelOrder > (homeData.levels.length + 1) && levelOrder > 1) (levelOrder > (homeData.levels.length + 1) && levelOrder > 1)
|| (levelOrder > window['last_level']) || (levelOrder > window['last_level'])
) { ) {
...@@ -147,7 +160,7 @@ export default class MapScene extends Scene { ...@@ -147,7 +160,7 @@ export default class MapScene extends Scene {
}, this); }, this);
} }
if(homeData.levels.length < window['total_level']) { if (homeData.levels.length < window['total_level']) {
const targetIcon = MapScene.iconHash[target]; const targetIcon = MapScene.iconHash[target];
const light = RES.getRes('lightani_png'); const light = RES.getRes('lightani_png');
const pic = new egret.Bitmap(light);//76 61 const pic = new egret.Bitmap(light);//76 61
...@@ -157,7 +170,7 @@ export default class MapScene extends Scene { ...@@ -157,7 +170,7 @@ export default class MapScene extends Scene {
pic.anchorOffsetY = 61; pic.anchorOffsetY = 61;
pic.x = 50 - 2; pic.x = 50 - 2;
pic.y = 37 + 10; pic.y = 37 + 10;
egret.Tween.get(pic, {loop: true}).to({scaleX: 2, scaleY: 2, alpha: 0}, 1000).wait(1000); egret.Tween.get(pic, { loop: true }).to({ scaleX: 2, scaleY: 2, alpha: 0 }, 1000).wait(1000);
this['pic'] = pic; this['pic'] = pic;
} }
...@@ -167,8 +180,8 @@ export default class MapScene extends Scene { ...@@ -167,8 +180,8 @@ export default class MapScene extends Scene {
this.showLog(); this.showLog();
this.updateBox(); this.updateBox();
if(data.level) { if (data.level) {
if(homeData.remainEnargy == 0) if (homeData.remainEnargy == 0)
PanelCtrl.instance.show('bloodPanel') PanelCtrl.instance.show('bloodPanel')
else else
...@@ -176,8 +189,8 @@ export default class MapScene extends Scene { ...@@ -176,8 +189,8 @@ export default class MapScene extends Scene {
} }
this.stage.once(egret.TouchEvent.TOUCH_TAP, () => { this.stage.once(egret.TouchEvent.TOUCH_TAP, () => {
if(!MapScene['firstPlayBgTag']) { if (!MapScene['firstPlayBgTag']) {
if(getBgOn()) { if (getBgOn()) {
playBg(); playBg();
} }
MapScene['firstPlayBgTag'] = true; MapScene['firstPlayBgTag'] = true;
...@@ -185,7 +198,7 @@ export default class MapScene extends Scene { ...@@ -185,7 +198,7 @@ export default class MapScene extends Scene {
}, this); }, this);
let lastOrder = homeData.levels.length + 1; let lastOrder = homeData.levels.length + 1;
if(homeData.levels.length >= window['total_level']) if (homeData.levels.length >= window['total_level'])
lastOrder = window['total_level']; lastOrder = window['total_level'];
this.scroll.viewport.scrollV = this.getScrollV(lastOrder, this.stage.stageHeight); this.scroll.viewport.scrollV = this.getScrollV(lastOrder, this.stage.stageHeight);
// console.warn(this.getScrollV(lastOrder, this.stage.stageHeight)) // console.warn(this.getScrollV(lastOrder, this.stage.stageHeight))
...@@ -195,7 +208,7 @@ export default class MapScene extends Scene { ...@@ -195,7 +208,7 @@ export default class MapScene extends Scene {
Promise.all([ Promise.all([
RES.getResAsync(`${key}_json`), RES.getResAsync(`${key}_json`),
RES.getResAsync(`${key}_png`)]); RES.getResAsync(`${key}_png`)]);
} catch(error) { } catch (error) {
} }
...@@ -206,7 +219,7 @@ export default class MapScene extends Scene { ...@@ -206,7 +219,7 @@ export default class MapScene extends Scene {
this['nameTxt'].text = ''; this['nameTxt'].text = '';
NetManager.ins.hc_userInfo(() => { NetManager.ins.hc_userInfo(() => {
this['avatar'].visible = true; this['avatar'].visible = true;
const {data} = DataManager.ins.getData('hc_userInfo'); const { data } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = data.avatar; this['avatar'].source = data.avatar;
this['nameTxt'].text = getNick(data.nickname); this['nameTxt'].text = getNick(data.nickname);
...@@ -215,29 +228,35 @@ export default class MapScene extends Scene { ...@@ -215,29 +228,35 @@ export default class MapScene extends Scene {
} }
updateAdData() { updateAdData() {
// if(){ const hc_advert = DataManager.ins.getData('hc_advert').data;
// this['adBtn'].visible=false; const { mapAdvert } = hc_advert;
// } this['adBtn'].visible = mapAdvert.enable;
// this['adBtn'].source = ''; let result;
result = mapAdvert.advertList;
if (Array.isArray(mapAdvert.advertList)) {
const index = Math.floor(mapAdvert.advertList.length * Math.random());
result = mapAdvert.advertList[index];
}
this['adBtn'].source = result.img;
this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// window.location.href = ''; window.location.href = result.url;
}, this); }, this);
} }
destroy() { destroy() {
super.destroy(); super.destroy();
if(this['pic']) if (this['pic'])
egret.Tween.removeTweens(this['pic']); egret.Tween.removeTweens(this['pic']);
} }
getScrollV(lastOrder, stageHeight) { getScrollV(lastOrder, stageHeight) {
// lastOrder = 69; // lastOrder = 69;
if(lastOrder <= 7) {//顶部的1-7关 if (lastOrder <= 7) {//顶部的1-7关
return this.getScrollV1(lastOrder, stageHeight); return this.getScrollV1(lastOrder, stageHeight);
} }
if(lastOrder >= window['total_level'] - 10) {//底部的60-70关 70-10 if (lastOrder >= window['total_level'] - 10) {//底部的60-70关 70-10
return this.getScrollV2(lastOrder, stageHeight); return this.getScrollV2(lastOrder, stageHeight);
} }
//中部的4个循环*13 8~59 //中部的4个循环*13 8~59
...@@ -248,7 +267,7 @@ export default class MapScene extends Scene { ...@@ -248,7 +267,7 @@ export default class MapScene extends Scene {
const ylist = [26, 158, 302, 435, 547, 674, 821, 897, 969, 1072, 1137, 1254, 1367]; const ylist = [26, 158, 302, 435, 547, 674, 821, 897, 969, 1072, 1137, 1254, 1367];
const y0 = this._data.top.height;//顶部的高度 const y0 = this._data.top.height;//顶部的高度
let a0 = (lastOrder - MapTopPart.LEVEL_NUMS) % MapRpeatPart.LEVEL_NUMS; //减去7后的order 8-7 = 1 let a0 = (lastOrder - MapTopPart.LEVEL_NUMS) % MapRpeatPart.LEVEL_NUMS; //减去7后的order 8-7 = 1
if(a0 == 0) a0 = MapRpeatPart.LEVEL_NUMS if (a0 == 0) a0 = MapRpeatPart.LEVEL_NUMS
const a1 = Math.ceil((lastOrder - MapTopPart.LEVEL_NUMS) / MapRpeatPart.LEVEL_NUMS) - 1;//当前地图repeat的顺序 const a1 = Math.ceil((lastOrder - MapTopPart.LEVEL_NUMS) / MapRpeatPart.LEVEL_NUMS) - 1;//当前地图repeat的顺序
const y1 = ylist[a0 - 1]; const y1 = ylist[a0 - 1];
const y2 = y0 + y1 + a1 * this._data.list[0].height; const y2 = y0 + y1 + a1 * this._data.list[0].height;
...@@ -258,7 +277,7 @@ export default class MapScene extends Scene { ...@@ -258,7 +277,7 @@ export default class MapScene extends Scene {
getScrollV1(lastOrder, stageHeight) { getScrollV1(lastOrder, stageHeight) {
const ylist = [492, 550.35, 744, 803, 810, 975, 1089.69].map(i => i + 40); const ylist = [492, 550.35, 744, 803, 810, 975, 1089.69].map(i => i + 40);
const targetY = ylist[lastOrder - 1] - stageHeight / 2; const targetY = ylist[lastOrder - 1] - stageHeight / 2;
if(targetY <= 0) return 0 if (targetY <= 0) return 0
return targetY; return targetY;
} }
...@@ -270,7 +289,7 @@ export default class MapScene extends Scene { ...@@ -270,7 +289,7 @@ export default class MapScene extends Scene {
+ this._data.bottom.height; + this._data.bottom.height;
const ylist = [44, 148.44, 331, 403, 513, 660, 829.69, 949.69, 1052.69, 1148.69, 1209.69].map(i => i + 40); const ylist = [44, 148.44, 331, 403, 513, 660, 829.69, 949.69, 1052.69, 1148.69, 1209.69].map(i => i + 40);
const targetY = y0 + ylist[lastOrder - 1] - stageHeight / 2; const targetY = y0 + ylist[lastOrder - 1] - stageHeight / 2;
if(targetY >= (totalHeight - stageHeight)) return totalHeight - stageHeight if (targetY >= (totalHeight - stageHeight)) return totalHeight - stageHeight
return targetY; return targetY;
} }
...@@ -292,7 +311,7 @@ export default class MapScene extends Scene { ...@@ -292,7 +311,7 @@ export default class MapScene extends Scene {
updateBox() { updateBox() {
const homeData = getHomeData(); const homeData = getHomeData();
if(homeData.canReceiveTreasureBoxNum <= 0) if (homeData.canReceiveTreasureBoxNum <= 0)
setGray(this['box']); setGray(this['box']);
this['boxiconWrapper'].visible = homeData.canReceiveTreasureBoxNum > 0; this['boxiconWrapper'].visible = homeData.canReceiveTreasureBoxNum > 0;
this['totalStarTxt'].text = `${homeData.totalStars}/${homeData.nextRangeStarsNum}`; this['totalStarTxt'].text = `${homeData.totalStars}/${homeData.nextRangeStarsNum}`;
...@@ -319,7 +338,7 @@ export default class MapScene extends Scene { ...@@ -319,7 +338,7 @@ export default class MapScene extends Scene {
NetManager.ins.hc_mapRank(() => { NetManager.ins.hc_mapRank(() => {
const { data } = DataManager.ins.getData('hc_mapRank'); const { data } = DataManager.ins.getData('hc_mapRank');
data.forEach((ele) => { data.forEach((ele) => {
this.addAvatar(ele.levelNum,ele.rank[0]); this.addAvatar(ele.levelNum, ele.rank[0]);
}); });
}); });
} }
...@@ -329,24 +348,24 @@ export default class MapScene extends Scene { ...@@ -329,24 +348,24 @@ export default class MapScene extends Scene {
this['goldTxt'].text = `${homeData.wealth}`; this['goldTxt'].text = `${homeData.wealth}`;
for(let j = 1; j < window['total_level']; j++) { for (let j = 1; j < window['total_level']; j++) {
this.disableIcon(j + 1); this.disableIcon(j + 1);
} }
for(let i = 0; i < homeData.levels.length; i++) { for (let i = 0; i < homeData.levels.length; i++) {
const level = homeData.levels[i]; const level = homeData.levels[i];
const star = MapScene.starHash[i + 1]; const star = MapScene.starHash[i + 1];
if(level) { if (level) {
star.setStar(level.stars); star.setStar(level.stars);
this.enableIcon(level.levelNum); this.enableIcon(level.levelNum);
} else { } else {
this.disableIcon(level.levelNum); this.disableIcon(level.levelNum);
} }
} }
if(homeData.levels.length == 0) { if (homeData.levels.length == 0) {
const star = MapScene.starHash[1]; const star = MapScene.starHash[1];
star.setStar(0); star.setStar(0);
this.enableIcon(1); this.enableIcon(1);
} else if(homeData.levels.length == window['last_level']) { } else if (homeData.levels.length == window['last_level']) {
} else { } else {
const star = MapScene.starHash[homeData.levels.length + 1]; const star = MapScene.starHash[homeData.levels.length + 1];
...@@ -360,11 +379,11 @@ export default class MapScene extends Scene { ...@@ -360,11 +379,11 @@ export default class MapScene extends Scene {
updateTimerView() { updateTimerView() {
//更新倒计时 //更新倒计时
if(this._countDown == null) { if (this._countDown == null) {
this._countDown = new CountDown(this['countdown']); this._countDown = new CountDown(this['countdown']);
} }
const data = getHomeData(); const data = getHomeData();
if(data.remainEnargy >= BLOOD_NUMS_MAX) { //满了 if (data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
this._countDown.stop(); this._countDown.stop();
this['fullTxt'].visible = true; this['fullTxt'].visible = true;
...@@ -388,19 +407,19 @@ export default class MapScene extends Scene { ...@@ -388,19 +407,19 @@ export default class MapScene extends Scene {
return; return;
} }
let flag = res.data.completeFlag; let flag = res.data.completeFlag;
switch(true) { switch (true) {
case (flag == 0): // 未完成 case (flag == 0): // 未完成
PanelCtrl.instance.show('invite', res.data); PanelCtrl.instance.show('invite', res.data);
break; break;
case (flag == 1): // 完成未开奖 待领奖 请求领奖接口 case (flag == 1): // 完成未开奖 待领奖 请求领奖接口
NetManager.ins.acceptInvitationPrize((success, res)=>{ NetManager.ins.acceptInvitationPrize((success, res) => {
if(!success){ if (!success) {
return; return;
} }
console.log(res.data); console.log(res.data);
if(res.data.completeFlag == 3){ if (res.data.completeFlag == 3) {
showToast("哎呀,萌狮开小差啦!\n过会再来看吧!"); showToast("哎呀,萌狮开小差啦!\n过会再来看吧!");
}else{ } else {
PanelCtrl.instance.show('invitePrize', res.data); PanelCtrl.instance.show('invitePrize', res.data);
} }
}); });
...@@ -410,8 +429,8 @@ export default class MapScene extends Scene { ...@@ -410,8 +429,8 @@ export default class MapScene extends Scene {
PanelCtrl.instance.show('inviteCutTime', res.data); PanelCtrl.instance.show('inviteCutTime', res.data);
break; break;
case (flag == 4): // 可以开启下一次发任务 case (flag == 4): // 可以开启下一次发任务
NetManager.ins.acceptInvitationInfo((success, res)=>{ NetManager.ins.acceptInvitationInfo((success, res) => {
if(!success){ if (!success) {
return; return;
} }
PanelCtrl.instance.show('invite', res.data); PanelCtrl.instance.show('invite', res.data);
...@@ -427,13 +446,13 @@ export default class MapScene extends Scene { ...@@ -427,13 +446,13 @@ export default class MapScene extends Scene {
/** /**
* 查询邀请信息 * 查询邀请信息
*/ */
getInviteInfo(){ getInviteInfo() {
NetManager.ins.getInviteInfo((success, res) => { NetManager.ins.getInviteInfo((success, res) => {
if (!success || !res.data) { if (!success || !res.data) {
return; return;
} }
let flag = res.data.completeFlag; let flag = res.data.completeFlag;
switch(true) { switch (true) {
case (flag == 0): // 未完成 显示倒计时 case (flag == 0): // 未完成 显示倒计时
this["inviteTipsBg"].visible = true; this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true; this["inviteTips"].visible = true;
...@@ -469,7 +488,7 @@ export default class MapScene extends Scene { ...@@ -469,7 +488,7 @@ export default class MapScene extends Scene {
// 倒计时 // 倒计时
private cutTimer() { private cutTimer() {
let timer = this.convertTime(this.cutTime -= 1000); let timer = this.convertTime(this.cutTime -= 1000);
if(timer.hour === "00" if (timer.hour === "00"
&& timer.min === "00" && timer.min === "00"
&& timer.sec === "00") { && timer.sec === "00") {
this.timer.stop(); this.timer.stop();
...@@ -553,9 +572,9 @@ export default class MapScene extends Scene { ...@@ -553,9 +572,9 @@ export default class MapScene extends Scene {
async onTap_boxLayer() { async onTap_boxLayer() {
NetManager.ins.clickLog(getlogItem(1)); NetManager.ins.clickLog(getlogItem(1));
const data = getHomeData(); const data = getHomeData();
if(data.canReceiveTreasureBoxNum > 0) { if (data.canReceiveTreasureBoxNum > 0) {
this['boxLayer'].visible = true; this['boxLayer'].visible = true;
if(!this._mc) if (!this._mc)
this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']); this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']);
this._mc.stop(); this._mc.stop();
this._mc.gotoAndStop(1); this._mc.gotoAndStop(1);
...@@ -567,18 +586,18 @@ export default class MapScene extends Scene { ...@@ -567,18 +586,18 @@ export default class MapScene extends Scene {
await wait(50); await wait(50);
this._mc.visible = true; this._mc.visible = true;
const a = 100, b = 10; const a = 100, b = 10;
egret.Tween.get(this._mc, {loop: true}).set({rotation: b}) egret.Tween.get(this._mc, { loop: true }).set({ rotation: b })
.to({rotation: -b}, a).to({rotation: b}, a) .to({ rotation: -b }, a).to({ rotation: b }, a)
.to({rotation: -b}, a).to({rotation: b}, a) .to({ rotation: -b }, a).to({ rotation: b }, a)
.to({rotation: -b}, a).to({rotation: b}, a) .to({ rotation: -b }, a).to({ rotation: b }, a)
.to({rotation: 0}, a / 2) .to({ rotation: 0 }, a / 2)
.wait(1000); .wait(1000);
} }
} }
async playAni() { async playAni() {
if(this._mc) { if (this._mc) {
egret.Tween.removeTweens(this._mc); egret.Tween.removeTweens(this._mc);
this._mc.gotoAndPlay(1, true); this._mc.gotoAndPlay(1, true);
await this.onPlaySTOP(); await this.onPlaySTOP();
...@@ -589,7 +608,7 @@ export default class MapScene extends Scene { ...@@ -589,7 +608,7 @@ export default class MapScene extends Scene {
async onPlaySTOP() { async onPlaySTOP() {
return new Promise((r) => { return new Promise((r) => {
const func = () => { const func = () => {
if(this._mc.currentFrame >= 100) { if (this._mc.currentFrame >= 100) {
this._mc.removeEventListener(egret.Event.ENTER_FRAME, func, this); this._mc.removeEventListener(egret.Event.ENTER_FRAME, func, this);
this._mc.stop(); this._mc.stop();
r(); r();
...@@ -608,14 +627,14 @@ export default class MapScene extends Scene { ...@@ -608,14 +627,14 @@ export default class MapScene extends Scene {
this['boxani'].touchChildren = false; this['boxani'].touchChildren = false;
await this.playAni(); await this.playAni();
try { try {
if(window['getRST']) window['getRST'](); if (window['getRST']) window['getRST']();
} catch(error) { } catch (error) {
console.warn(error) console.warn(error)
} }
NetManager.ins.hc_openTreasureBox((success) => { NetManager.ins.hc_openTreasureBox((success) => {
this['boxani'].touchEnabled = true; this['boxani'].touchEnabled = true;
this['boxani'].touchChildren = true; this['boxani'].touchChildren = true;
if(success) { if (success) {
const boxdata = DataManager.ins.getData('hc_openTreasureBox').data; const boxdata = DataManager.ins.getData('hc_openTreasureBox').data;
const homeData = DataManager.ins.getData('hc_home').data; const homeData = DataManager.ins.getData('hc_home').data;
homeData.canReceiveTreasureBoxNum = boxdata.canReceiveTreasureBoxNum; homeData.canReceiveTreasureBoxNum = boxdata.canReceiveTreasureBoxNum;
...@@ -625,19 +644,19 @@ export default class MapScene extends Scene { ...@@ -625,19 +644,19 @@ export default class MapScene extends Scene {
this.updateBox(); this.updateBox();
const data = DataManager.ins.getData('hc_openTreasureBox').data; const data = DataManager.ins.getData('hc_openTreasureBox').data;
NetManager.ins.getPlugOrderStatus((s) => { NetManager.ins.getPlugOrderStatus((s) => {
if(s) { if (s) {
const data = DataManager.ins.getData('getPlugOrderStatus'); const data = DataManager.ins.getData('getPlugOrderStatus');
//区分奖品 //区分奖品
if(data.lottery && data.lottery.type != 'thanks') { if (data.lottery && data.lottery.type != 'thanks') {
PanelCtrl.instance.show('box'); PanelCtrl.instance.show('box');
} else {
showToast('哎呀!奖励与您擦肩而过!快继续闯关!');
}
} else { } else {
showToast('哎呀!奖励与您擦肩而过!快继续闯关!'); showToast('哎呀!奖励与您擦肩而过!快继续闯关!');
} }
}, } else {
showToast('哎呀!奖励与您擦肩而过!快继续闯关!');
}
},
data.orderNum, data.orderNum,
() => { () => {
return DataManager.ins.getData('getPlugOrderStatus').result == 0 return DataManager.ins.getData('getPlugOrderStatus').result == 0
...@@ -671,7 +690,7 @@ export default class MapScene extends Scene { ...@@ -671,7 +690,7 @@ export default class MapScene extends Scene {
onTap_bloodBtn() { onTap_bloodBtn() {
NetManager.ins.clickLog(getlogItem(2)); NetManager.ins.clickLog(getlogItem(2));
if(getHomeData().remainEnargy > 0) if (getHomeData().remainEnargy > 0)
PanelCtrl.instance.show('bloodPanel') PanelCtrl.instance.show('bloodPanel')
else else
PanelCtrl.instance.show('blood2Panel') PanelCtrl.instance.show('blood2Panel')
...@@ -696,7 +715,7 @@ export default class MapScene extends Scene { ...@@ -696,7 +715,7 @@ export default class MapScene extends Scene {
export const getNick = (nickname) => { export const getNick = (nickname) => {
if (!nickname) return nickname; if (!nickname) return nickname;
const max = 4; const max = 4;
if(nickname.length > max) if (nickname.length > max)
return nickname.slice(0, max) + '...'; return nickname.slice(0, max) + '...';
return nickname; return nickname;
} }
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class ADPanel extends Panel { export default class ADPanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
let result;
const hc_advert = DataManager.ins.getData('hc_advert').data;
const { popupAdvert } = hc_advert;
this.visible = popupAdvert.enable;
result = popupAdvert.advertList;
if (Array.isArray(popupAdvert.advertList)) {
const index = Math.floor(popupAdvert.advertList.length * Math.random());
result = popupAdvert.advertList[index];
}
this.data.img = result.img;
} }
showlog(){ showlog() {
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
} }
...@@ -18,9 +31,9 @@ export default class ADPanel extends Panel { ...@@ -18,9 +31,9 @@ export default class ADPanel extends Panel {
} }
onTapInvite() { onTapInvite() {
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn'],this['closeBtn2']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn'], this['closeBtn2']] }
get skinKey() { return 'AD' } get skinKey() { return 'AD' }
} }
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { addAdComp } from "./BoxPanel";
export default class Box2Panel extends Panel { export default class Box2Panel extends Panel {
start(data) { start(data) {
super.start(); super.start();
...@@ -9,6 +9,7 @@ export default class Box2Panel extends Panel { ...@@ -9,6 +9,7 @@ export default class Box2Panel extends Panel {
// }, this); // }, this);
// this.showlog(); // this.showlog();
// this.data.img = DataManager.ins.getData('getPlugOrderStatus').lottery.imgurl; // this.data.img = DataManager.ins.getData('getPlugOrderStatus').lottery.imgurl;
addAdComp(84,739,this)
} }
// showlog() { // showlog() {
// NetManager.ins.showLog(getlogItem(17)); // NetManager.ins.showLog(getlogItem(17));
......
...@@ -3,6 +3,7 @@ import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl"; ...@@ -3,6 +3,7 @@ import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes"; import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import { NetManager } from "../../libs/tw/manager/NetManager"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { changeMapScene } from "../startScene/StartScene"; import { changeMapScene } from "../startScene/StartScene";
import { addAdComp } from "./BoxPanel";
export default class FailedPanel extends Panel { export default class FailedPanel extends Panel {
_level; _level;
...@@ -20,6 +21,8 @@ export default class FailedPanel extends Panel { ...@@ -20,6 +21,8 @@ export default class FailedPanel extends Panel {
changeMapScene(); changeMapScene();
}, this); }, this);
addAdComp(84,674.52,this);
} }
onTouchTap_closeBtn() { onTouchTap_closeBtn() {
......
...@@ -10,6 +10,7 @@ import { showShare } from "../shareCtrl"; ...@@ -10,6 +10,7 @@ import { showShare } from "../shareCtrl";
import { iswx } from "../iswx"; import { iswx } from "../iswx";
import wait from "../../libs/new_tc/wait"; import wait from "../../libs/new_tc/wait";
import { changeMapScene } from "../startScene/StartScene"; import { changeMapScene } from "../startScene/StartScene";
import { addAdComp } from "./BoxPanel";
export default class Prize2Panel extends Panel { export default class Prize2Panel extends Panel {
_level; _level;
...@@ -45,6 +46,8 @@ export default class Prize2Panel extends Panel { ...@@ -45,6 +46,8 @@ export default class Prize2Panel extends Panel {
const hc_submitData = DataManager.ins.getData('hc_submit').data; const hc_submitData = DataManager.ins.getData('hc_submit').data;
this.setStar(hc_submitData.stars); this.setStar(hc_submitData.stars);
addAdComp(84,849.52,this);
} }
showlog() { showlog() {
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { addAdComp } from "./BoxPanel";
export default class SignPrizePanel extends Panel { export default class SignPrizePanel extends Panel {
start(data) { start(data) {
...@@ -29,6 +30,7 @@ export default class SignPrizePanel extends Panel { ...@@ -29,6 +30,7 @@ export default class SignPrizePanel extends Panel {
this['img'].visible = prizeType!= 'times' && prizeType!= 'coin'; this['img'].visible = prizeType!= 'times' && prizeType!= 'coin';
this['money'].visible = prizeType=='coin'; this['money'].visible = prizeType=='coin';
this['blood'].visible = prizeType=='times'; this['blood'].visible = prizeType=='times';
addAdComp(84,698.52,this);
} }
showlog() { showlog() {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"timestamp":1566199822308, "timestamp":1566199822308,
"data":{ "data":{
"popupAdvert":{ "popupAdvert":{
"enable":true, "enable":false,
"advertList":[ "advertList":[
{ {
"img":"http://yun.dui88.com/images/201909/lsh4tdkp5n.jpg", "img":"http://yun.dui88.com/images/201909/lsh4tdkp5n.jpg",
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
] ]
}, },
"mapAdvert":{ "mapAdvert":{
"enable":true, "enable":false,
"advertList":[ "advertList":[
{ {
"img":"http://yun.dui88.com/images/201909/lsh4tdkp5n.jpg", "img":"http://yun.dui88.com/images/201909/lsh4tdkp5n.jpg",
......
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