108 lines
3.1 KiB
JavaScript
108 lines
3.1 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '7e8998FFeFKpqOXchznpDzj', 'cmp.bag.noitem.source.wnd');
|
|
// Scripts/mod/backpack/cmps/cmp.bag.noitem.source.wnd.js
|
|
|
|
"use strict";
|
|
|
|
var ItemBase = require("cmp.item.base");
|
|
var SVCItem = require("nx.fx.sv.expand.item");
|
|
var BridgeWindow = require("bridge.window");
|
|
var BackPackConst = require("backpack_const");
|
|
cc.Class({
|
|
"extends": BridgeWindow,
|
|
properties: {
|
|
nodBase: {
|
|
"default": null,
|
|
type: cc.Node,
|
|
displayName: "基础栏"
|
|
},
|
|
nodContent: {
|
|
"default": null,
|
|
type: cc.Node,
|
|
displayName: "详情栏"
|
|
}
|
|
},
|
|
// 载入
|
|
onLoad: function onLoad() {},
|
|
// 重载:参数打开
|
|
onOpenConfigs: function onOpenConfigs(_params) {
|
|
this.setData(_params);
|
|
},
|
|
// 重置
|
|
setData: function setData(_data) {
|
|
// 置空
|
|
this.mdata = _data.data;
|
|
this.item = BackPackConst.uniformData(_data.data);
|
|
if (!this.item) {
|
|
this.mdata = {};
|
|
return;
|
|
}
|
|
|
|
// 统一道具信息格式
|
|
// this.info = BridgeItem.data2Icon( _data );
|
|
this.config = this.item.config;
|
|
|
|
// 刷新
|
|
this.freshAll();
|
|
},
|
|
// 刷新
|
|
freshAll: function freshAll() {
|
|
// 空
|
|
if (nx.dt.objEmpty(this.item)) {
|
|
return;
|
|
}
|
|
// 显隐藏
|
|
nx.gui.setOpacity(this.node, "", 255);
|
|
nx.gui.hideAllChildren(this.nodBase, "");
|
|
nx.gui.hideAllChildren(this.nodContent, "");
|
|
|
|
// 后刷新
|
|
this.updHeader();
|
|
this.updDesc();
|
|
this.updSources();
|
|
},
|
|
// 基础信息刷新
|
|
updHeader: function updHeader() {
|
|
var cmp = nx.gui.getComponent(this.nodBase, "", "cmp.item.detail.header");
|
|
if (cmp) {
|
|
cmp.setData(this.item, this.config, this.fromBag);
|
|
}
|
|
},
|
|
// 基础属性刷新
|
|
updBaseProps: function updBaseProps() {
|
|
var cmp = nx.gui.getComponent(this.nodContent, "base/lst", "cmp.item.detail.prop.base");
|
|
if (cmp && cmp.setData(this.item, this.config, this.fromBag)) {
|
|
nx.gui.setActive(this.nodContent, "base", true);
|
|
}
|
|
},
|
|
// 套装属性刷新
|
|
updSuitProps: function updSuitProps() {
|
|
var cmp = nx.gui.getComponent(this.nodContent, "suit/lst", "cmp.item.detail.prop.suit");
|
|
if (cmp && cmp.setData(this.item, this.config, this.fromBag)) {
|
|
nx.gui.setActive(this.nodContent, "suit", true);
|
|
}
|
|
},
|
|
upSkill: function upSkill() {
|
|
var cmp = nx.gui.getComponent(this.nodContent, "skill/lst", "cmp.item.detail.prop.skill");
|
|
if (cmp && cmp.setData(this.item, this.config, this.fromBag)) {
|
|
nx.gui.setActive(this.nodContent, "skill", true);
|
|
}
|
|
},
|
|
// 描述信息刷新
|
|
updDesc: function updDesc() {
|
|
var node = nx.gui.setActive(this.nodContent, "desc", true);
|
|
if (!node || nx.dt.objEmpty(this.config) || nx.dt.strEmpty(this.config.desc)) {
|
|
return;
|
|
}
|
|
nx.gui.setStringRich(node, "txt", nx.text.getKey(this.config.desc));
|
|
},
|
|
// 来源刷新
|
|
updSources: function updSources() {
|
|
var cmp = nx.gui.getComponent(this.nodContent, "source/lst", "cmp.item.detail.source");
|
|
if (cmp && cmp.setData(this.item, this.config, this.fromBag)) {
|
|
nx.gui.setActive(this.nodContent, "source", true);
|
|
}
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |