"use strict";
|
cc._RF.push(module, 'ed0a5fimtFPirDnn8tnfqpv', 'welfare_controller');
|
// Scripts/mod/welfare/welfare_controller.js
|
|
"use strict";
|
|
var _cc$Class;
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
// --------------------------------------------------------------------
|
// @author: xxx@syg.com(必填, 创建模块的人员)
|
// @description:
|
// 福利
|
// <br/>Create: 2018-12-19 10:57:29
|
// --------------------------------------------------------------------
|
var RoleController = require("role_controller");
|
|
var MainuiController = require("mainui_controller");
|
|
var MainuiConst = require("mainui_const");
|
|
var WelfareEvent = require("welfare_event");
|
|
var WelfareConst = require("welfare_const"); // var ActionConst = require("action_const");
|
|
|
var SHOW_BAIDU_TIEBA = true; // 是否显示百度贴吧
|
|
var SHOW_SINGLE_INVICODE = true; // 是否显示个人推荐码
|
|
var SHOW_BIND_PHONE = true; // 是否需要显示手机绑定界面
|
|
var SHOW_WECHAT_CERTIFY = true; // 是否显示微信公众号
|
|
var SHOW_GAME_SHARE = true; // 游戏分享
|
|
var WelfareController = cc.Class((_cc$Class = {
|
"extends": BaseController,
|
ctor: function ctor() {},
|
// 初始化配置数据
|
initConfig: function initConfig() {
|
var WelfareModel = require("welfare_model");
|
|
this.model = new WelfareModel();
|
this.model.initConfig();
|
this.welfare_list = {};
|
this.welfare_status_list = {}; //福利状态列表
|
|
this.welfare_cache_red = {}; //福利缓存红点状态
|
},
|
// 返回当前的model
|
getModel: function getModel() {
|
return this.model;
|
},
|
// 注册监听事件
|
registerEvents: function registerEvents() {
|
if (this.init_role_event == null) {
|
this.init_role_event = gcore.GlobalEvent.bind(EventId.EVT_ROLE_CREATE_SUCCESS, function () {
|
gcore.GlobalEvent.unbind(this.init_role_event);
|
this.init_role_event = null; // this.requestInitProto();
|
|
this.role_vo = RoleController.getInstance().getRoleVo();
|
|
if (this.role_assets_event == null) {
|
this.role_assets_event = this.role_vo.bind(EventId.UPDATE_ROLE_ATTRIBUTE, function (key, value) {
|
if (key == "lev") {
|
this.updateWelfareRedStatus(value);
|
}
|
}, this);
|
}
|
}, this);
|
} //断线重连请求月卡
|
|
|
if (this.re_link_game_event == null) {
|
this.re_link_game_event = gcore.GlobalEvent.bind(EventId.EVT_RE_LINK_GAME, function () {
|
var GuideController = require("guide_controller");
|
|
if (!GuideController.getInstance().isInGuide()) this.openMainWindow(false); //判断精彩活动图标在不在,请求精彩活动的数据
|
|
var vo = MainuiController.getInstance().getFunctionIconById(MainuiConst.icon.welfare);
|
|
if (vo != null) {
|
this.sender16705();
|
}
|
}, this);
|
}
|
},
|
// 注册协议接受事件
|
registerProtocals: function registerProtocals() {
|
this.RegisterProtocal(14100, this.handle14100); //签到信息
|
|
this.RegisterProtocal(14101, this.handle14101); //领取签到奖励
|
|
this.RegisterProtocal(16705, this.handle16705); //月卡信息
|
|
this.RegisterProtocal(16706, this.handle16706); //领取月卡
|
|
this.RegisterProtocal(21002, this.handle21002); //今日充值次数
|
//调查问卷
|
|
this.RegisterProtocal(24600, this.handle24600);
|
this.RegisterProtocal(24601, this.handle24601);
|
this.RegisterProtocal(24602, this.handle24602);
|
this.RegisterProtocal(24603, this.handle24603);
|
this.RegisterProtocal(24604, this.handle24604);
|
this.RegisterProtocal(21007, this.handle21007); // 每日礼
|
|
this.RegisterProtocal(21008, this.handle21008);
|
this.RegisterProtocal(21009, this.handle21009); // 手机绑定奖励状态
|
|
this.RegisterProtocal(16635, this.handle16635);
|
this.RegisterProtocal(16636, this.handle16636);
|
this.RegisterProtocal(16697, this.handle16697);
|
this.RegisterProtocal(16698, this.handle16698); // 微信公众号
|
|
this.RegisterProtocal(16633, this.handle16633);
|
this.RegisterProtocal(16634, this.handle16634); //爱微游分享和关注
|
|
this.RegisterProtocal(16691, this.handle16691);
|
this.RegisterProtocal(16693, this.handle16693);
|
this.RegisterProtocal(16692, this.handle16692);
|
this.RegisterProtocal(16694, this.handle16694); //深海小游戏收藏
|
|
this.RegisterProtocal(16695, this.handle16695);
|
this.RegisterProtocal(16696, this.handle16696);
|
},
|
//登录请求的协议
|
requestInitProto: function requestInitProto() {
|
this.sender14100(); //签到红点
|
|
this.sender16705(); //月卡信息
|
|
this.sender24600(); //问卷
|
|
this.sender21008(); //每日礼
|
|
this.sender16635(); //手机绑定奖励状态
|
|
this.sender16633();
|
this.send16693();
|
this.send16691();
|
},
|
//签到信息
|
sender14100: function sender14100() {
|
var protocal = {};
|
this.SendProtocal(14100, protocal);
|
},
|
//月卡信息
|
sender16705: function sender16705() {
|
var protocal = {};
|
this.SendProtocal(16705, protocal);
|
},
|
//调查问卷状态
|
sender24600: function sender24600() {
|
this.SendProtocal(24600, {});
|
},
|
//请求每日礼状态
|
sender21008: function sender21008() {
|
this.SendProtocal(21008, {});
|
},
|
//请求手机绑定信息
|
sender16635: function sender16635() {
|
this.SendProtocal(16635, {});
|
},
|
sender16633: function sender16633() {
|
this.SendProtocal(16633, {});
|
},
|
handle14100: function handle14100(data) {
|
gcore.GlobalEvent.fire(WelfareEvent.Update_Sign_Info, data);
|
var is_show = false;
|
var recharge_count = this.model.getRechargeCount();
|
|
if (data.status == 0 || recharge_count > 0 && data.status == 1) {
|
is_show = true;
|
}
|
|
this.setWelfareStatus(WelfareConst.WelfareIcon.sign, is_show);
|
},
|
//领取签到奖励
|
sender14101: function sender14101() {
|
var protocal = {};
|
this.SendProtocal(14101, protocal);
|
},
|
handle14101: function handle14101(data) {
|
message(data.msg);
|
|
if (data.code == 1) {
|
gcore.GlobalEvent.fire(WelfareEvent.Sign_Success, data);
|
var is_show = false;
|
var recharge_count = this.model.getRechargeCount();
|
|
if (data.status == 0 || recharge_count > 0 && data.status == 1) {
|
is_show = true;
|
}
|
|
this.setWelfareStatus(WelfareConst.WelfareIcon.sign, is_show);
|
}
|
},
|
handle16705: function handle16705(data) {
|
this.model.setYueka(data);
|
gcore.GlobalEvent.fire(WelfareEvent.Update_Yueka, data);
|
var supre_status = false; //至尊月卡
|
|
var honor_status = false; //荣耀月卡
|
|
if (data.card1_is_reward == 1) {
|
supre_status = true;
|
}
|
|
if (data.card2_is_reward == 1) {
|
honor_status = true;
|
}
|
|
this.setWelfareStatus(WelfareConst.WelfareIcon.supre_yueka, supre_status);
|
this.setWelfareStatus(WelfareConst.WelfareIcon.honor_yueka, honor_status);
|
},
|
sender16706: function sender16706(card_type) {
|
var protocal = {};
|
protocal.card_type = card_type;
|
this.SendProtocal(16706, protocal);
|
},
|
handle16706: function handle16706(data) {
|
message(data.msg);
|
|
if (data.code == 1) {
|
gcore.GlobalEvent.fire(WelfareEvent.Update_Get_Yueka, data.card_type);
|
|
if (data.card_type == 1) {
|
this.setWelfareStatus(WelfareConst.WelfareIcon.supre_yueka, false);
|
} else if (data.card_type == 2) {
|
this.setWelfareStatus(WelfareConst.WelfareIcon.honor_yueka, false);
|
}
|
}
|
},
|
//今日充值次数
|
sender21002: function sender21002() {
|
var protocal = {};
|
this.SendProtocal(21002, protocal);
|
},
|
handle21002: function handle21002(data) {
|
this.model.setRechargeCount(data.count);
|
this.sender14100(); //更新下签到红点
|
},
|
//判断一个福利是否开启了
|
checkCanAdd: function checkCanAdd(bid) {
|
var config = gdata("holiday_client_data", "data_info", [bid]);
|
if (config == null) return false;
|
var role_vo = RoleController.getInstance().getRoleVo();
|
if (role_vo.lev < config.open_lev) return false;
|
var is_verifyios = config.is_verifyios;
|
if (is_verifyios == 1) return true; //如果是提审服都要显示
|
|
if (bid == WelfareConst.WelfareIcon.bindphone) {
|
return SHOW_BIND_PHONE;
|
} else if (bid == WelfareConst.WelfareIcon.wechat) {
|
return SHOW_WECHAT_CERTIFY;
|
} else if (bid == WelfareConst.WelfareIcon.poste) {
|
return SHOW_BAIDU_TIEBA;
|
} else if (bid == WelfareConst.WelfareIcon.invicode) {
|
return SHOW_SINGLE_INVICODE;
|
} else if (bid == WelfareConst.WelfareIcon.share_game) {
|
return SHOW_GAME_SHARE;
|
} else {
|
return IS_SHOW_CHARGE;
|
}
|
},
|
//打开福利主界面 bid取WelfareConstants WelfareIcon 跳转指定标签页
|
openMainWindow: function openMainWindow(status, bid) {
|
if (status == true) {
|
if (IS_SHOW_CHARGE == false) //福利面板在不可充值不要打开了
|
return;
|
var role_vo = RoleController.getInstance().getRoleVo();
|
var data_info = Config.holiday_client_data.data_info;
|
|
if (data_info && data_info[bid]) {
|
if (role_vo.lev < data_info[bid].open_lev) {
|
message(cc.js.formatStr(Utils.TI18N("人物等级%s开启"), data_info[bid].open_lev));
|
return;
|
}
|
} //默认福利
|
//这里重新设置一下标签
|
|
|
var sub_vo = null;
|
|
for (var k in Config.holiday_client_data.data_info) {
|
var v = gdata("holiday_client_data", "data_info", [k]);
|
|
if (this.welfare_list[v.bid] == null) {
|
if (this.checkCanAdd(v.bid)) {
|
var WelfareSubTabVo = require("welfare_sub_tab_vo");
|
|
sub_vo = new WelfareSubTabVo();
|
|
if (sub_vo.update != null) {
|
sub_vo.update(v);
|
}
|
|
this.welfare_list[v.bid] = sub_vo;
|
}
|
}
|
}
|
|
if (!this.welfare_win) {
|
this.welfare_win = Utils.createClass("welfare_main_window");
|
}
|
|
this.welfare_win.open(bid);
|
} else {
|
if (this.welfare_win != null) {
|
this.welfare_win.close();
|
this.welfare_win = null;
|
}
|
}
|
},
|
//获取福利标签列表
|
getWelfareSubList: function getWelfareSubList() {
|
var welfare_sub_list = [];
|
|
var ActionController = require("action_controller");
|
|
if (this.welfare_list != null && Utils.next(this.welfare_list) != null) {
|
for (var k in this.welfare_list) {
|
var v = this.welfare_list[k];
|
var need_add = true;
|
|
if (ActionController.getInstance().isSpecialBid(v.bid)) {
|
var vo = ActionController.getInstance().getActionSubTabVo(v.bid);
|
|
if (vo == null) {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.quest) {
|
var open = this.model.getQuestOpenData();
|
|
if (open && open.status == 0) {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.bindphone) {
|
var is_over = this.checkBindPhoneStatus();
|
|
if (is_over == true) {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.wechat) {
|
//官微福利
|
// if (PLATFORM_TYPR == "SH_RH") { //已关注并且领取了奖励
|
// if (window.SH_RH_IS_SUBSCRIBE == true && this.model.getSubscriptionAwardStatus() == 1) {
|
// need_add = false;
|
// }
|
// }
|
if (USE_SDK == true && (PLATFORM_TYPR == "QQ_SDK" || PLATFORM_TYPR == "SH_SDK")) {
|
need_add = false;
|
} else if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_SUBSCRIBE == false) {
|
need_add = false;
|
} else if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_SUBSCRIBE == false) {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.invicode) {
|
//推荐码
|
if (USE_SDK == true && PLATFORM_TYPR == "QQ_SDK") {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.poste) {
|
//贴吧
|
if (USE_SDK == true && PLATFORM_TYPR == "QQ_SDK") {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.share_game) {
|
//邀请好友
|
if (USE_SDK == true && (PLATFORM_TYPR == "QQ_SDK" || PLATFORM_TYPR == "SH_SDK")) {
|
need_add = false;
|
} else if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_SHARE == false) {
|
need_add = false;
|
} else if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_SHARE == false) {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.qq_notice) {
|
//QQ公告
|
if (USE_SDK == false || PLATFORM_TYPR != "QQ_SDK") {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.sh_share_game || v.bid == WelfareConst.WelfareIcon.sh_collect) {
|
//深海小程序游戏分享 深海小程序微信公众号 收藏有礼
|
if (USE_SDK == false || PLATFORM_TYPR != "SH_SDK") {
|
need_add = false;
|
}
|
} else if (v.bid == WelfareConst.WelfareIcon.sh_wechat) {
|
//深海小程序微信公众号
|
if (USE_SDK == false || PLATFORM_TYPR != "SH_SDK" || window.SH_SDK_FOLLOW == true) {
|
need_add = false;
|
}
|
}
|
|
if (need_add == true) {
|
welfare_sub_list.push(v);
|
}
|
}
|
}
|
|
if (Utils.next(welfare_sub_list) != null) {
|
welfare_sub_list.sort(Utils.tableLowerSorter(["sort_val"]));
|
}
|
|
return welfare_sub_list;
|
},
|
//升级的时候判断红点
|
updateWelfareRedStatus: function updateWelfareRedStatus(level) {
|
if (level == null) return;
|
if (this.welfare_cache_red == null || this.welfare_cache_red[level] == null) return;
|
var list = this.welfare_cache_red[level];
|
|
for (var k in list) {
|
this.setWelfareStatus(k, list[k]);
|
}
|
},
|
//设置福利图标的状态,如果图标没有开启 应该不需要设置红点
|
setWelfareStatus: function setWelfareStatus(bid, status) {
|
if (this.checkCanAdd(bid) == false) {
|
var config = gdata("holiday_client_data", "data_info", [bid]);
|
|
if (config) {
|
if (this.welfare_cache_red[config.open_lev] == null) {
|
this.welfare_cache_red[config.open_lev] = {};
|
}
|
|
this.welfare_cache_red[config.open_lev][bid] = status;
|
}
|
} else {
|
if (this.welfare_status_list == null) {
|
this.welfare_status_list = [];
|
}
|
|
var num = 0;
|
if (status == true) num = 1;
|
var vo = {
|
bid: bid,
|
num: num
|
};
|
var vo1 = {
|
bid: bid,
|
status: status
|
};
|
this.welfare_status_list[bid] = vo1; //贴吧的红点(由于没有用到协议只能特殊处理)
|
|
this.setPosteWelfareStatus(true); //这是福利功能图标红点
|
|
MainuiController.getInstance().setFunctionTipsStatus(MainuiConst.icon.welfare, vo); //福利标签的面板
|
|
gcore.GlobalEvent.fire(WelfareEvent.UPDATE_WELFARE_TAB_STATUS, vo1);
|
}
|
},
|
///贴吧的红点
|
setPosteWelfareStatus: function setPosteWelfareStatus(status) {},
|
//根据id获取福利的标签页状态,主要是获取是否有红点
|
getWelfareStatusByID: function getWelfareStatusByID(id) {
|
if (this.welfare_status_list) return this.welfare_status_list[id];
|
},
|
handle21008: function handle21008(data) {
|
this.model.setDailyAwardStatus(data.status);
|
gcore.GlobalEvent.fire(WelfareEvent.Update_Daily_Awawd_Data);
|
},
|
//请求领取每日礼
|
sender21009: function sender21009() {
|
this.SendProtocal(21009, {});
|
},
|
handle21009: function handle21009(data) {
|
message(data.msg);
|
},
|
openSureveyQuestView: function openSureveyQuestView(status) {
|
if (status == true) {
|
if (!this.sureveyQuestWindow) {
|
this.sureveyQuestWindow = Utils.createClass("sureveyquest_window", this);
|
}
|
|
this.sureveyQuestWindow.open();
|
} else {
|
if (this.sureveyQuestWindow) {
|
this.sureveyQuestWindow.close();
|
this.sureveyQuestWindow = null;
|
}
|
}
|
},
|
//调查问卷协议
|
handle24600: function handle24600(data) {
|
if (data.status == 1 && (data.flag == 0 || data.flag == 1)) {
|
this.setWelfareStatus(WelfareConst.WelfareIcon.quest, true);
|
} else {
|
this.setWelfareStatus(WelfareConst.WelfareIcon.quest, false);
|
}
|
|
this.model.setQuestOpenData(data);
|
},
|
//获取答卷基本内容
|
sender24601: function sender24601() {
|
this.SendProtocal(24601, {});
|
},
|
handle24601: function handle24601(data) {
|
gcore.GlobalEvent.fire(WelfareEvent.Get_SureveyQuest_Basic, data);
|
},
|
//获取答卷题目信息
|
sender24602: function sender24602() {
|
this.SendProtocal(24602, {});
|
},
|
handle24602: function handle24602(data) {
|
gcore.GlobalEvent.fire(WelfareEvent.Get_SureveyQuest_Topic_Content, data);
|
},
|
//答卷
|
sender24603: function sender24603(list) {
|
var protocal = {};
|
protocal.ret_list = list;
|
this.SendProtocal(24603, protocal);
|
},
|
handle24603: function handle24603(data) {
|
message(data.msg);
|
|
if (data.code == 1) {
|
gcore.GlobalEvent.fire(WelfareEvent.SureveyQuest_Submit, data);
|
}
|
},
|
//领取奖励
|
sender24604: function sender24604() {
|
this.SendProtocal(24604, {});
|
},
|
handle24604: function handle24604(data) {
|
message(data.msg);
|
|
if (data.code == 1) {
|
gcore.GlobalEvent.fire(WelfareEvent.Get_SureveyQuest_Get_Reward, data);
|
}
|
},
|
//周、月礼包
|
sender21007: function sender21007(index) {
|
var protocal = {};
|
protocal.type = index || 1;
|
this.SendProtocal(21007, protocal);
|
},
|
handle21007: function handle21007(data) {
|
gcore.GlobalEvent.fire(WelfareEvent.Updata_Week_Month_Data, data);
|
}
|
}, _defineProperty(_cc$Class, "handle21008", function handle21008(data) {
|
this.model.setDailyAwardStatus(data.status);
|
gcore.GlobalEvent.fire(WelfareEvent.Update_Daily_Awawd_Data);
|
}), _defineProperty(_cc$Class, "sender21009", function sender21009() {
|
var protocal = {};
|
this.SendProtocal(21009, protocal);
|
}), _defineProperty(_cc$Class, "handle21009", function handle21009(data) {
|
message(data.msg);
|
}), _defineProperty(_cc$Class, "openCertifyBindPhoneWindow", function openCertifyBindPhoneWindow(status) {
|
if (!status) {
|
if (this.certify_phone) {
|
this.certify_phone.close();
|
this.certify_phone = null;
|
}
|
} else {
|
if (this.certify_phone == null) {
|
this.certify_phone = Utils.createClass("certify_bind_phone_window");
|
}
|
|
this.certify_phone.open();
|
}
|
}), _defineProperty(_cc$Class, "checkBindPhoneStatus", function checkBindPhoneStatus() {
|
if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
|
return true;
|
}
|
|
if (this.bind_phone_data == null || this.bind_phone_data.code != 0 || USE_SDK == true && (PLATFORM_TYPR == "QQ_SDK" || PLATFORM_TYPR == "SH_SDK")) {
|
return true;
|
}
|
|
return false;
|
}), _defineProperty(_cc$Class, "getBindPhoneData", function getBindPhoneData() {
|
return this.bind_phone_data;
|
}), _defineProperty(_cc$Class, "handle16635", function handle16635(data) {
|
if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
|
this.setWelfareStatus(WelfareConst.WelfareIcon.bindphone, false);
|
return;
|
}
|
|
this.bind_phone_data = data;
|
this.bind_phone_data.status = data.code;
|
|
if (data.code == 0 && SHOW_BIND_PHONE) {
|
//未绑定的时候显示红点
|
this.setWelfareStatus(WelfareConst.WelfareIcon.bindphone, true);
|
}
|
}), _defineProperty(_cc$Class, "requestBindPhone", function requestBindPhone(number, code) {
|
var protocal = {};
|
protocal.number = number;
|
protocal.code = code;
|
|
if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
|
return;
|
}
|
|
this.SendProtocal(16636, protocal);
|
}), _defineProperty(_cc$Class, "handle16636", function handle16636(data) {
|
if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
|
return;
|
}
|
|
if (this.bind_phone_data == null) return;
|
message(data.msg);
|
this.bind_phone_data.status = data.code; //0:失败 1:领取奖励成功 2:发送验证码成功
|
|
if (data.code != 0) {
|
//发送手机验证完成
|
if (data.code == 1) {
|
this.bind_phone_data.code = 1;
|
this.openCertifyBindPhoneWindow(false);
|
}
|
|
gcore.GlobalEvent.fire(WelfareEvent.UpdateBindPhoneStatus, this.bind_phone_data);
|
}
|
}), _defineProperty(_cc$Class, "handle16633", function handle16633(data) {// if (SHOW_WECHAT_CERTIFY) {
|
// this.wechat_subscription_data = data;
|
// if (data.code == 0) {
|
// this.setWelfareStatus(WelfareConst.WelfareIcon.wechat, true)
|
// }
|
// }
|
// if (PLATFORM_TYPR == "SH_RH") {
|
// this.setWelfareStatus(WelfareConst.WelfareIcon.wechat, this.model.getSubscriptionAwardStatus() == 0);
|
// }
|
}), _defineProperty(_cc$Class, "tellServerWechatStatus", function tellServerWechatStatus() {// if (this.wechat_subscription_data && this.wechat_subscription_data.code == 1) return
|
// this.SendProtocal(16634, {});
|
}), _defineProperty(_cc$Class, "handle16634", function handle16634(data) {// if (this.wechat_subscription_data) {
|
// this.wechat_subscription_data.code = 1;
|
// this.setWelfareStatus(WelfareConst.WelfareIcon.wechat, false)
|
// }
|
// if (PLATFORM_TYPR == "SH_RH") {
|
// this.setWelfareStatus(WelfareConst.WelfareIcon.wechat, false);
|
// }
|
}), _defineProperty(_cc$Class, "getWechatData", function getWechatData() {
|
return this.wechat_subscription_data;
|
}), _defineProperty(_cc$Class, "getWelfareRoot", function getWelfareRoot() {
|
if (this.welfare_win) return this.welfare_win.root_wnd;
|
}), _defineProperty(_cc$Class, "send16691", function send16691() {
|
this.SendProtocal(16691, {});
|
}), _defineProperty(_cc$Class, "handle16691", function handle16691(data) {
|
// cc.log("16691", data)
|
if (data) {
|
this.model.setShareAward(data.items);
|
this.model.setShareAwardStatus(data.code);
|
|
if (data.code == 1) {
|
if (PLATFORM_TYPR == "SH_SDK") {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_share);
|
} else {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_share);
|
}
|
}
|
}
|
}), _defineProperty(_cc$Class, "send16692", function send16692(id) {
|
var protocal = {};
|
protocal.id = id;
|
this.SendProtocal(16692, protocal);
|
}), _defineProperty(_cc$Class, "handle16692", function handle16692(data) {
|
// cc.log("16692", data)
|
message(data.msg);
|
|
if (data && data.code == 1) {
|
this.model.setShareAwardStatus(data.code);
|
gcore.GlobalEvent.fire(WelfareEvent.Update_get_SHRH_share_award_status, data.code);
|
|
if (PLATFORM_TYPR == "SH_SDK") {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_share);
|
} else {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_share);
|
}
|
}
|
}), _defineProperty(_cc$Class, "send16693", function send16693() {
|
this.SendProtocal(16693, {});
|
}), _defineProperty(_cc$Class, "handle16693", function handle16693(data) {
|
// cc.log("16693", data)
|
if (data) {
|
this.model.setSubscriptionAward(data.items);
|
this.model.setSubscriptionAwardStatus(data.code);
|
|
if (data.code == 1) {
|
if (PLATFORM_TYPR == "SH_SDK") {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_sub);
|
} else {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_sub);
|
} // this.SendProtocal(16634, {});
|
|
}
|
}
|
}), _defineProperty(_cc$Class, "send16694", function send16694(id) {
|
var protocal = {};
|
protocal.id = id;
|
this.SendProtocal(16694, protocal); // RoleController.getInstance().sender10945(str)
|
}), _defineProperty(_cc$Class, "handle16694", function handle16694(data) {
|
// cc.log("16694", data)
|
message(data.msg);
|
|
if (data && data.code == 1) {
|
gcore.GlobalEvent.fire(WelfareEvent.Update_SHRH_Award_Status, 1);
|
this.model.setSubscriptionAwardStatus(data.code); // this.SendProtocal(16634, {});
|
|
if (PLATFORM_TYPR == "SH_SDK") {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_sub);
|
} else {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_sub);
|
}
|
}
|
}), _defineProperty(_cc$Class, "send16695", function send16695() {
|
var protocal = {};
|
this.SendProtocal(16695, protocal);
|
}), _defineProperty(_cc$Class, "handle16695", function handle16695(data) {
|
if (data) {
|
this.model.setCollectAward(data.items);
|
this.model.setCollectAwardStatus(data.code);
|
|
if (data.code == 1) {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_collect);
|
}
|
}
|
}), _defineProperty(_cc$Class, "send16696", function send16696() {
|
var protocal = {};
|
this.SendProtocal(16696, protocal);
|
}), _defineProperty(_cc$Class, "handle16696", function handle16696(data) {
|
message(data.msg);
|
|
if (data && data.code == 1) {
|
this.model.setCollectAwardStatus(data.code);
|
gcore.GlobalEvent.fire(WelfareEvent.Update_get_SHWX_collect_award_status, 1);
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shwx_collect);
|
}
|
}), _defineProperty(_cc$Class, "shrhShareStatus", function shrhShareStatus(status, data) {
|
// message("分享成功!!!!", data)
|
gcore.GlobalEvent.fire(WelfareEvent.Update_get_SHRH_share_award_status, 2);
|
}), _defineProperty(_cc$Class, "shrhRealNameStatus", function shrhRealNameStatus(status) {
|
if (status) {
|
MainuiController.getInstance().removeFunctionIconById(MainuiConst.icon.shrh_realname);
|
}
|
}), _defineProperty(_cc$Class, "send16697", function send16697() {
|
this.SendProtocal(16697, {});
|
}), _defineProperty(_cc$Class, "handle16697", function handle16697(data) {
|
if (PLATFORM_TYPR == "SH_RH" && SH_RH_IS_SHOW_BINDPHONE == false && PLATFORM_NAME == "shmix") {
|
this.setWelfareStatus(WelfareConst.WelfareIcon.bindphone, false);
|
return;
|
}
|
|
if (data && PLATFORM_NAME == "shmix") {
|
this.bind_phone_data = data;
|
this.bind_phone_data.status = data.code;
|
|
if (data.code == 0 && SHOW_BIND_PHONE) {
|
//未绑定的时候显示红点
|
this.setWelfareStatus(WelfareConst.WelfareIcon.bindphone, true);
|
}
|
}
|
}), _defineProperty(_cc$Class, "send16698", function send16698() {
|
var protocal = {};
|
this.SendProtocal(16698, protocal);
|
}), _defineProperty(_cc$Class, "handle16698", function handle16698(data) {
|
message(data.msg);
|
this.bind_phone_data.status = data.code;
|
|
if (data && data.code == 1) {
|
this.bind_phone_data.code = data.code;
|
gcore.GlobalEvent.fire(WelfareEvent.UpdateBindPhoneStatus, 1);
|
}
|
}), _cc$Class));
|
module.exports = WelfareController;
|
|
cc._RF.pop();
|