69 lines
1.9 KiB
JavaScript
69 lines
1.9 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '58262VI3m5Fpof82bE8RK6v', 'act.mysteryshop.mod');
|
||
|
|
// Scripts/mod/acts/mysteryshop/act.mysteryshop.mod.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
/*******************************************************************************
|
||
|
|
*
|
||
|
|
* 活动: 每日首次充值
|
||
|
|
*
|
||
|
|
*
|
||
|
|
******************************************************************************/
|
||
|
|
|
||
|
|
var ActBase = require("act.base");
|
||
|
|
var ActMysteryShop = cc.Class({
|
||
|
|
"extends": ActBase,
|
||
|
|
// 初始化配置数据
|
||
|
|
initConfig: function initConfig() {
|
||
|
|
// 视图附着
|
||
|
|
nx.plugin.add(this, ["view"]);
|
||
|
|
this.vattach("Acts");
|
||
|
|
},
|
||
|
|
// 注册协议接受事件
|
||
|
|
registerProtocals: function registerProtocals() {
|
||
|
|
// // 前端准备完毕
|
||
|
|
this.RegisterProtocal(21053, this.GetMysteryData.bind(this));
|
||
|
|
this.RegisterProtocal(21003, this.handle21003.bind(this)); // 21003 isopen = 2 彈出對應的限時特惠禮包
|
||
|
|
},
|
||
|
|
|
||
|
|
// 从服务器初始化数据
|
||
|
|
reqBaseFromServer: function reqBaseFromServer(_cb) {
|
||
|
|
var _this = this;
|
||
|
|
var cfgs = [this.data.config //付費活動
|
||
|
|
];
|
||
|
|
|
||
|
|
this.loadConfigs(cfgs, function (_ret, _data) {
|
||
|
|
_this.reqMysteryChargeData(_cb);
|
||
|
|
// nx.dt.fnInvoke( _cb, true );
|
||
|
|
});
|
||
|
|
},
|
||
|
|
|
||
|
|
// 请求每日首次充值數據
|
||
|
|
reqMysteryChargeData: function reqMysteryChargeData(_cb) {
|
||
|
|
this.SendProtocal(21053, {}, _cb);
|
||
|
|
},
|
||
|
|
GetMysteryData: function GetMysteryData(_data) {
|
||
|
|
nx.bridge.acts.vset("mysteryshop", _data);
|
||
|
|
this.openTip("reward", false);
|
||
|
|
},
|
||
|
|
handle21003: function handle21003(_data) {
|
||
|
|
if (!_data || nx.dt.objEmpty(_data) || !nx.bridge.acts) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if (_data.is_open == 2) {
|
||
|
|
var actinfo = nx.bridge.acts.queryAct(this.data.camp_id);
|
||
|
|
if (nx.dt.objEmpty(actinfo)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
nx.bridge.vset("DailyLimit", _data.is_open);
|
||
|
|
|
||
|
|
// nx.bridge.createPanel( "WndActMySteryShop" );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
// 模块导出
|
||
|
|
module.exports = ActMysteryShop;
|
||
|
|
|
||
|
|
cc._RF.pop();
|