Commit cf3426ce authored by wildfirecode's avatar wildfirecode

1

parent 2410f6a3
...@@ -190,5 +190,16 @@ ...@@ -190,5 +190,16 @@
"useBgColor": true, "useBgColor": true,
"backgroundColor": "#c1c1c1", "backgroundColor": "#c1c1c1",
"backgroundAlpha": 100 "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 { ...@@ -277,8 +277,6 @@ export default class MainBase extends eui.UILayer {
const result = DataManager.ins.getData('getShareInfo'); const result = DataManager.ins.getData('getShareInfo');
window['registerWX'](result); window['registerWX'](result);
}); });
updateMainTimer();
} }
} }
...@@ -304,16 +302,19 @@ export default class MainBase extends eui.UILayer { ...@@ -304,16 +302,19 @@ export default class MainBase extends eui.UILayer {
playGameBg(); playGameBg();
} }
NetManager.ins.hc_home(() => { if(timerInit) {
updateMainTimer(); NetManager.ins.hc_home(() => {
//更新bloodpanel和mapscene updateMainTimer();
const currentScene = SceneCtrl.instance.currentScene; //更新bloodpanel和mapscene
if (currentScene && currentScene['updateTimerView']) const currentScene = SceneCtrl.instance.currentScene;
currentScene['updateTimerView'](); if (currentScene && currentScene['updateTimerView'])
const current = PanelCtrl.instance._current; currentScene['updateTimerView']();
if (current && current['updateTimerView']) const current = PanelCtrl.instance._current;
current['updateTimerView'](); if (current && current['updateTimerView'])
}, window['collectRuleId']); current['updateTimerView']();
}, window['collectRuleId']);
}
} }
if (document.visibilityState == "hidden") { if (document.visibilityState == "hidden") {
...@@ -324,7 +325,15 @@ export default class MainBase extends eui.UILayer { ...@@ -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); const timer = new egret.Timer(1000);
timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, () => { timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, () => {
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
......
...@@ -1780,9 +1780,9 @@ export class NetManager extends ABNetManager { ...@@ -1780,9 +1780,9 @@ export class NetManager extends ABNetManager {
* @param result 结果 * @param result 结果
*/ */
protected onResponse(net: INetData, result: any): void { protected onResponse(net: INetData, result: any): void {
if(net.name == 'hc_home') { // if(net.name == 'hc_home') {
result.data.refectionCountdown += Math.floor(new Date().getTime()/1000); // result.data.refectionCountdown += Math.floor(new Date().getTime()/1000);
} // }
//数据处理 //数据处理
const data: Data = DataManager.ins.updateData(net.name, result, net.param); const data: Data = DataManager.ins.updateData(net.name, result, net.param);
//接口成功 //接口成功
......
...@@ -79,6 +79,10 @@ ...@@ -79,6 +79,10 @@
{ {
"keys": "购买炸弹_png", "keys": "购买炸弹_png",
"name": "exchange" "name": "exchange"
},
{
"name": "preload",
"keys": "signprize_btn_png,singprizebg_png"
} }
], ],
"resources": [ "resources": [
...@@ -1716,6 +1720,16 @@ ...@@ -1716,6 +1720,16 @@
"url": "assets/blood2/blood2按钮 副本.png", "url": "assets/blood2/blood2按钮 副本.png",
"type": "image", "type": "image",
"name": "blood2按钮 副本_png" "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"?> <?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> </e:Skin>
\ No newline at end of file
...@@ -43,6 +43,7 @@ export default class CountDown extends egret.EventDispatcher { ...@@ -43,6 +43,7 @@ export default class CountDown extends egret.EventDispatcher {
this._timer.stop(); this._timer.stop();
this._timer.repeatCount = repeatCount; this._timer.repeatCount = repeatCount;
this._timer.reset(); this._timer.reset();
if(repeatCount > 0)
this._timer.start(); this._timer.start();
this.updateTxt(); this.updateTxt();
} }
......
...@@ -18,6 +18,7 @@ import setGray from "../setGray"; ...@@ -18,6 +18,7 @@ import setGray from "../setGray";
import { loadSvga } from "../loadSvga"; import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath"; import getResPath from "../../libs/new_tc/getResPath";
import CountDown from "./CountDown"; import CountDown from "./CountDown";
import { initTimer } from "../../libs/new_wx/MainBase";
export default class MapScene extends Scene { export default class MapScene extends Scene {
scrollGroup: eui.Group; scrollGroup: eui.Group;
...@@ -31,6 +32,7 @@ export default class MapScene extends Scene { ...@@ -31,6 +32,7 @@ export default class MapScene extends Scene {
async start(data?) { async start(data?) {
super.start(); super.start();
initTimer();
if (getBgOn() && MapScene['firstPlayBgTag'] == true) { if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
playBg(); playBg();
} }
......
...@@ -3,6 +3,11 @@ import Panel from "../../libs/new_wx/components/Panel"; ...@@ -3,6 +3,11 @@ import Panel from "../../libs/new_wx/components/Panel";
export default class SignPanel extends Panel { export default class SignPanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
//要更新元宝数量
// this['close2Btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { // this['close2Btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// NetManager.ins.clickLog(getlogItem(17)); // NetManager.ins.clickLog(getlogItem(17));
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
"desc": "OK", "desc": "OK",
"timestamp": 1566885811001, "timestamp": 1566885811001,
"data": { "data": {
"refectionCountdown": 10, "refectionCountdown": 0,
"remainEnargy": 4, "remainEnargy": 5,
"isGetAllTreasureBox": 0, "isGetAllTreasureBox": 0,
"wealth": 7960, "wealth": 7960,
"totalStars": 145, "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