"use strict"; cc._RF.push(module, '0947axEOhdB+pV0S6X7fNuN', 'act.optionalgift.mod'); // Scripts/mod/acts/optionalgift/act.optionalgift.mod.js "use strict"; /******************************************************************************* * * 活动: 超值自選礼包 --- 破冰 * * ******************************************************************************/ var ActBase = require("act.base"); var ActOptionalGift = cc.Class({ "extends": ActBase, // 初始化配置数据 initConfig: function initConfig() { // 视图附着 nx.plugin.add(this, ["view"]); this.vattach("Acts"); }, // 注册协议接受事件 registerProtocals: function registerProtocals() { this.RegisterProtocal(21051, this.getOptionalGift.bind(this)); // 請求子活動相關,來取相關的顯示數據 this.RegisterProtocal(21052, this.getOptionalGiftSelect.bind(this)); // 請求領取子活動獎勵相關,來取相關的顯示數據 }, // 从服务器初始化数据 reqBaseFromServer: function reqBaseFromServer(_cb) { var _this = this; var cfgs = [this.data.config //付費活動 ]; this.loadConfigs(cfgs, function (_ret, _data) { _this.reqBaseData(_cb); }); }, // 请求活动信息 reqBaseData: function reqBaseData(_cb) { this.reqOptionalGift(_cb); }, // ============================================================ // 自選陣容 // ============================================================ // 请求 自選陣容信息 reqOptionalGift: function reqOptionalGift(_cb) { this.SendProtocal(21051, {}, _cb); }, // 请求設置 自選陣容 夥伴--- camp_id getOptionalGift: function getOptionalGift(_data) { this.vset("optionalGift", _data); }, // 请求 選擇超值自選 道具 reqOptionalSelect: function reqOptionalSelect(_id, _list) { var data = { id: _id, item_list: _list }; this.SendProtocal(21052, data); }, // 選擇超值自選 返回 getOptionalGiftSelect: function getOptionalGiftSelect(_data) { this.vset("optionalGiftSaveBack", _data.code); if (nx.dt.strNEmpty(_data.msg)) { nx.tbox(_data.msg); } } }); // 模块导出 module.exports = ActOptionalGift; cc._RF.pop();