/****************************************************************** * * 道具购买界面 * ******************************************************************/ const ItemBase = require( "cmp.item.base" ); const BridgeWindow = require( "bridge.window" ); cc.Class( { extends: BridgeWindow, properties: { cmpItem: { default: null, type: ItemBase }, nodPrice: { default: null, type: cc.Node }, }, // 重载:参数打开 onOpenConfigs: function( _params ) { this.item = _params.item; this.price = _params.price; this.cb = _params.cb; // 标的 this.cmpItem.setData( this.item ); // 价格 nx.gui.setString( this.nodPrice, "txt", this.price.num ); nx.bridge.setIconS( this.nodPrice, "icon", this.price.bid ); }, // 点击确认 onTouchConfirm: function() { nx.dt.fnInvoke( this.cb, true ); this.close(); }, // 点击关闭 onTouchClose: function() { nx.dt.fnInvoke( this.cb, false ); this.close(); }, } );