const SvcItem = require( "nx.fx.sv.expand.item" ); const ItemBase = require( "cmp.item.base" ); cc.Class({ extends: SvcItem, properties: { nodItem: { default: null, type: ItemBase }, nodMatCount: { default: null, type: cc.Node }, nodLimit: { default: null, type: cc.Node }, nodSellOut: { default: null, type: cc.Node }, }, // 数据重置 rebind: function( _idx, _data, _key ) { this.index = _idx; this.mdata = _data; this.key = _key || ""; this.setData(); }, setData: function(){ this.nodItem.setData( this.mdata.reward ); nx.gui.setString( this.nodMatCount, "", this.mdata.point ); nx.gui.setActive( this.nodSellOut, "", false ); }, // 設置相關的限購數據 setExData: function( _exinfo ){ nx.gui.setString( this.nodLimit, "txt", _exinfo.buy_num + "/" + _exinfo.max_num ); nx.gui.setActive( this.nodSellOut, "", _exinfo.buy_num == _exinfo.max_num ); }, onTouchSellOut: function(){ nx.tbox( "act_wreckageCol_tip" ); }, });