52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'cbd78nYLexJPrv/Yv4cUChu', 'cmp.item.buy.wnd');
|
|
// Scripts/mod/backpack/cmps/cmp.item.buy.wnd.js
|
|
|
|
"use strict";
|
|
|
|
/******************************************************************
|
|
*
|
|
* 道具购买界面
|
|
*
|
|
******************************************************************/
|
|
|
|
var ItemBase = require("cmp.item.base");
|
|
var BridgeWindow = require("bridge.window");
|
|
cc.Class({
|
|
"extends": BridgeWindow,
|
|
properties: {
|
|
cmpItem: {
|
|
"default": null,
|
|
type: ItemBase
|
|
},
|
|
nodPrice: {
|
|
"default": null,
|
|
type: cc.Node
|
|
}
|
|
},
|
|
// 重载:参数打开
|
|
onOpenConfigs: function onOpenConfigs(_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 onTouchConfirm() {
|
|
nx.dt.fnInvoke(this.cb, true);
|
|
this.close();
|
|
},
|
|
// 点击关闭
|
|
onTouchClose: function onTouchClose() {
|
|
nx.dt.fnInvoke(this.cb, false);
|
|
this.close();
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |