"use strict"; cc._RF.push(module, '48c05dHOotNS6M/3cFmZC+T', 'act.sign30.mod'); // Scripts/mod/acts/sign30/act.sign30.mod.js "use strict"; /******************************************************************************* * * 活动: 月签到 * * ******************************************************************************/ var ActBase = require("act.base"); var DailyChargeMod = require("act.dailyfirstcharge.mod"); var ActSign30 = cc.Class({ "extends": ActBase, // 初始化配置数据 initConfig: function initConfig() {}, // 注册协议接受事件 registerProtocals: function registerProtocals() { this.RegisterProtocal(21002, this.handle21002.bind(this)); //今日充值次数 // // 前端准备完毕 this.RegisterProtocal(14100, this.GetSignStatus.bind(this)); this.RegisterProtocal(14101, this.GetSignBack.bind(this)); }, // 从服务器初始化数据 reqBaseFromServer: function reqBaseFromServer(_cb) { var _this = this; var cfgs = [this.data.config //付費活動 ]; this.loadConfigs(cfgs, function (_ret, _data) { _this.reqBaseData(_cb); // nx.dt.fnInvoke( _cb, true ); }); }, // 请求剧情信息 reqBaseData: function reqBaseData(_cb) { this.SendProtocal(14100, {}, _cb); }, reqChargeData: function reqChargeData() { var dailycharge = DailyChargeMod.getInstance().vget("dailyfirstCharge"); return dailycharge; }, handle21002: function handle21002(data) { this.openTip("reward", data.count > 0); this.reqBaseData(); }, GetSignStatus: function GetSignStatus(_data) { // nx.bridge.acts.vset("sign30", _data); }, GetSignBack: function GetSignBack(_data) { // {"code":1,"msg":"","day":1,"status":1} if (_data.code == 1) { this.reqBaseData(); } }, reqSign: function reqSign() { var protocal = {}; this.SendProtocal(14101, protocal); }, // ============================================================ // 活动红点提示 // ============================================================ // 活动用到的提示KEY tipKeys: function tipKeys() { return ["sign30"]; } }); // 模块导出 module.exports = ActSign30; cc._RF.pop();