"use strict"; cc._RF.push(module, 'a7d9azxFDpLQaFfSRhFVGM7', 'cmp.daily.wnd'); // Scripts/mod/task/cmp/cmp.daily.wnd.js "use strict"; /****************************************************************** * * 日常任务 * ******************************************************************/ var BridgeWindow = require("bridge.window"); var FxSVC = require("nx.fx.sv.expand"); var TaskEvent = require("task_event"); var TaskController = require("task_controller"); var RoleController = require("role_controller"); cc.Class({ "extends": BridgeWindow, properties: { nodBoxes: { "default": [], type: cc.Node }, svcList: { "default": null, type: FxSVC } }, // 重载:关闭前 onPreClosed: function onPreClosed() { this.svcList.rebuild([]); }, onLoad: function onLoad() { // 事件监听 this.bindGEvent(TaskEvent.UpdateTaskList, this.updateTaskList.bind(this)); // 更新 this.updateTaskList(); nx.gui.setActive(this, "panel/hideall", false); }, // 任务更新 updateTaskList: function updateTaskList() { var model = TaskController.getInstance().getModel(); var lst = model ? model.getTaskList() : []; nx.gui.setActive(this, "panel/tasks/empty", nx.dt.arrEmpty(lst)); this.svcList.rebuild(lst); }, onTouchHideAllDesc: function onTouchHideAllDesc() { for (var i = 0; i < this.nodBoxes.length; i++) { var nod = this.nodBoxes[i]; nx.gui.setActive(nod, "show", false); } // let nod = nx.gui.setActive(this, "panel/hideall", false); } }); cc._RF.pop();