Files
fc/dev/project/library/imports/cc/ccfe2cf1-05c6-4744-a477-6553867da0f1.js
T
2026-05-24 10:21:26 +08:00

161 lines
5.4 KiB
JavaScript

"use strict";
cc._RF.push(module, 'ccfe2zxBcZHRKR3ZVOGfaDx', 'act.dailytreasure.mod');
// Scripts/mod/acts/dailytreasure/act.dailytreasure.mod.js
"use strict";
/*******************************************************************************
*
* 活动: 每日活跃
*
*
******************************************************************************/
var ActBase = require("act.base");
var ActDailyTreasure = cc.Class({
"extends": ActBase,
// 初始化配置数据
initConfig: function initConfig() {
// 视图附着
nx.plugin.add(this, ["view"]);
this.vattach("Acts");
},
// 注册协议接受事件
registerProtocals: function registerProtocals() {
this.RegisterProtocal(31120, this.getDailyTreasureData.bind(this)); // 當前活躍活動任務相關
this.RegisterProtocal(31121, this.freshTreasureTaskR.bind(this)); // 當前活躍活動任務相關
this.RegisterProtocal(31122, this.getTreasureTaskR.bind(this)); // 當前活躍活動任務相關
this.RegisterProtocal(31123, this.getStarPrayData.bind(this)); // 活躍度抽獎相關
this.RegisterProtocal(31124, this.getStarPrayBackData.bind(this)); // 請求轉盤獎勵
this.RegisterProtocal(31125, this.getStarPrayRewardData.bind(this)); // 領取轉盤獎勵
this.RegisterProtocal(31126, this.getDailyReachData.bind(this)); // 領取轉盤活躍達成獎勵
// // // // 前端准备完毕
this.RegisterProtocal(31127, this.getStarPrayJump.bind(this)); // 跳過 返回
// this.RegisterProtocal( 31106, this.getBuyDiaBack.bind( this ) ); // 今日充值次数
this.RegisterProtocal(31128, 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(31123, {}, _cb);
// 請求 材料商店相關數據
this.reqDailyTask();
},
reqBaseInfo: function reqBaseInfo() {
this.SendProtocal(31123, {});
},
// 獲取當前的 星空許願 數據
getStarPrayData: function getStarPrayData(_data) {
//
this.vset("dailyStarPrayData", _data);
},
// 獲取當前的 星空許願 數據
getStarPrayBackData: function getStarPrayBackData(_data) {
//
// this.vset( "starPrayData", _data );
},
// 領取當前的 星空許願獎勵
reqGetStarPrayRewardData: function reqGetStarPrayRewardData(_data) {
var protocal = {};
protocal.group_id = _data.group_id;
protocal.type = _data.type;
protocal.id = _data.id;
this.SendProtocal(31125, protocal);
},
// 領取當前的 星空許願獎勵
getStarPrayRewardData: function getStarPrayRewardData(_data) {},
getBuyDiaBack: function getBuyDiaBack(_data) {},
freshTreasureTaskR: function freshTreasureTaskR(_data) {
this.vset("freshDailyTask", _data);
this.dealTip(_data);
},
dealTip: function dealTip(_data) {
var list = _data.list;
var show = 0;
if (nx.dt.arrNEmpty(list)) {
list.forEach(function (_item) {
if (_item.finish == 1) {
show++;
}
});
}
this.openTip("reward", show > 0);
},
// [31121]:{"list":[{"id":60005,"type":13,"finish":2,"target_val":1,"value":1,"end_time":0}]}
// 請求 許願數據
reqGetStarPray: function reqGetStarPray(_data, _cb) {
var protocal = {};
protocal.group_id = _data.group_id;
protocal.times = _data.times;
this.SendProtocal(31124, protocal, _cb);
},
// 请求当前直购商城信息
reqStarGiftInfo: function reqStarGiftInfo() {
var protocal = {};
this.SendProtocal(31103, protocal);
},
// 領取當前的 星空許願獎勵
reqGetStarReachReward: function reqGetStarReachReward(_id) {
var protocal = {};
protocal.id = _id;
this.SendProtocal(31126, protocal);
},
getDailyReachData: function getDailyReachData(_data) {},
// 領取當前的 星空許願獎勵
reqSetStatus: function reqSetStatus(_status, _cb) {
var protocal = {};
protocal.status = _status;
this.SendProtocal(31127, protocal, _cb);
},
// 領取當前的 星空許願獎勵
reqBuyUseDia: function reqBuyUseDia() {
var protocal = {};
this.SendProtocal(31106, protocal);
},
// 请求当前祈祷记录
reqStarPrayRecord: function reqStarPrayRecord(_cb) {
var protocal = {};
this.SendProtocal(31128, protocal, _cb);
},
// 请求当前每日任务
reqDailyTask: function reqDailyTask(_cb) {
var protocal = {};
this.SendProtocal(31120, protocal, _cb);
},
getDailyTreasureData: function getDailyTreasureData(_data) {
this.vset("dailySPrayTask", _data);
this.dealTip(_data);
},
reqTreasureTaskR: function reqTreasureTaskR(_id) {
var protocal = {};
protocal.id = _id;
this.SendProtocal(31122, protocal);
},
getTreasureTaskR: function getTreasureTaskR(_data) {},
getStarPrayJump: function getStarPrayJump(_data) {},
getStarPrayRecords: function getStarPrayRecords(_records) {
// this.vset( "dailySPrayRecords", _records );
}
});
// 模块导出
module.exports = ActDailyTreasure;
cc._RF.pop();