51 lines
1.0 KiB
JavaScript
51 lines
1.0 KiB
JavaScript
|
|
// Learn cc.Class:
|
||
|
|
const 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( _idx, _data, _key ) {
|
||
|
|
|
||
|
|
this._super( _idx, _data, _key );
|
||
|
|
|
||
|
|
// 刷新
|
||
|
|
this.setData(this.mdata)
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
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 () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
touchClickGo(){
|
||
|
|
StrongerController.getInstance().clickCallBack(this.data.evt_type)
|
||
|
|
}
|
||
|
|
|
||
|
|
// update (dt) {},
|
||
|
|
});
|