Files
2026-05-23 22:10:14 +08:00

48 lines
1.1 KiB
JavaScript

/******************************************************************
*
* 道具购买界面
*
******************************************************************/
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();
},
} );