Files
fc/dev/project/assets/Scripts/mod/stronger/cmp/cmp.stronger.item.problem.js
T
2026-05-23 22:10:14 +08:00

60 lines
1.1 KiB
JavaScript

const SvcItem = require("nx.fx.sv.expand.item")
cc.Class({
extends: SvcItem,
properties: {
iname:{
default:null,
type:cc.Label
},
btn_tag:{
default:null,
type:cc.Node
},
focus:{
default:null,
type:cc.Node
},
msg_desc:{
default:null,
type:cc.Node
},
msg_box:{
default:null,
type:cc.RichText
}
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start () {
},
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.iname.string = data.name;
},
touchOpen(){
this.btn_tag.scaleY = -this.btn_tag.scaleY;
this.msg_box.string = StringUtil.parse(this.data.desc);
this.msg_desc.active = !this.msg_desc.active;
}
});