"use strict"; cc._RF.push(module, '9cacf3WR8ZFh7SNHwXa+Vlg', 'cmp.foreshow.menu.item'); // Scripts/mod/acts/cmps/cmp.foreshow.menu.item.js "use strict"; /****************************************************************** * * 活动预报菜单项 * ******************************************************************/ var SvcItem = require("nx.fx.sv.expand.item"); cc.Class({ "extends": SvcItem, properties: { nodIco: { "default": null, type: cc.Node } }, // 数据重置 rebind: function rebind(_idx, _data, _key) { this._super(_idx, _data, _key); // 刷新 this.fresh(); }, // 聚焦获得 onFocus: function onFocus() { nx.gui.setActive(this, "on", true); nx.gui.setActive(this, "off", false); }, // 聚焦失去 outFocus: function outFocus() { nx.gui.setActive(this, "on", false); nx.gui.setActive(this, "off", true); }, // 刷新 fresh: function fresh() { this.outFocus(); var 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)); } }); cc._RF.pop();