54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
/******************************************************************
|
|
*
|
|
* 活动预报菜单项
|
|
*
|
|
******************************************************************/
|
|
|
|
const SvcItem = require( "nx.fx.sv.expand.item" )
|
|
|
|
cc.Class( {
|
|
|
|
extends: SvcItem,
|
|
|
|
properties: {
|
|
nodIco: { default: null, type: cc.Node }
|
|
},
|
|
|
|
// 数据重置
|
|
rebind: function( _idx, _data, _key ) {
|
|
|
|
this._super( _idx, _data, _key );
|
|
|
|
// 刷新
|
|
this.fresh();
|
|
|
|
},
|
|
|
|
// 聚焦获得
|
|
onFocus: function() {
|
|
nx.gui.setActive( this, "on", true );
|
|
nx.gui.setActive( this, "off", false );
|
|
},
|
|
|
|
// 聚焦失去
|
|
outFocus: function() {
|
|
nx.gui.setActive( this, "on", false );
|
|
nx.gui.setActive( this, "off", true );
|
|
},
|
|
|
|
// 刷新
|
|
fresh: function() {
|
|
|
|
this.outFocus();
|
|
|
|
let txt = nx.text.getKey( this.mdata.name );
|
|
nx.gui.setString( this, "off/txt", txt );
|
|
nx.gui.setString( this, "on/txt", txt );
|
|
|
|
// nx.gui.setActive( this, "new", this.mdata.is_new == 1 );
|
|
nx.gui.setSpriteFrame( this.nodIco, "", cc.path.join( "prefab/acts/coms/ui/" + this.mdata.ico ) );
|
|
|
|
},
|
|
|
|
} );
|