79 lines
2.3 KiB
JavaScript
79 lines
2.3 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '1da79+vsiVCfp3I65c8uS2e', 'act.limitedtimeoffer.mod');
|
||
|
|
// Scripts/mod/acts/limitedtimeoffer/act.limitedtimeoffer.mod.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
/*******************************************************************************
|
||
|
|
*
|
||
|
|
* 活动: 限時特惠禮包
|
||
|
|
*
|
||
|
|
*
|
||
|
|
******************************************************************************/
|
||
|
|
|
||
|
|
var ActBase = require("act.base");
|
||
|
|
var FID = require("bridge.function.ids");
|
||
|
|
var LimitedTimeOffer = cc.Class({
|
||
|
|
"extends": ActBase,
|
||
|
|
// 初始化配置数据
|
||
|
|
initConfig: function initConfig() {
|
||
|
|
// 视图附着
|
||
|
|
nx.plugin.add(this, ["view"]);
|
||
|
|
this.vattach("Acts");
|
||
|
|
},
|
||
|
|
// 注册协议接受事件
|
||
|
|
registerProtocals: function registerProtocals() {
|
||
|
|
this.RegisterProtocal(16603, this.freshLimitedTimeOffer.bind(this)); // 請求子活動相關,來取相關的顯示數據
|
||
|
|
this.RegisterProtocal(16604, this.handle16604.bind(this)); // 請求領取子活動獎勵相關,來取相關的顯示數據
|
||
|
|
},
|
||
|
|
|
||
|
|
// 从服务器初始化数据
|
||
|
|
reqBaseFromServer: function reqBaseFromServer(_cb) {
|
||
|
|
this.reqBaseData(_cb);
|
||
|
|
// let cfgs = [
|
||
|
|
// this.data.config,//付費活動
|
||
|
|
// ]
|
||
|
|
// this.loadConfigs( cfgs, ( _ret, _data ) =>{
|
||
|
|
|
||
|
|
//
|
||
|
|
nx.dt.fnInvoke(_cb, true);
|
||
|
|
// this.reqBaseData( _cb );
|
||
|
|
// } )
|
||
|
|
},
|
||
|
|
|
||
|
|
// 请求活动信息
|
||
|
|
reqBaseData: function reqBaseData(_cb) {
|
||
|
|
this.reqLimitedTimeOfferData(_cb);
|
||
|
|
},
|
||
|
|
// ============================================================
|
||
|
|
// 限時特惠
|
||
|
|
// ============================================================
|
||
|
|
|
||
|
|
// 限時特惠 信息
|
||
|
|
reqLimitedTimeOfferData: function reqLimitedTimeOfferData(_cb) {
|
||
|
|
this.SendProtocal(16603, {
|
||
|
|
bid: this.data.camp_id
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 请求領取快速作戰獎勵
|
||
|
|
reqGetPlaneActGift: function reqGetPlaneActGift(_aim) {
|
||
|
|
this.SendProtocal(16604, {
|
||
|
|
bid: this.data.camp_id,
|
||
|
|
aim: _aim,
|
||
|
|
arg: 0
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 请求相關配置信息
|
||
|
|
freshLimitedTimeOffer: function freshLimitedTimeOffer(_data) {
|
||
|
|
if (_data.bid == this.data.camp_id) {
|
||
|
|
this.vset("limitedtimeoffer", _data);
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// 请求相關配置信息
|
||
|
|
handle16604: function handle16604(_data) {}
|
||
|
|
});
|
||
|
|
|
||
|
|
// 模块导出
|
||
|
|
module.exports = LimitedTimeOffer;
|
||
|
|
|
||
|
|
cc._RF.pop();
|