54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
|
|
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 );
|
||
|
|
nx.gui.setString( this.nodMat, "", "X " + this.mdata.point );
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
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.source_id );
|
||
|
|
nx.bridge.closePanel( "WndWreckageCol" );
|
||
|
|
},
|
||
|
|
|
||
|
|
onTouchGet: function(){
|
||
|
|
|
||
|
|
nx.dt.fnInvoke( this.mdata.cb, true );
|
||
|
|
},
|
||
|
|
|
||
|
|
|
||
|
|
});
|