48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '56103qLb61CJ76FHXJKuWEi', 'cmp.stronger.item.sec');
|
|
// Scripts/mod/stronger/cmp/cmp.stronger.item.sec.js
|
|
|
|
"use strict";
|
|
|
|
// Learn cc.Class:
|
|
var SvcItem = require("nx.fx.sv.expand.item");
|
|
var StrongerController = require("stronger_controller");
|
|
cc.Class({
|
|
"extends": SvcItem,
|
|
properties: {
|
|
title: {
|
|
"default": null,
|
|
type: cc.Label
|
|
},
|
|
pname: {
|
|
"default": null,
|
|
type: cc.Label
|
|
}
|
|
},
|
|
// 数据重置
|
|
rebind: function rebind(_idx, _data, _key) {
|
|
this._super(_idx, _data, _key);
|
|
|
|
// 刷新
|
|
this.setData(this.mdata);
|
|
},
|
|
setData: function setData(data) {
|
|
if (nx.dt.objEmpty(data)) {
|
|
return false;
|
|
}
|
|
this.data = data;
|
|
this.title.string = data.desc;
|
|
this.pname.string = data.name;
|
|
|
|
// let res = PathTool.getIconPath("items",data.icon);
|
|
// cc.loader.loadRes(res,cc.SpriteFrame,(err,spr)=>{
|
|
// this.goods_icon.spriteFrame = spr;
|
|
// });
|
|
},
|
|
start: function start() {},
|
|
touchClickGo: function touchClickGo() {
|
|
StrongerController.getInstance().clickCallBack(this.data.evt_type);
|
|
} // update (dt) {},
|
|
});
|
|
|
|
cc._RF.pop(); |