70 lines
2.0 KiB
JavaScript
70 lines
2.0 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '2ec06sPIdpLbZ2f6NuAH5yW', 'act.dailyfirstcharge.mod');
|
|
// Scripts/mod/acts/dailyfirstcharge/act.dailyfirstcharge.mod.js
|
|
|
|
"use strict";
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* 活动: 每日首次充值
|
|
*
|
|
*
|
|
******************************************************************************/
|
|
|
|
var ActBase = require("act.base");
|
|
var ActDayCharge = cc.Class({
|
|
"extends": ActBase,
|
|
// 初始化配置数据
|
|
initConfig: function initConfig() {
|
|
// 视图附着
|
|
nx.plugin.add(this, ["view"]);
|
|
this.vattach("Acts");
|
|
},
|
|
// 注册协议接受事件
|
|
registerProtocals: function registerProtocals() {
|
|
// // 前端准备完毕
|
|
this.RegisterProtocal(21010, this.GetDailyChargeStatus.bind(this));
|
|
this.RegisterProtocal(21011, this.GetDailyChargeBack.bind(this));
|
|
},
|
|
// 从服务器初始化数据
|
|
reqBaseFromServer: function reqBaseFromServer(_cb) {
|
|
var _this = this;
|
|
var cfgs = [this.data.config //付費活動
|
|
];
|
|
|
|
this.loadConfigs(cfgs, function (_ret, _data) {
|
|
_this.reqDailyFChargeData(_cb);
|
|
// nx.dt.fnInvoke( _cb, true );
|
|
});
|
|
},
|
|
|
|
// 请求每日首次充值數據
|
|
reqDailyFChargeData: function reqDailyFChargeData(_cb) {
|
|
this.SendProtocal(21010, {}, _cb);
|
|
},
|
|
GetDailyChargeStatus: function GetDailyChargeStatus(_data) {
|
|
nx.bridge.acts.vset("dailyfirstCharge", _data);
|
|
this.openTip("reward", _data.status == 1);
|
|
},
|
|
GetDailyChargeBack: function GetDailyChargeBack(_data) {
|
|
// {"code":1,"msg":"","day":1,"status":1}
|
|
if (_data.code == 1) {
|
|
|
|
// let data = nx.bridge.acts.vget( "sign30" );
|
|
// data.day = _data.day;
|
|
// data.status = _data.status;
|
|
// nx.bridge.acts.vset( "sign30", data );
|
|
}
|
|
// this.reqBaseData();
|
|
},
|
|
|
|
reqGetDailyFirstc: function reqGetDailyFirstc() {
|
|
var protocal = {};
|
|
this.SendProtocal(21011, protocal);
|
|
}
|
|
});
|
|
|
|
// 模块导出
|
|
module.exports = ActDayCharge;
|
|
|
|
cc._RF.pop(); |