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

1

parent a7a36da1
<?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">
<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:List id="friendlist" itemRendererSkinName="FriendItem2Skin" y="48" x="9">
<e:ArrayCollection>
......
......@@ -29,6 +29,7 @@ import createRegTriangle from "../playScene/factory/createRegTriangle";
import RedBagAni, { createRedBagIcon } from "./RedBagAni";
import { createEffect2MovieClip } from "../effect/createEffect2";
import ActIcon from "./icon/ActIcon";
import { NetName } from "../../libs/tw/enum/NetName";
let doHelpFlag = false;
// let doScratchHelpFlag = false;
......@@ -109,10 +110,13 @@ export default class MapScene extends Scene {
private cutTime: number;
onLoad() {
super.onLoad().then(()=>{});
super.onLoad().then(() => {
});
function hbRainBaseInfo() {
return new Promise((resolve, reject) => NetManager.ins.hbRainBaseInfo(() => resolve()));
}
return Promise.all([
hbRainBaseInfo(),
]);
......@@ -179,6 +183,18 @@ export default class MapScene extends Scene {
}
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) { //引导
const guide = new GuideCon(() => {
PanelCtrl.instance.showPanels(panels, [], this.onAllPanelHide);
......
......@@ -5,6 +5,8 @@ import { NetManager } from "../../../libs/tw/manager/NetManager";
import HbRule from "./HbRule";
import { getlogItem } from "../../Main";
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 {
constructor(data) {
super();
this.data = data;
data ? this.data = data : this.data.res = DataManager.ins.getData(NetName.HBRAIN_BASEINFO);
}
start() {
......@@ -34,19 +36,20 @@ export default class HbCutTime extends Panel {
this.ok_btn.anchorOffsetY = 52;
}
getData():any{
return new Promise((r)=>{
getData(): any {
return new Promise((r) => {
NetManager.ins.hbRainBaseInfo((success, res) => {
r(res);
});
});
}
private hbRainBaseInfo(updateData?) {
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;
if(updateData && updateData.data)
this.data.res=updateData;
this.data.res = updateData;
if(!success) {
this.ok_btn.source = 'hbCutTime_btn_soon_png';
......@@ -58,7 +61,7 @@ export default class HbCutTime extends Panel {
const getData = await this.getData(); //重新获取数据
if(getData.success) {
this.hbRainBaseInfo(getData);
}else {
} else {
this.hidePanel(); //没有数据关闭窗口
}
GDispatcher.dispatchEvent('updateHbRainIcon');
......@@ -83,7 +86,7 @@ export default class HbCutTime extends Panel {
}
} else if(data.nextSession) {
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;
this.ok_btn.source = 'hbCutTime_btn_soon_png';
this.ok_btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchOK, this);
......@@ -102,8 +105,14 @@ export default class HbCutTime extends Panel {
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: 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({scaleX: 1, scaleY: 1}, 200, egret.Ease.quadInOut).wait(1000).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({
scaleX: 1,
scaleY: 1
}, 200, egret.Ease.quadInOut).wait(1000).call(() => {
this.btnEffect();
})
});
......
......@@ -37,11 +37,11 @@ showlog(){
const homedata = getHomeData();
if (data > homedata.levels.length) {
addAdComp(84, 925, this,29);
addAdComp(84, 911, this,29);
NetManager.ins.showLog(getlogItem(29));
}
else
addRankFriendList(84, 925, this,data);
addRankFriendList(84, 911, this,data);
setGlow(this['levelTxt'], 0xfa4b09, 1);
this['levelTxt'].text = `第${data}关`;
......
......@@ -6,7 +6,7 @@
"data": {
"currentRemainTimes": 0,
"currentSession": {
"sessionIndex": 10,
"sessionIndex": 6,
"startTime": 1573210800000,
"endTime": 1573210803000,
"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