Commit 0ffc784b authored by 邱旭's avatar 邱旭

1

parent 46bcdad9
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing">
<e:Image y="-63.67" horizontalCenter="0" source="hbCutTime_bg_png"/>
<e:Image y="-63.67" horizontalCenter="-1" source="hbCutTime_bg_png"/>
<e:BitmapLabel id="cutTimeLabel" y="525.33" text="00时00分00秒" letterSpacing="8" font="hbCutTimeFont_fnt" horizontalCenter="9"/>
<e:Image id="cutTime" y="477" source="hbCutTime_cutLine_disable_png" horizontalCenter="0"/>
<e:Image id="tipImage" y="477" source="hbCutTime_cutLine_disable_png" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="615" y="208.33">
<e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
......@@ -13,7 +13,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="ok_btn" label="" y="668" anchorOffsetX="150" anchorOffsetY="48" horizontalCenter="0">
<e:Button id="ok_bt" label="" y="668" anchorOffsetX="150" anchorOffsetY="48" horizontalCenter="0" visible="false">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="hbCutTime_btn_enable_png" source.down="hbCutTime_btn_enable_png" source.disabled="hbCutTime_btn_disable_png"/>
......@@ -29,4 +29,5 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Image id="ok_btn" y="623" source="hbCutTime_btn_enable_png" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
import Panel from "../../../libs/new_wx/components/Panel";
import CutTimer from "../../CutTimer";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { NetManager } from "../../../libs/tw/manager/NetManager";
/**
* 红包雨倒计时
*/
export default class HbCutTime extends Panel {
public cutTimeLabel:eui.BitmapLabel;
public cutTime:eui.Image;
public tipImage:eui.Image;
public closeBtn:eui.Button;
public ok_btn:eui.Button;
public ok_bt:eui.Button;
public rule_btn:eui.Button;
public ok_btn:eui.Image;
private cutTimer: CutTimer = null;
......@@ -25,11 +27,37 @@ export default class HbCutTime extends Panel {
}
initUI() {
this.cutTimer = new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒');
if(!this.cutTimer.start(6666666)){
this.hbRainBaseInfo();
}
private hbRainBaseInfo() {
NetManager.ins.hbRainBaseInfo((success, res) => {
if(!success) {
return;
}
let data = res.data;
this.cutTimer = new CutTimer(this.cutTimeLabel, 'hh时mm分ss秒', ()=>this.hbRainBaseInfo());
let sysTime = res.timestamp; // 当前系统事件
let time;
if(data.currentSession){
time = data.currentSession.endTime - sysTime;
if(data.canJoin){
this.ok_btn.source = 'hbCutTime_btn_enable_png';
}else {
this.ok_btn.source = 'hbCutTime_btn_disable_png';
}
this.tipImage.source = 'hbCutTime_cutLine_enable_png';
}else if (data.nextSession) {
time = data.nextSession.startTime - sysTime;
this.ok_btn.source = 'hbCutTime_btn_enable_png';
this.tipImage.source = 'hbCutTime_cutLine_enable_png';
}
if(!this.cutTimer.start(time)) {
this.cutTimer.stop();
this.cutTimer.start(6666666);
this.cutTimer.start(time);
}
})
}
protected onSkinComplete() {
......@@ -42,7 +70,7 @@ export default class HbCutTime extends Panel {
this.rule_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.tapRuleBtn, this);
}
private tapRuleBtn(){
private tapRuleBtn() {
}
......
......@@ -8,6 +8,10 @@ import { DatapashData } from "../../../libs/tw/data/game/datapash/DatapashData";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { NetName } from "../../../libs/tw/enum/NetName";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
import Utils from "../../Utils";
/**
* 红包雨主游戏
......@@ -70,14 +74,37 @@ export default class HbGame extends Panel {
// let session = DataManager.ins.getData(NetName.HBRAIN_BASEINFO).data.currentSession.sessionIndex;
let session = 1;
NetManager.ins.hbRainDoJoin((success, res) => {
// if(!success) {
// return;
// }
const data = res.data;
const code = res.code;
if(!success) {
switch(true) {
case (code == "600015"): // 命中风控参与规则
PanelCtrl.instance.show("HbNoPrize");
break;
case (code == "600016"): // 苏宁风控 命中
PanelCtrl.instance.show("HbNoPrize");
break;
default:
PanelCtrl.instance.show("HbNoPrize");
break;
}
return;
}
if(!res.data.option) {
if(!data.option || data.categoryType == 1) {
PanelCtrl.instance.show("HbNoPrize");
} else {
PanelCtrl.instance.show('HbPrize');
PanelCtrl.instance.show('TurnPrizePanel', data);
}
// if(!res.data.option) {
// PanelCtrl.instance.show("HbNoPrize");
// } else {
// PanelCtrl.instance.show('TurnPrizePanel', res.data);
// }
}, session, this.score);
}
......
import Panel from "../../../libs/new_wx/components/Panel";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import getHomeData from "../../getHomeData";
import { changeMapScene } from "../../startScene/StartScene";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { addAdComp } from "../BoxPanel";
import Utils from "../../Utils";
import CutTimer from "../../CutTimer";
/**
* 红包雨奖励
......
{
"code": "0000000000",
"data": {
"canJoin": true,
"canJoin": false,
"currentRemainTimes": 1,
"currentSession": {
"endTime": 1572921059355,
"endTime": 157292106000,
"sessionIndex": 1,
"startTime": 1572921059355
"startTime": 157292105000
},
"nextSession": {
"endTime": 1572921059355,
"endTime": 157292106000,
"sessionIndex": 2,
"startTime": 1572921059355
"startTime": 157292105000
}
},
"desc": "OK",
"success": true,
"timestamp": 1572921059357
"timestamp": 157292100000
}
\ No newline at end of file
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