72 lines
2.0 KiB
JavaScript
72 lines
2.0 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '7db10ir8qhHkpNxqneyGaw2', 'act.partner.buylimit.mod');
|
||
|
|
// Scripts/mod/acts/partnerBuyLimit/act.partner.buylimit.mod.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
/*******************************************************************************
|
||
|
|
*
|
||
|
|
* 活动: 限定招募&&商城
|
||
|
|
*
|
||
|
|
*
|
||
|
|
******************************************************************************/
|
||
|
|
|
||
|
|
var ActBase = require("act.base");
|
||
|
|
var ActBuyLimit = cc.Class({
|
||
|
|
"extends": ActBase,
|
||
|
|
// 初始化配置数据
|
||
|
|
initConfig: function initConfig() {
|
||
|
|
// 视图附着
|
||
|
|
nx.plugin.add(this, ["view"]);
|
||
|
|
this.vattach("Acts");
|
||
|
|
},
|
||
|
|
// 注册协议接受事件
|
||
|
|
registerProtocals: function registerProtocals() {
|
||
|
|
this.RegisterProtocal(16603, this.handle16603.bind(this)); // 請求子活動相關,來取相關的顯示數據
|
||
|
|
},
|
||
|
|
|
||
|
|
// 从服务器初始化数据
|
||
|
|
reqBaseFromServer: function reqBaseFromServer(_cb) {
|
||
|
|
var cfgs = ["activity_set_quota_data"];
|
||
|
|
|
||
|
|
//所有限購類型提前push
|
||
|
|
var _data = this.vget("buyLimitInfos");
|
||
|
|
_data[this.data.camp_id] = {};
|
||
|
|
this.vset("buyLimitInfos", _data);
|
||
|
|
this.loadConfigs(cfgs, function (_ret, _data) {
|
||
|
|
// this.reqBaseData(_cb);
|
||
|
|
nx.dt.fnInvoke(_cb, true);
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 请求剧情信息
|
||
|
|
reqBaseData: function reqBaseData(_cb) {
|
||
|
|
nx.dt.fnInvoke(_cb, true);
|
||
|
|
},
|
||
|
|
// ============================================================
|
||
|
|
// 限購消息
|
||
|
|
// ============================================================
|
||
|
|
|
||
|
|
// 请求信息
|
||
|
|
reqLimitData: function reqLimitData(_camp_id, _cb) {
|
||
|
|
this.SendProtocal(16603, {
|
||
|
|
bid: _camp_id
|
||
|
|
}, _cb);
|
||
|
|
},
|
||
|
|
// 请求相關配置信息
|
||
|
|
handle16603: function handle16603(_data) {
|
||
|
|
if (!this.isGoodData(_data)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if (this.data.theme_id == _data.cli_type) {
|
||
|
|
var old_data = this.vget("buyLimitInfos");
|
||
|
|
old_data[_data.bid] = _data;
|
||
|
|
this.vset("buyLimitCamp", _data.bid);
|
||
|
|
this.vset("buyLimitInfos", old_data);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
// 模块导出
|
||
|
|
module.exports = ActBuyLimit;
|
||
|
|
|
||
|
|
cc._RF.pop();
|