Files
fc/dev/project/library/imports/b4/b4159660-fa01-4126-b655-02a9c05cce7c.js
2026-05-24 10:21:26 +08:00

79 lines
2.5 KiB
JavaScript

"use strict";
cc._RF.push(module, 'b4159Zg+gFBJrZVAqnAXM58', 'cmp.partner.equip.changed.wnd');
// Scripts/mod/partner/cmps/basic/cmp.partner.equip.changed.wnd.js
"use strict";
/******************************************************************
*
* 装备更换弹窗
*
******************************************************************/
var BridgeWindow = require("bridge.window");
var ItemDesc = require("cmp.item.detail");
var BackPackConst = require("backpack_const");
var TipsController = require("tips_controller");
var BIT = BackPackConst.item_type;
cc.Class({
"extends": BridgeWindow,
properties: {
itemDesc: {
"default": null,
type: ItemDesc,
displayName: "道具详情"
},
nodOps: {
"default": null,
type: cc.Node,
displayName: "操作组"
}
},
// 重载:参数打开
onOpenConfigs: function onOpenConfigs(_params) {
var initparams = _params;
this.bid = _params.data.config ? _params.data.config.id : _params.data.base_id;
var type = _params.data.config ? _params.data.config.type : 0;
var noop = _params.data.noop;
var show = {};
if (noop) {
nx.gui.setActive(this.nodOps, "", false);
show = BackPackConst.uniformData(_params.data.base_id);
show.extra = initparams.data.extra;
} else {
show = initparams.data;
if (type == BIT.ARTIFACTCHIPS) {
nx.gui.setActive(this.nodOps, "refinement", true);
} else if ((type == BIT.GOD_EARRING || type == BIT.GOD_RING || type == BIT.GOD_NECKLACE || type == BIT.GOD_BANGLE) && _params.data) {
nx.gui.setActive(this.nodOps, "refinement", !nx.dt.arrEmpty(_params.data.holy_eqm_attr) && _params.data.config.eqm_jie >= 1);
} else {
nx.gui.setActive(this.nodOps, "refinement", false);
}
nx.gui.setActive(this.nodOps, "", true);
}
console.log("当前的数据显示相关" + JSON.stringify(show));
// if( _params.data. )
this.cb = _params.cb ? _params.cb : "";
this.itemDesc.setData(show, "partner");
},
// 点击更换
onTouchChange: function onTouchChange() {
nx.dt.fnInvoke(this.cb, "change", this);
},
// 点击脱下
onTouchTakeOff: function onTouchTakeOff() {
nx.dt.fnInvoke(this.cb, "takeoff", this);
},
// 点击脱下
onTouchRefinement: function onTouchRefinement() {
nx.dt.fnInvoke(this.cb, "refinement", this);
},
onTouchRandom: function onTouchRandom() {
var TC = TipsController.getInstance();
if (TC) {
TC.showItemRandomTips(true, this.bid);
}
}
});
cc._RF.pop();