134 lines
4.5 KiB
JavaScript
134 lines
4.5 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '90092ZtLOFCpJK9CmuEXcxb', 'act.starskyprayer.mod');
|
|
// Scripts/mod/acts/starskyprayer/act.starskyprayer.mod.js
|
|
|
|
"use strict";
|
|
|
|
var _cc$Class;
|
|
/*******************************************************************************
|
|
*
|
|
* 活动: 星空許願
|
|
*
|
|
*
|
|
******************************************************************************/
|
|
|
|
var ActBase = require("act.base");
|
|
var DailyChargeMod = require("act.dailyfirstcharge.mod");
|
|
var ActStarPray = cc.Class((_cc$Class = {
|
|
"extends": ActBase,
|
|
// 初始化配置数据
|
|
initConfig: function initConfig() {
|
|
// 视图附着
|
|
nx.plugin.add(this, ["view"]);
|
|
this.vattach("Acts");
|
|
},
|
|
// 注册协议接受事件
|
|
registerProtocals: function registerProtocals() {
|
|
this.RegisterProtocal(31100, this.getStarPrayData.bind(this)); //今日充值次数
|
|
this.RegisterProtocal(31101, this.getStarPrayBackData.bind(this)); //今日充值次数
|
|
this.RegisterProtocal(31102, this.getStarPrayRewardData.bind(this)); //今日充值次数
|
|
this.RegisterProtocal(31103, this.getStarPrayShopData.bind(this)); //今日充值次数
|
|
// // // 前端准备完毕
|
|
this.RegisterProtocal(31105, this.getStarPrayJump.bind(this)); //今日充值次数
|
|
this.RegisterProtocal(31106, this.getBuyDiaBack.bind(this)); //今日充值次数
|
|
this.RegisterProtocal(31107, this.getStarPrayRecords.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(31100, {}, _cb);
|
|
// 請求 材料商店相關數據
|
|
},
|
|
|
|
// 獲取當前的 星空許願 數據
|
|
getStarPrayData: function getStarPrayData(_data) {
|
|
var reward = 0;
|
|
if (_data) {
|
|
if (_data.free_end_time == 0) {
|
|
reward++;
|
|
}
|
|
}
|
|
this.openTip("reward", reward > 0);
|
|
//
|
|
this.vset("starPrayData", _data);
|
|
},
|
|
// 獲取當前的 星空許願 數據
|
|
getStarPrayBackData: function getStarPrayBackData(_data) {
|
|
//
|
|
// this.vset( "starPrayData", _data );
|
|
},
|
|
// 獲取當前的 星空許願直購 數據
|
|
getStarPrayShopData: function getStarPrayShopData(_data) {
|
|
// {"code":1,"msg":"","day":1,"status":1}
|
|
this.vset("starPrayShopData", _data);
|
|
},
|
|
// 領取當前的 星空許願獎勵
|
|
reqGetStarPrayRewardData: function reqGetStarPrayRewardData(_data) {
|
|
var protocal = {};
|
|
protocal.group_id = _data.group_id;
|
|
protocal.type = _data.type;
|
|
protocal.id = _data.id;
|
|
this.SendProtocal(31102, protocal);
|
|
},
|
|
// 領取當前的 星空許願獎勵
|
|
getStarPrayRewardData: function getStarPrayRewardData(_data) {},
|
|
getBuyDiaBack: function getBuyDiaBack(_data) {},
|
|
// 請求 許願數據
|
|
reqGetStarPray: function reqGetStarPray(_data, _cb) {
|
|
var protocal = {};
|
|
protocal.group_id = _data.group_id;
|
|
protocal.times = _data.times;
|
|
this.SendProtocal(31101, protocal, _cb);
|
|
},
|
|
// 请求当前直购商城信息
|
|
reqStarGiftInfo: function reqStarGiftInfo() {
|
|
var protocal = {};
|
|
this.SendProtocal(31103, protocal);
|
|
},
|
|
// 領取當前的 星空許願獎勵
|
|
reqGetStarReachReward: function reqGetStarReachReward(_id) {
|
|
var protocal = {};
|
|
protocal.id = _id;
|
|
this.SendProtocal(31104, protocal);
|
|
},
|
|
// 領取當前的 星空許願獎勵
|
|
reqSetStatus: function reqSetStatus(_status, _cb) {
|
|
var protocal = {};
|
|
protocal.status = _status;
|
|
this.SendProtocal(31105, protocal, _cb);
|
|
},
|
|
// 領取當前的 星空許願獎勵
|
|
reqBuyUseDia: function reqBuyUseDia() {
|
|
var protocal = {};
|
|
this.SendProtocal(31106, protocal);
|
|
},
|
|
// 请求当前祈祷记录
|
|
reqStarPrayRecord: function reqStarPrayRecord(_cb) {
|
|
var protocal = {};
|
|
this.SendProtocal(31107, protocal, _cb);
|
|
},
|
|
getStarPrayJump: function getStarPrayJump(_data) {}
|
|
}, _cc$Class["getStarPrayShopData"] = function getStarPrayShopData(_data) {
|
|
this.vset("starPrayShopData", _data);
|
|
}, _cc$Class.getStarPrayRecords = function getStarPrayRecords(_records) {
|
|
this.vset("starPrayRecords", _records);
|
|
}, _cc$Class));
|
|
|
|
// 模块导出
|
|
module.exports = ActStarPray;
|
|
|
|
cc._RF.pop(); |