50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '737d1GBCc1IbaFjfPGt3OLh', 'cmp.pvprank.firstitem');
|
||
|
|
// Scripts/mod/pvp/rank/cmp/cmp.pvprank.firstitem.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
var ItemBase = require("nx.fx.sv.expand.item");
|
||
|
|
var ItemLay = require("cmp.common.itemlayout");
|
||
|
|
cc.Class({
|
||
|
|
"extends": ItemBase,
|
||
|
|
properties: {
|
||
|
|
items: {
|
||
|
|
"default": null,
|
||
|
|
type: ItemLay
|
||
|
|
},
|
||
|
|
nodDesc: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// LIFE-CYCLE CALLBACKS:
|
||
|
|
onLoad: function onLoad() {},
|
||
|
|
// 数据重置
|
||
|
|
rebind: function rebind(_idx, _data, _key) {
|
||
|
|
this._super(_idx, _data, _key);
|
||
|
|
|
||
|
|
// 刷新
|
||
|
|
this.setData(_data);
|
||
|
|
},
|
||
|
|
setData: function setData(data) {
|
||
|
|
if (nx.dt.objEmpty(data)) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
this.setEmpty();
|
||
|
|
nx.gui.setString(this.nodDesc, "", data.name);
|
||
|
|
if (data.items) {
|
||
|
|
this.items.rebuild(data.items);
|
||
|
|
}
|
||
|
|
nx.gui.setSpriteFrame(this, "idx1/lev", data.path);
|
||
|
|
},
|
||
|
|
setEmpty: function setEmpty() {
|
||
|
|
this.items.rebuild([]);
|
||
|
|
nx.gui.setString(this.nodDesc, "", "");
|
||
|
|
},
|
||
|
|
onDisable: function onDisable() {
|
||
|
|
this.items.rebuild([]);
|
||
|
|
} // update (dt) {},
|
||
|
|
});
|
||
|
|
|
||
|
|
cc._RF.pop();
|