/******************************************************************************* * * 活动: 翻倍紅包 * * ******************************************************************************/ const ActBase = require( "act.base" ); const DoubleRed = cc.Class( { extends: ActBase, // 初始化配置数据 initConfig: function() { // 视图附着 nx.plugin.add( this, [ "view" ] ); this.vattach( "Acts" ); }, // 注册协议接受事件 registerProtocals: function() { // // 前端准备完毕 this.RegisterProtocal( 21040, this.GetDoubleRedStatus.bind( this ) ); }, // 从服务器初始化数据 reqBaseFromServer: function( _cb ) { let cfgs = [ this.data.config,//付費活動 ] this.loadConfigs( cfgs, ( _ret, _data ) =>{ nx.dt.fnInvoke( _cb, true ); this.reqDoubleRedData(); } ) }, // 请求每日首次充值數據 reqDoubleRedData: function( _cb ) { this.SendProtocal( 21040, {}, _cb ); }, GetDoubleRedStatus: function( _data ){ this.vset( "doublered", _data ); }, } ); // 模块导出 module.exports = DoubleRed;