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