/****************************************************************** * * 个人推送界面 * ******************************************************************/ const BridgeWindow = require( "bridge.window" ); const FxSVC = require( "nx.fx.sv.expand" ); const OnceMod = require( "once.rewards.mod" ); cc.Class( { extends: BridgeWindow, properties: { lstRewards: { default: null, type: FxSVC }, }, // 展示 onEnable: function() { // 道具列表 let items = nx.bridge.vget( "OnceRewards" ); this.lstRewards.rebuild( items ); let empty = nx.dt.arrEmpty( items ); nx.gui.setActive( this, "panel/get", !empty ); nx.gui.setActive( this, "panel/off", empty ); }, // 销毁 onDisable: function() { // 视图监听解除 nx.bridge.vunbind( this ); }, // 點擊領取 onTouchReward: function() { OnceMod.getInstance().reqReward( ( _ret ) => { this.close(); } ); }, } );