Files
fc/dev/project/library/imports/f6/f63bd303-fd8e-4117-83aa-e246ca759279.js
T
2026-05-24 10:21:26 +08:00

80 lines
2.3 KiB
JavaScript

"use strict";
cc._RF.push(module, 'f63bdMD/Y5BF4Oq4kbKdZJ5', 'act.collect.item');
// Scripts/mod/acts/collect/cmp/act.collect.item.js
"use strict";
var SVCItem = require("nx.fx.sv.expand.item");
var _require = require("bridge.utils.item"),
data2Icon = _require.data2Icon;
cc.Class({
"extends": SVCItem,
properties: {},
// 数据重置
rebind: function rebind(_idx, _data, _key) {
this._super(_idx, _data, _key);
this.freshInfo();
},
// 刷新具体信息
freshInfo: function freshInfo() {
if (!this.mdata) {
return;
}
var ifg = data2Icon(this.mdata.face_id);
var showIdcon = ifg.icon;
nx.bridge.setIcon(this, "header", showIdcon);
var idpath = "prefab/acts/collect/ui/bg_" + this.mdata.quality;
nx.gui.setSpriteFrame(this, "bg", idpath);
nx.gui.setString(this, "ico/txt", nx.text.format("MustTip", this.mdata.must));
nx.gui.setActive(this, "ico", this.mdata.is_show != 0);
nx.bridge.setIcon(this, "get/header", showIdcon);
var path = "prefab/acts/collect/ui/bg_0" + this.mdata.quality;
nx.gui.setSpriteFrame(this, "get/bg", path);
nx.gui.setActive(this, "get", this.mdata.status != 0);
nx.gui.setActive(this, "ico", this.mdata.status == 0 && this.mdata.is_show == 1);
var spine = nx.gui.getComponent(this, "bgspine", "nx.fx.spine");
var spinepath = "";
switch (this.mdata.quality) {
case 2:
{
spinepath = "resDB/effects/E90906/action";
}
;
break;
case 3:
{
spinepath = "resDB/effects/E90907/action";
}
;
break;
case 4:
{
spinepath = "resDB/effects/E90908/action";
}
;
break;
case 5:
{
spinepath = "resDB/effects/E90909/action";
}
;
break;
}
if (spine) {
spine.load(spinepath, function (_e) {
if (!_e) {
spine.action("action", true, function (_event) {});
} else {
spine.stop();
}
});
}
nx.gui.setActive(this, "bgspine", this.mdata.status == 0);
nx.gui.setActive(this, "focus", false);
// nx.tween.fadeOut( this, "focus", 0.01 );
nx.gui.setActive(this, "itemnormal", false);
nx.gui.setActive(this, "item", false);
}
});
cc._RF.pop();