72 lines
2.0 KiB
JavaScript
72 lines
2.0 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, 'a5360WpjKJDd4JrU/p/2Yut', 'act.timedust.mod');
|
||
|
|
// Scripts/mod/acts/timedust/act.timedust.mod.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
/*******************************************************************************
|
||
|
|
*
|
||
|
|
* 活动: 時光遺塵
|
||
|
|
*
|
||
|
|
*
|
||
|
|
******************************************************************************/
|
||
|
|
|
||
|
|
var ActBase = require("act.base");
|
||
|
|
var ActTimeDust = 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)); // 請求子活動相關,來取相關的顯示數據
|
||
|
|
this.RegisterProtocal(16604, this.backGetTimeDustFree.bind(this)); // 請求子活動相關,來取相關的顯示數據
|
||
|
|
},
|
||
|
|
|
||
|
|
// 从服务器初始化数据
|
||
|
|
reqBaseFromServer: function reqBaseFromServer(_cb) {
|
||
|
|
nx.dt.fnInvoke(_cb, true);
|
||
|
|
this.reqBaseData();
|
||
|
|
},
|
||
|
|
// 请求活动信息
|
||
|
|
reqBaseData: function reqBaseData(_cb) {
|
||
|
|
this.reqTimeDustData(_cb);
|
||
|
|
},
|
||
|
|
// ============================================================
|
||
|
|
// 月卡操作
|
||
|
|
// ============================================================
|
||
|
|
|
||
|
|
// 请求时光遗尘信息
|
||
|
|
reqTimeDustData: function reqTimeDustData(_cb) {
|
||
|
|
this.SendProtocal(16603, {
|
||
|
|
bid: this.data.camp_id
|
||
|
|
}, _cb);
|
||
|
|
},
|
||
|
|
// 请求相關配置信息
|
||
|
|
handle16603: function handle16603(_data) {
|
||
|
|
if (_data.bid == this.data.camp_id) {
|
||
|
|
this.vset("timedust", _data);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
},
|
||
|
|
reqGetTimeDustFree: function reqGetTimeDustFree(_aim) {
|
||
|
|
this.SendProtocal(16604, {
|
||
|
|
bid: this.data.camp_id,
|
||
|
|
aim: _aim,
|
||
|
|
arg: 0
|
||
|
|
});
|
||
|
|
},
|
||
|
|
backGetTimeDustFree: function backGetTimeDustFree(_data) {
|
||
|
|
if (nx.dt.strNEmpty(_data.msg)) {
|
||
|
|
nx.tbox(_data.msg);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
// 模块导出
|
||
|
|
module.exports = ActTimeDust;
|
||
|
|
|
||
|
|
cc._RF.pop();
|