Commit 0545c7ee authored by 邱旭's avatar 邱旭

1

parent a7a36da1
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="StartPanelSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="StartPanelSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16cd285c715"/> <w:Config id="16cd285c715"/>
<e:Group x="84" y="925" visible="false"> <e:Group x="84" y="911" visible="false">
<e:Image source="startpanel_bg2_png" y="0" x="0"/> <e:Image source="startpanel_bg2_png" y="0" x="0"/>
<e:List id="friendlist" itemRendererSkinName="FriendItem2Skin" y="48" x="9"> <e:List id="friendlist" itemRendererSkinName="FriendItem2Skin" y="48" x="9">
<e:ArrayCollection> <e:ArrayCollection>
......
...@@ -29,6 +29,7 @@ import createRegTriangle from "../playScene/factory/createRegTriangle"; ...@@ -29,6 +29,7 @@ import createRegTriangle from "../playScene/factory/createRegTriangle";
import RedBagAni, { createRedBagIcon } from "./RedBagAni"; import RedBagAni, { createRedBagIcon } from "./RedBagAni";
import { createEffect2MovieClip } from "../effect/createEffect2"; import { createEffect2MovieClip } from "../effect/createEffect2";
import ActIcon from "./icon/ActIcon"; import ActIcon from "./icon/ActIcon";
import { NetName } from "../../libs/tw/enum/NetName";
let doHelpFlag = false; let doHelpFlag = false;
// let doScratchHelpFlag = false; // let doScratchHelpFlag = false;
...@@ -109,10 +110,13 @@ export default class MapScene extends Scene { ...@@ -109,10 +110,13 @@ export default class MapScene extends Scene {
private cutTime: number; private cutTime: number;
onLoad() { onLoad() {
super.onLoad().then(()=>{}); super.onLoad().then(() => {
});
function hbRainBaseInfo() { function hbRainBaseInfo() {
return new Promise((resolve, reject) => NetManager.ins.hbRainBaseInfo(() => resolve())); return new Promise((resolve, reject) => NetManager.ins.hbRainBaseInfo(() => resolve()));
} }
return Promise.all([ return Promise.all([
hbRainBaseInfo(), hbRainBaseInfo(),
]); ]);
...@@ -179,6 +183,18 @@ export default class MapScene extends Scene { ...@@ -179,6 +183,18 @@ export default class MapScene extends Scene {
} }
this.updateSign(); this.updateSign();
// 红包雨强提示
const hbRainRes = DataManager.ins.getData(NetName.HBRAIN_BASEINFO);
if(hbRainRes.data.currentSession || hbRainRes.data.nextSession) {
const sessionId = hbRainRes.data.currentSession ? hbRainRes.data.currentSession.sessionIndex : hbRainRes.data.nextSession.sessionIndex; // 场次ID
const nowTimerStr3 = date.getTime() + sessionId + '';
const oldTimerStr3 = localStorage.getItem('nowTimer3Str' + window['CFG'].consumerId);
if(nowTimerStr3 != oldTimerStr3) {
panels.push('HbCutTime');
localStorage.setItem('nowTimer3Str' + window['CFG'].consumerId, nowTimerStr3);
}
}
if(!readCache() && getHomeData().levels.length <= 0) { //引导 if(!readCache() && getHomeData().levels.length <= 0) { //引导
const guide = new GuideCon(() => { const guide = new GuideCon(() => {
PanelCtrl.instance.showPanels(panels, [], this.onAllPanelHide); PanelCtrl.instance.showPanels(panels, [], this.onAllPanelHide);
......
...@@ -5,6 +5,8 @@ import { NetManager } from "../../../libs/tw/manager/NetManager"; ...@@ -5,6 +5,8 @@ import { NetManager } from "../../../libs/tw/manager/NetManager";
import HbRule from "./HbRule"; import HbRule from "./HbRule";
import { getlogItem } from "../../Main"; import { getlogItem } from "../../Main";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { NetName } from "../../../libs/tw/enum/NetName";
/** /**
* 红包雨倒计时 * 红包雨倒计时
...@@ -20,7 +22,7 @@ export default class HbCutTime extends Panel { ...@@ -20,7 +22,7 @@ export default class HbCutTime extends Panel {
constructor(data) { constructor(data) {
super(); super();
this.data = data; data ? this.data = data : this.data.res = DataManager.ins.getData(NetName.HBRAIN_BASEINFO);
} }
start() { start() {
...@@ -34,19 +36,20 @@ export default class HbCutTime extends Panel { ...@@ -34,19 +36,20 @@ export default class HbCutTime extends Panel {
this.ok_btn.anchorOffsetY = 52; this.ok_btn.anchorOffsetY = 52;
} }
getData():any{ getData(): any {
return new Promise((r)=>{ return new Promise((r) => {
NetManager.ins.hbRainBaseInfo((success, res) => { NetManager.ins.hbRainBaseInfo((success, res) => {
r(res); r(res);
}); });
}); });
} }
private hbRainBaseInfo(updateData?) { private hbRainBaseInfo(updateData?) {
const success = this.data.res.success; const success = this.data.res.success;
const res = updateData ||this.data.res; const res = updateData || this.data.res;
const data = (updateData && updateData.data) || this.data.res.data; const data = (updateData && updateData.data) || this.data.res.data;
if(updateData && updateData.data) if(updateData && updateData.data)
this.data.res=updateData; this.data.res = updateData;
if(!success) { if(!success) {
this.ok_btn.source = 'hbCutTime_btn_soon_png'; this.ok_btn.source = 'hbCutTime_btn_soon_png';
...@@ -54,11 +57,11 @@ export default class HbCutTime extends Panel { ...@@ -54,11 +57,11 @@ export default class HbCutTime extends Panel {
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
return; return;
} }
this.cutTimer = this.cutTimer || new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒', async () => { this.cutTimer = this.cutTimer || new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒', async () => {
const getData = await this.getData(); //重新获取数据 const getData = await this.getData(); //重新获取数据
if(getData.success) { if(getData.success) {
this.hbRainBaseInfo(getData); this.hbRainBaseInfo(getData);
}else { } else {
this.hidePanel(); //没有数据关闭窗口 this.hidePanel(); //没有数据关闭窗口
} }
GDispatcher.dispatchEvent('updateHbRainIcon'); GDispatcher.dispatchEvent('updateHbRainIcon');
...@@ -83,7 +86,7 @@ export default class HbCutTime extends Panel { ...@@ -83,7 +86,7 @@ export default class HbCutTime extends Panel {
} }
} else if(data.nextSession) { } else if(data.nextSession) {
egret.Tween.removeTweens(this.ok_btn); egret.Tween.removeTweens(this.ok_btn);
this.ok_btn.scaleX=this.ok_btn.scaleY=1; this.ok_btn.scaleX = this.ok_btn.scaleY = 1;
time = data.nextSession.startTime - sysTime + 3000; time = data.nextSession.startTime - sysTime + 3000;
this.ok_btn.source = 'hbCutTime_btn_soon_png'; this.ok_btn.source = 'hbCutTime_btn_soon_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this); this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
...@@ -102,8 +105,14 @@ export default class HbCutTime extends Panel { ...@@ -102,8 +105,14 @@ export default class HbCutTime extends Panel {
private btnEffect() { private btnEffect() {
egret.Tween.get(this.ok_btn).to({scaleX: 0.9, scaleY: 1.1}, 200, egret.Ease.quadInOut).call(() => { egret.Tween.get(this.ok_btn).to({scaleX: 0.9, scaleY: 1.1}, 200, egret.Ease.quadInOut).call(() => {
egret.Tween.get(this.ok_btn).to({scaleX: 1, scaleY: 1}, 200, egret.Ease.quadInOut).call(() => { egret.Tween.get(this.ok_btn).to({scaleX: 1, scaleY: 1}, 200, egret.Ease.quadInOut).call(() => {
egret.Tween.get(this.ok_btn).to({scaleX: 0.9618, scaleY: 1.0618}, 200, egret.Ease.quadInOut).call(() => { egret.Tween.get(this.ok_btn).to({
egret.Tween.get(this.ok_btn).to({scaleX: 1, scaleY: 1}, 200, egret.Ease.quadInOut).wait(1000).call(() => { scaleX: 0.9618,
scaleY: 1.0618
}, 200, egret.Ease.quadInOut).call(() => {
egret.Tween.get(this.ok_btn).to({
scaleX: 1,
scaleY: 1
}, 200, egret.Ease.quadInOut).wait(1000).call(() => {
this.btnEffect(); this.btnEffect();
}) })
}); });
......
...@@ -37,11 +37,11 @@ showlog(){ ...@@ -37,11 +37,11 @@ showlog(){
const homedata = getHomeData(); const homedata = getHomeData();
if (data > homedata.levels.length) { if (data > homedata.levels.length) {
addAdComp(84, 925, this,29); addAdComp(84, 911, this,29);
NetManager.ins.showLog(getlogItem(29)); NetManager.ins.showLog(getlogItem(29));
} }
else else
addRankFriendList(84, 925, this,data); addRankFriendList(84, 911, this,data);
setGlow(this['levelTxt'], 0xfa4b09, 1); setGlow(this['levelTxt'], 0xfa4b09, 1);
this['levelTxt'].text = `第${data}关`; this['levelTxt'].text = `第${data}关`;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"data": { "data": {
"currentRemainTimes": 0, "currentRemainTimes": 0,
"currentSession": { "currentSession": {
"sessionIndex": 10, "sessionIndex": 6,
"startTime": 1573210800000, "startTime": 1573210800000,
"endTime": 1573210803000, "endTime": 1573210803000,
"limitScore": 10 "limitScore": 10
......
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