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