const SvcItem = require( "nx.fx.sv.expand.item" ); cc.Class({ extends: SvcItem, properties: { nodDesc: { default: null, type: cc.Node }, nodMat: { default: null, type: cc.Node }, nodProgress: { default: null, type: cc.Node }, }, // 数据重置 rebind: function( _idx, _data, _key ) { this.index = _idx; this.mdata = _data; this.key = _key || ""; this.setData(); }, setData: function(){ nx.gui.setString( this.nodDesc, "txt", this.mdata.desc ); if( nx.dt.arrNEmpty( this.mdata.award ) ){ nx.gui.setString( this, "award/count", "X " + this.mdata.award[0][1] ); nx.bridge.setIconS( this, "award/icon", this.mdata.award[0][0] ); } }, setExInfo: function( _state ){ nx.gui.setActive( this, "go", _state.finish == 0 ); nx.gui.setActive( this, "get", _state.finish == 1 ); nx.gui.setActive( this, "got", _state.finish == 2 ); nx.gui.setString( this.nodProgress, "val", _state.value ); nx.gui.setString( this.nodProgress, "total", " /" + _state.target_val ); nx.gui.setActive( this.nodProgress, "", _state.finish != -1 ); }, onTouchGo: function(){ nx.bridge.jumper.jump2Window( this.mdata.jump_id ); nx.bridge.closePanel( "WndActDailyTreasure" ); }, onTouchGet: function(){ nx.dt.fnInvoke( this.mdata.cb, true ); }, });