Commit 7ea02176 authored by wildfirecode's avatar wildfirecode

1

parent 45ab0317
...@@ -36,7 +36,7 @@ import SceneCtrl from "./ctrls/sceneCtrl"; ...@@ -36,7 +36,7 @@ import SceneCtrl from "./ctrls/sceneCtrl";
import { ModuleTypes } from "./types/sceneTypes"; import { ModuleTypes } from "./types/sceneTypes";
import layers from "./views/layers"; import layers from "./views/layers";
import SignPrizePanel from "../../src/panels/SignPrizePanel"; import SignPrizePanel from "../../src/panels/SignPrizePanel";
import { BLOOD_NUMS_MAX } from "../../src/getHomeData"; import getHomeData, { BLOOD_NUMS_MAX } from "../../src/getHomeData";
import BloodPanel2 from "../../src/panels/BloodPanel2"; import BloodPanel2 from "../../src/panels/BloodPanel2";
import ExchangePanel from "../../src/panels/ExchangePanel"; import ExchangePanel from "../../src/panels/ExchangePanel";
...@@ -329,12 +329,12 @@ timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, () => { ...@@ -329,12 +329,12 @@ timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, () => {
}, this) }, this)
export const mainTimer = timer; export const mainTimer = timer;
export const updateMainTimer = () => { export const updateMainTimer = () => {
const { data } = DataManager.ins.getData('hc_home'); const data = getHomeData();
if (data.remainEnargy >= BLOOD_NUMS_MAX) { if (data.remainEnargy >= BLOOD_NUMS_MAX) {
mainTimer.stop(); mainTimer.stop();
} else { } else {
mainTimer.reset(); mainTimer.reset();
const left = data.countdown - Math.floor(new Date().getTime() / 1000); const left = data.refectionCountdown - Math.floor(new Date().getTime() / 1000);
mainTimer.repeatCount = left; mainTimer.repeatCount = left;
if (left >= 0) if (left >= 0)
mainTimer.start(); mainTimer.start();
......
...@@ -1780,6 +1780,9 @@ export class NetManager extends ABNetManager { ...@@ -1780,6 +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') {
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);
//接口成功 //接口成功
......
...@@ -17,6 +17,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager"; ...@@ -17,6 +17,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main"; import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import wait from "../../libs/new_tc/wait"; import wait from "../../libs/new_tc/wait";
import { updateMainTimerAfterGetData } from "../../libs/new_wx/MainBase";
export default class StartPanel extends Panel { export default class StartPanel extends Panel {
private _level; private _level;
...@@ -102,6 +103,7 @@ export default class StartPanel extends Panel { ...@@ -102,6 +103,7 @@ export default class StartPanel extends Panel {
// Loading.instace.hide(); // Loading.instace.hide();
this.touchChildren = true; this.touchChildren = true;
this.touchEnabled = true; this.touchEnabled = true;
updateMainTimerAfterGetData();
if (success) { if (success) {
// Loading.instace.show(); // Loading.instace.show();
try { try {
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
"desc": "OK", "desc": "OK",
"timestamp": 1566885811001, "timestamp": 1566885811001,
"data": { "data": {
"countdown": 1569058731, "refectionCountdown": 100,
"remainEnargy": 5, "remainEnargy": 4,
"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