Commit cf3426ce authored by wildfirecode's avatar wildfirecode

1

parent 2410f6a3
......@@ -190,5 +190,16 @@
"useBgColor": true,
"backgroundColor": "#c1c1c1",
"backgroundAlpha": 100
},
"16d5c2563ca": {
"bindingDataTestObj": []
},
"16d5c2563cb": {
"bindingDataTestObj": [
{
"key": "data.img",
"value": "http://yun.duiba.com.cn/babi/img/bm2ryg8wht.gif"
}
]
}
}
\ No newline at end of file
......@@ -277,8 +277,6 @@ export default class MainBase extends eui.UILayer {
const result = DataManager.ins.getData('getShareInfo');
window['registerWX'](result);
});
updateMainTimer();
}
}
......@@ -304,16 +302,19 @@ export default class MainBase extends eui.UILayer {
playGameBg();
}
NetManager.ins.hc_home(() => {
updateMainTimer();
//更新bloodpanel和mapscene
const currentScene = SceneCtrl.instance.currentScene;
if (currentScene && currentScene['updateTimerView'])
currentScene['updateTimerView']();
const current = PanelCtrl.instance._current;
if (current && current['updateTimerView'])
current['updateTimerView']();
}, window['collectRuleId']);
if(timerInit) {
NetManager.ins.hc_home(() => {
updateMainTimer();
//更新bloodpanel和mapscene
const currentScene = SceneCtrl.instance.currentScene;
if (currentScene && currentScene['updateTimerView'])
currentScene['updateTimerView']();
const current = PanelCtrl.instance._current;
if (current && current['updateTimerView'])
current['updateTimerView']();
}, window['collectRuleId']);
}
}
if (document.visibilityState == "hidden") {
......@@ -324,7 +325,15 @@ export default class MainBase extends eui.UILayer {
}
}
let timerInit=false;
export const initTimer = ()=>{
if(timerInit) return;
timerInit=true;
const data = getHomeData();
if(data.refectionCountdown==0) data.refectionCountdown = 2;
data.refectionCountdown += Math.floor(new Date().getTime()/1000);
updateMainTimer();
}
const timer = new egret.Timer(1000);
timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, () => {
NetManager.ins.hc_home(() => {
......
......@@ -1780,9 +1780,9 @@ export class NetManager extends ABNetManager {
* @param result 结果
*/
protected onResponse(net: INetData, result: any): void {
if(net.name == 'hc_home') {
result.data.refectionCountdown += Math.floor(new Date().getTime()/1000);
}
// if(net.name == 'hc_home') {
// result.data.refectionCountdown += Math.floor(new Date().getTime()/1000);
// }
//数据处理
const data: Data = DataManager.ins.updateData(net.name, result, net.param);
//接口成功
......
......@@ -79,6 +79,10 @@
{
"keys": "购买炸弹_png",
"name": "exchange"
},
{
"name": "preload",
"keys": "signprize_btn_png,singprizebg_png"
}
],
"resources": [
......@@ -1716,6 +1720,16 @@
"url": "assets/blood2/blood2按钮 副本.png",
"type": "image",
"name": "blood2按钮 副本_png"
},
{
"name": "signprize_btn_png",
"type": "image",
"url": "assets/signprize/signprize_btn.png"
},
{
"name": "singprizebg_png",
"type": "image",
"url": "assets/signprize/singprizebg.png"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="SignPrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui">
<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"/>
<e:Image source="singprizebg_png" y="20" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="604" y="164">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="close2Btn" label="" y="564" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="signprize_btn_png" source.down="signprize_btn_png" source.disabled="signprize_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Image id="img" y="297" touchEnabled="true" source="{data.img}" width="512" height="240" scaleX="1" scaleY="1" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
......@@ -43,6 +43,7 @@ export default class CountDown extends egret.EventDispatcher {
this._timer.stop();
this._timer.repeatCount = repeatCount;
this._timer.reset();
if(repeatCount > 0)
this._timer.start();
this.updateTxt();
}
......
......@@ -18,6 +18,7 @@ import setGray from "../setGray";
import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
import CountDown from "./CountDown";
import { initTimer } from "../../libs/new_wx/MainBase";
export default class MapScene extends Scene {
scrollGroup: eui.Group;
......@@ -31,6 +32,7 @@ export default class MapScene extends Scene {
async start(data?) {
super.start();
initTimer();
if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
playBg();
}
......
......@@ -3,6 +3,11 @@ import Panel from "../../libs/new_wx/components/Panel";
export default class SignPanel extends Panel {
start(data) {
super.start();
//要更新元宝数量
// this['close2Btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// NetManager.ins.clickLog(getlogItem(17));
......
......@@ -4,8 +4,8 @@
"desc": "OK",
"timestamp": 1566885811001,
"data": {
"refectionCountdown": 10,
"remainEnargy": 4,
"refectionCountdown": 0,
"remainEnargy": 5,
"isGetAllTreasureBox": 0,
"wealth": 7960,
"totalStars": 145,
......
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