"use strict";
|
cc._RF.push(module, '3f27dqUQapJ4LUEFzPeFEif', 'action_model');
|
// Scripts/mod/action/action_model.js
|
|
"use strict";
|
|
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: 2019-03-02 16:49:03
|
// --------------------------------------------------------------------
|
var MainuiController = require("mainui_controller");
|
|
var MainuiConst = require("mainui_const");
|
|
var ActionEvent = require("action_event");
|
|
var ActionConst = require("action_const");
|
|
var ActionModel = cc.Class({
|
"extends": BaseClass,
|
ctor: function ctor() {},
|
properties: {},
|
initConfig: function initConfig() {
|
// -- 基金红点数据
|
this.fund_red_list = {};
|
},
|
//------------------@ 基金活动相关
|
// -- 开启中的基金活动id
|
setOpenFundIds: function setOpenFundIds(id_list) {
|
this.fund_id_list = id_list || [];
|
this.checkFundRedStatus();
|
},
|
getOpenFundIds: function getOpenFundIds() {
|
return this.fund_id_list || [];
|
},
|
// -- 设置基金的数据
|
setFundSrvData: function setFundSrvData(data) {
|
this.fund_datas = this.fund_datas || {};
|
|
if (data && data.id) {
|
this.fund_datas[data.id] = data;
|
this.updateFundStatus(data.id, data.status);
|
}
|
},
|
// -- 获取基金数据
|
getFundSrvDataById: function getFundSrvDataById(id) {
|
this.fund_datas = this.fund_datas || {};
|
return this.fund_datas[id] || {};
|
},
|
updateFundStatus: function updateFundStatus(id, status) {
|
this.fund_id_list = this.fund_id_list || [];
|
|
for (var k = 0; k < this.fund_id_list.length; ++k) {
|
var v = this.fund_id_list[k];
|
|
if (v.id == id) {
|
v.status = status;
|
break;
|
}
|
}
|
|
this.checkFundRedStatus();
|
},
|
//检查超值基金红点
|
checkFundRedStatus: function checkFundRedStatus() {
|
this.fund_id_list = this.fund_id_list || [];
|
|
for (var k = 0; k < this.fund_id_list.length; ++k) {
|
var v = this.fund_id_list[k];
|
|
if (v.id == ActionConst.FundType.type_one) {
|
this.updateFundRedStatus(ActionConst.FundRedIndex.fund_get_one, v.status == 1);
|
this.updateFundRedStatus(ActionConst.FundRedIndex.fund_buy_one, v.status == 0);
|
} else if (v.id == ActionConst.FundType.type_two) {
|
this.updateFundRedStatus(ActionConst.FundRedIndex.fund_get_two, v.status == 1);
|
this.updateFundRedStatus(ActionConst.FundRedIndex.fund_buy_two, v.status == 0);
|
}
|
}
|
},
|
// -- 更新基金红点数据
|
updateFundRedStatus: function updateFundRedStatus(bid, status) {
|
var _status = this.fund_red_list[bid];
|
if (_status == status) return; // -- 购买的红点只有登陆时才显示,点击之后消失,之后不再显示
|
|
if ((bid == ActionConst.FundRedIndex.fund_buy_one || bid == ActionConst.FundRedIndex.fund_buy_two) && _status == false) {
|
return;
|
}
|
|
this.fund_red_list[bid] = status;
|
var red_status = false;
|
|
for (var k in this.fund_red_list) {
|
var v = this.fund_red_list[k];
|
|
if (v == true) {
|
red_status = true;
|
break;
|
}
|
}
|
|
MainuiController.getInstance().setFunctionTipsStatus(MainuiConst.icon.fund, red_status);
|
gcore.GlobalEvent.fire(ActionEvent.UPDATA_FUND_RED_STATUS_EVENT);
|
},
|
updateSevenLoginData: function updateSevenLoginData(data) {
|
this.seven_login_data = data;
|
},
|
getSevenLoginData: function getSevenLoginData() {
|
return this.seven_login_data;
|
},
|
// --desc:获取当前可领取7天登录的最大天数
|
getMaxSevenDay: function getMaxSevenDay() {
|
if (this.seven_login_data == null || this.seven_login_data.status_list == null) return;
|
var status_list = this.seven_login_data.status_list;
|
status_list.sort(function (a, b) {
|
return a.day - b.day;
|
});
|
var day = null;
|
|
for (var i in status_list) {
|
if (status_list[i].status == 2) {
|
day = status_list[i];
|
break;
|
}
|
}
|
|
if (day == null) {
|
day = status_list[status_list.length];
|
}
|
|
return day;
|
},
|
setFirstBtnStatus: function setFirstBtnStatus(data) {
|
this.firstBtnStatus = {};
|
|
for (var i = 0; i < data.length; ++i) {
|
var v = data[i];
|
this.firstBtnStatus[v.id] = v.status;
|
}
|
},
|
getFirstBtnStatus: function getFirstBtnStatus(index) {
|
if (!this.firstBtnStatus) return;
|
return this.firstBtnStatus[index] || 0;
|
},
|
// 获取七日目标的周期数
|
setSevenGoldPeriod: function setSevenGoldPeriod(period) {
|
this.sevenPeriod = period;
|
},
|
getSevenGoldPeriod: function getSevenGoldPeriod() {
|
return this.sevenPeriod;
|
},
|
// 七天目标检查红点 --当前天数以下的
|
checkRedPoint: function checkRedPoint(day) {
|
if (day < 1 || day > 7) return;
|
day = day || 1; // 福利
|
|
this.welfareRetPoint = [];
|
|
for (var i = 1; i <= day; i++) {
|
var welfare = this.getSevenGoalWelfareList(i);
|
this.welfareRetPoint[i] = false;
|
|
for (var k in welfare) {
|
if (welfare[k].status == 1) {
|
this.welfareRetPoint[i] = true;
|
break;
|
}
|
}
|
} // 每日目标
|
|
|
this.growRetPoint = [];
|
|
for (var i = 1; i <= day; i++) {
|
var grow = this.getServerGrowListData(i - 1);
|
this.growRetPoint[i] = false;
|
|
for (var k in grow) {
|
if (grow[k].status == 1) {
|
this.growRetPoint[i] = true;
|
break;
|
}
|
}
|
} // 超值礼包
|
|
|
this.giftRetPoint = [];
|
|
for (var i = 1; i <= day; i++) {
|
var grow = this.getServerGiftListData(i - 1);
|
this.giftRetPoint[i] = false;
|
|
for (var k in grow) {
|
if (grow[k].status == 1) {
|
this.giftRetPoint[i] = true;
|
break;
|
}
|
}
|
}
|
|
this.halfRedPoint = []; // 0、还有领取 1、已领取
|
|
for (var i = 1; i <= day; i++) {
|
var half = this.getHalfGiftList(i);
|
this.halfRedPoint[i] = false;
|
|
for (var k in half) {
|
if (k == 0 && half[k].status == 0) {
|
this.halfRedPoint[i] = true;
|
break;
|
}
|
}
|
} // 宝箱
|
|
|
this.boxRedPoint = [];
|
var box = this.getSevenGoalBoxList();
|
|
for (var i in box) {
|
this.boxRedPoint[i] = false;
|
|
if (box[i].status == 1) {
|
this.boxRedPoint[i] = true;
|
}
|
}
|
|
var redStatus = false;
|
var redStatus1 = false;
|
var redStatus2 = false;
|
var redStatus3 = false;
|
var redStatus4 = false;
|
var redStatus5 = false;
|
|
for (var i in this.welfareRetPoint) {
|
if (this.welfareRetPoint[i] == true) {
|
redStatus1 = true;
|
break;
|
}
|
}
|
|
for (var i in this.growRetPoint) {
|
if (this.growRetPoint[i] == true) {
|
redStatus2 = true;
|
break;
|
}
|
}
|
|
for (var i in this.giftRetPoint) {
|
if (this.giftRetPoint[i] == true) {
|
redStatus3 = true;
|
break;
|
}
|
}
|
|
for (var i in this.halfRedPoint) {
|
if (this.halfRedPoint[i] == true) {
|
redStatus5 = true;
|
break;
|
}
|
}
|
|
for (var i in this.boxRedPoint) {
|
if (this.boxRedPoint[i] == true) {
|
redStatus4 = true;
|
break;
|
}
|
}
|
|
redStatus = redStatus1 || redStatus2 || redStatus3 || redStatus4 || redStatus5;
|
var icon_id = MainuiConst.icon.seven_goal;
|
|
if (this.getSevenGoldPeriod() == 1) {
|
icon_id = MainuiConst.icon.seven_goal;
|
} else if (this.getSevenGoldPeriod() == 2) {
|
icon_id = MainuiConst.icon.seven_goal1;
|
} else if (this.getSevenGoldPeriod() == 3) {
|
icon_id = MainuiConst.icon.seven_goal2;
|
} else {
|
icon_id = MainuiConst.icon.seven_goal3;
|
}
|
|
MainuiController.getInstance().setFunctionTipsStatus(icon_id, redStatus);
|
},
|
// 红点状态
|
getRedPointWelfareStatus: function getRedPointWelfareStatus(day) {
|
if (!this.welfareRetPoint) return;
|
var status = false;
|
status = this.welfareRetPoint[day];
|
return status;
|
},
|
// 更新
|
updataRedPointWelfareStatus: function updataRedPointWelfareStatus(day, status) {
|
if (!this.welfareRetPoint) return;
|
this.welfareRetPoint[day] = status;
|
},
|
getRedPointGrowStatus: function getRedPointGrowStatus(day) {
|
if (!this.growRetPoint) return;
|
var status = false;
|
status = this.growRetPoint[day];
|
return status;
|
},
|
// 更新
|
updataRedPointGrowStatus: function updataRedPointGrowStatus(day, status) {
|
if (!this.growRetPoint) return;
|
this.growRetPoint[day] = status;
|
},
|
getRedPointGiftStatus: function getRedPointGiftStatus(day) {
|
if (!this.giftRetPoint) return;
|
var status = false;
|
status = this.giftRetPoint[day];
|
return status;
|
},
|
// 更新
|
updataRedPointGiftStatus: function updataRedPointGiftStatus(day, status) {
|
if (!this.giftRetPoint) return;
|
this.giftRetPoint[day] = status;
|
},
|
// 福利礼包
|
getRedPointHalfStatus: function getRedPointHalfStatus(day) {
|
if (!this.halfRedPoint) return;
|
var status = false;
|
status = this.halfRedPoint[day];
|
return status;
|
},
|
// 更新
|
updataRedPointHalfStatus: function updataRedPointHalfStatus(day, status) {
|
if (!this.halfRedPoint) return;
|
this.halfRedPoint[day] = status;
|
},
|
getRedPointBoxStatus: function getRedPointBoxStatus(index) {
|
if (!this.boxRedPoint) return;
|
var status = false;
|
status = this.boxRedPoint[index];
|
return status;
|
},
|
// 更新
|
updataRedPointBoxStatus: function updataRedPointBoxStatus(index, status) {
|
if (!this.boxRedPoint) return;
|
this.boxRedPoint[index] = status;
|
},
|
// 七天目标*********** start *****
|
initSevenWalfare: function initSevenWalfare(index) {
|
this.setWalfareData(index);
|
this.setWalfareGrowUpData(index);
|
this.setHalfGiftData(index);
|
this.setBoxRewardData(index);
|
},
|
// 宝箱
|
setBoxRewardData: function setBoxRewardData(index) {
|
var data = Config.day_goals_data.data_all_target[index];
|
this.boxRewardData = [];
|
|
for (var i in data) {
|
this.boxRewardData.push(data[i][0]);
|
}
|
|
this.boxRewardData.sort(function (a, b) {
|
return a.id - b.id;
|
});
|
},
|
getBoxRewardData: function getBoxRewardData() {
|
return this.boxRewardData || [];
|
},
|
// 福利
|
setWalfareData: function setWalfareData(index) {
|
var data = Config.day_goals_data.data_welfarecollection[index];
|
this.welfareData = Utils.deepCopy(data);
|
},
|
// 成长目标
|
setWalfareGrowUpData: function setWalfareGrowUpData(index) {
|
var data = Config.day_goals_data.data_growthtarget[index];
|
this.welfareGrowData = [];
|
this.welfareGiftData = [];
|
|
for (var i in data) {
|
var tab = [];
|
var tab1 = [];
|
|
for (var k in data[i]) {
|
if (data[i][k].target_type == 1) {
|
tab.push(data[i][k]);
|
} else if (data[i][k].target_type == 2) {
|
tab1.push(data[i][k]);
|
}
|
}
|
|
this.welfareGrowData.push(tab);
|
this.welfareGiftData.push(tab1);
|
}
|
},
|
// 福利礼包
|
setHalfGiftData: function setHalfGiftData(index) {
|
var data = Config.day_goals_data.data_halfdiscount[index];
|
this.walfareHalfData = [];
|
|
for (var i = 1; i <= 7; i++) {
|
this.walfareHalfData[i] = [];
|
}
|
|
for (var i in data) {
|
this.walfareHalfData[data[i][0].day].push(data[i][0]);
|
}
|
|
for (var i = 1; i <= 7; i++) {
|
this.walfareHalfData[i].sort(function (a, b) {
|
return a.id - b.id;
|
});
|
}
|
},
|
getWalfareData: function getWalfareData(day) {
|
if (!this.welfareData) return;
|
return this.welfareData[day] || [];
|
},
|
getWalfareGrowUpData: function getWalfareGrowUpData(day) {
|
if (!this.welfareGrowData) return;
|
return this.welfareGrowData[day] || [];
|
},
|
getWelfareGiftData: function getWelfareGiftData(day) {
|
if (!this.welfareGiftData) return;
|
return this.welfareGiftData[day] || [];
|
},
|
getWelfareHalfData: function getWelfareHalfData(day) {
|
if (this.walfareHalfData && this.walfareHalfData[day]) {
|
return this.walfareHalfData[day] || [];
|
}
|
},
|
// *********** 协议相关*********
|
// 七天目标的福利领取
|
setSevenGoalWelfareList: function setSevenGoalWelfareList(data) {
|
this.welfareList = [];
|
|
for (var i = 1; i <= 7; i++) {
|
this.welfareList[i] = [];
|
}
|
|
for (var i in data) {
|
this.welfareList[data[i].day].push(data[i]);
|
}
|
},
|
getSevenGoalWelfareList: function getSevenGoalWelfareList(day) {
|
if (!this.welfareList) return;
|
return this.welfareList[day] || [];
|
},
|
// 更新数据
|
updataGoalWelfareList: function updataGoalWelfareList(day, index, status) {
|
this.welfareList[day][index].status = status;
|
},
|
// 七天目标的成长目标
|
setSevenGoalGrowList: function setSevenGoalGrowList(data) {
|
var grow_list = [];
|
|
for (var i = 1; i <= 7; i++) {
|
grow_list[i] = [];
|
}
|
|
for (var i in data) {
|
grow_list[data[i].day].push(data[i]);
|
}
|
|
this.serverGrowListData = [];
|
this.serverGiftListData = [];
|
|
for (var i in grow_list) {
|
var tab = [];
|
var tab1 = [];
|
|
for (var k in grow_list[i]) {
|
if (grow_list[i][k].target_type == 1) {
|
tab.push(grow_list[i][k]);
|
} else if (grow_list[i][k].target_type == 2) {
|
tab1.push(grow_list[i][k]);
|
}
|
}
|
|
this.serverGrowListData.push(tab);
|
this.serverGiftListData.push(tab1);
|
}
|
},
|
getServerGrowListData: function getServerGrowListData(day) {
|
if (this.serverGrowListData && this.serverGrowListData[day]) {
|
return this.serverGrowListData[day] || [];
|
}
|
|
return [];
|
},
|
// 更新数据
|
updataGrowListData: function updataGrowListData(day, index, status) {
|
this.serverGrowListData[day][index].status = status;
|
},
|
getServerGiftListData: function getServerGiftListData(day) {
|
if (!this.serverGiftListData) return;
|
return this.serverGiftListData[day] || [];
|
},
|
// 更新数据
|
updataGiftListData: function updataGiftListData(day, index, status) {
|
this.serverGiftListData[day][index].status = status;
|
},
|
// 福利礼包礼包购买
|
setHalfGiftList: function setHalfGiftList(data) {
|
this.halfGiftList = [];
|
|
for (var i = 1; i <= 7; i++) {
|
this.halfGiftList[i] = [];
|
}
|
|
for (var i = 1; i <= 7; i++) {
|
var half_list = this.getWelfareHalfData(i);
|
|
for (var k in half_list) {
|
for (var b in data) {
|
if (half_list[k].id == data[b].day) {
|
this.halfGiftList[i].push(data[b]);
|
}
|
}
|
}
|
}
|
},
|
getHalfGiftList: function getHalfGiftList(day) {
|
if (this.halfGiftList && this.halfGiftList[day]) {
|
return this.halfGiftList[day] || [];
|
}
|
},
|
// 更新数据
|
updataHalfListData: function updataHalfListData(day, index, status) {
|
this.halfGiftList[day][index].status = status;
|
},
|
// 活跃宝箱
|
setSevenGoalBoxList: function setSevenGoalBoxList(data) {
|
this.boxList = data;
|
},
|
getSevenGoalBoxList: function getSevenGoalBoxList() {
|
if (!this.boxList) return;
|
this.boxList.sort(Utils.tableLowerSorter(["goal_id"]));
|
return this.boxList || [];
|
},
|
// 更新数据
|
updataBoxListData: function updataBoxListData(index, status) {
|
this.boxList[index].status = status;
|
},
|
sortItemList: function sortItemList(list) {
|
var _tempsort;
|
|
var tempsort = (_tempsort = {}, _defineProperty(_tempsort, 0, 2), _defineProperty(_tempsort, 1, 1), _defineProperty(_tempsort, 2, 3), _tempsort);
|
|
var sortFunc = function sortFunc(objA, objB) {
|
if (objA.status != objB.status) {
|
if (tempsort[objA.status] && tempsort[objB.status]) {
|
return tempsort[objA.status] - tempsort[objB.status];
|
} else {
|
return -1;
|
}
|
} else {
|
return objA.aim - objB.aim;
|
}
|
};
|
|
list.sort(sortFunc);
|
},
|
//设置倒计时
|
setCountDownTime: function setCountDownTime(text, less_time) {
|
var node = text.node;
|
if (!node) return;
|
node.stopAllActions();
|
|
if (less_time > 0) {
|
this.setTimeFormatString(text, less_time);
|
var callfun = cc.callFunc(function () {
|
less_time = less_time - 1;
|
|
if (less_time < 0) {
|
node.stopAllActions();
|
text.string = "00:00:00";
|
} else {
|
this.setTimeFormatString(text, less_time);
|
}
|
}.bind(this));
|
node.runAction(cc.repeatForever(cc.sequence(cc.delayTime(1), callfun)));
|
} else {
|
this.setTimeFormatString(text, less_time);
|
}
|
},
|
setTimeFormatString: function setTimeFormatString(text, time) {
|
var TimeTool = require("timetool");
|
|
if (time > 0) {
|
text.string = TimeTool.getTimeForFunction(time);
|
} else {
|
text.node.stopAllActions();
|
text.string = "00:00:00";
|
}
|
},
|
// *********** end *********************************************
|
// 幸运值
|
setLucklyRewardData: function setLucklyRewardData() {
|
var data = Config.dial_data.data_get_lucky_award;
|
var list = this.sortLucklyData(data);
|
this.lucky_num1 = list[0];
|
this.lucky_num2 = list[1];
|
},
|
getLucklyRewardData: function getLucklyRewardData(index) {
|
if (!this.lucky_num1 || !this.lucky_num2) return [];
|
|
if (index == 1) {
|
return this.lucky_num1 || [];
|
} else if (index == 2) {
|
return this.lucky_num2 || [];
|
}
|
},
|
// 抽奖两个按钮
|
setBuyRewardData: function setBuyRewardData() {
|
var data = Config.dial_data.data_get_limit_open;
|
var list = this.sortLucklyData(data, true);
|
this.buy_num_list1 = list[0];
|
this.buy_num_list2 = list[1];
|
},
|
getBuyRewardData: function getBuyRewardData(index) {
|
if (!this.buy_num_list1 || !this.buy_num_list2) return [];
|
|
if (index == 1) {
|
return this.buy_num_list1 || [];
|
} else if (index == 2) {
|
return this.buy_num_list2 || [];
|
}
|
},
|
sortLucklyData: function sortLucklyData(data, _type) {
|
var list1 = [];
|
var list2 = [];
|
|
for (var i in data) {
|
var v = data[i];
|
|
if (v.type == 1) {
|
list1.push(v);
|
} else if (v.type == 2) {
|
list2.push(v);
|
}
|
}
|
|
if (_type) {
|
list1.sort(function (a, b) {
|
return a.type2 - b.type2;
|
});
|
list2.sort(function (a, b) {
|
return a.type2 - b.type2;
|
});
|
} else {
|
list1.sort(function (a, b) {
|
return a.id - b.id;
|
});
|
list2.sort(function (a, b) {
|
return a.id - b.id;
|
});
|
}
|
|
return [list1, list2];
|
},
|
// ------- 探宝服务器返回----------
|
// 寻宝数据
|
setTreasureInitData: function setTreasureInitData(data) {
|
this.treasureInitData = [];
|
|
for (var i in data) {
|
this.treasureInitData[data[i].type] = data[i];
|
}
|
},
|
getTreasureInitData: function getTreasureInitData(index) {
|
if (!this.treasureInitData) return [];
|
return this.treasureInitData[index] || [];
|
},
|
// 更新
|
updataTreasureInitData: function updataTreasureInitData(index, data) {
|
if (!this.treasureInitData) return;
|
this.treasureInitData[index].count = data.count;
|
this.treasureInitData[index].end_time = data.end_time;
|
this.treasureInitData[index].lucky = data.lucky;
|
this.treasureInitData[index].lucky_award = data.lucky_award;
|
this.treasureInitData[index].rand_lists = data.rand_lists;
|
},
|
// 更新日记
|
updataTreasureLogData: function updataTreasureLogData(index, data) {
|
if (!this.treasureInitData) return;
|
this.treasureInitData[index].log_list = data;
|
},
|
// *********探宝红点*********
|
lucklyRedPoint: function lucklyRedPoint() {
|
this.setLucklyRewardData();
|
this.tab_redpoint = [false, false];
|
|
for (var val = 1; val <= 2; val++) {
|
var data = this.getLucklyRewardData(val);
|
var serve_data = this.getTreasureInitData(val);
|
var status = false;
|
|
for (var j in data) {
|
var _bool = true;
|
|
for (var k in serve_data.lucky_award) {
|
if (data[j].id == serve_data.lucky_award[k].lucky) {
|
_bool = false;
|
break;
|
}
|
}
|
|
if (serve_data.lucky < data[j].lucky_val) {
|
_bool = false;
|
}
|
|
if (_bool == true) {
|
status = true;
|
break;
|
}
|
}
|
|
this.setLucklyTabRedPoint(val, status);
|
}
|
|
MainuiController.getInstance().setFunctionTipsStatus(MainuiConst.icon.lucky_treasure, this.tab_redpoint[1] || this.tab_redpoint[2]);
|
},
|
// 获取幸运探宝页签红点
|
setLucklyTabRedPoint: function setLucklyTabRedPoint(index, status) {
|
this.tab_redpoint[index] = status;
|
},
|
getLucklyTabRedPoint: function getLucklyTabRedPoint(index) {
|
if (this.tab_redpoint && this.tab_redpoint[index]) {
|
return this.tab_redpoint[index];
|
}
|
|
return false;
|
},
|
getFundRedStatusByBid: function getFundRedStatusByBid(bid) {
|
return this.fund_red_list[bid];
|
},
|
//杂货铺数据
|
setStoneShopData: function setStoneShopData(data) {
|
this.stone_shop_data = {};
|
|
for (var i in data) {
|
var v = data[i];
|
this.stone_shop_data[v.id] = v;
|
}
|
},
|
getStoneShopData: function getStoneShopData(id) {
|
if (this.stone_shop_data && this.stone_shop_data[id] != null) {
|
return this.stone_shop_data[id];
|
}
|
|
return null;
|
},
|
// -----------每日红点仅显示一次-----------
|
updateGiftRedPointStatus: function updateGiftRedPointStatus(data) {
|
var bid = data.bid;
|
this.gift_id_list = this.gift_id_list || [];
|
this.gift_id_list[bid] = data;
|
},
|
getGiftRedStatusByBid: function getGiftRedStatusByBid(bid) {
|
if (!this.gift_id_list) return;
|
var list = this.gift_id_list[bid];
|
|
if (list) {
|
return list.status;
|
}
|
},
|
setGiftRedStatus: function setGiftRedStatus(data) {
|
if (!this.gift_id_list) return;
|
var bid = data.bid;
|
var status = data.status;
|
var list = this.gift_id_list[bid];
|
|
if (list && list.status != status) {
|
list.status = status;
|
}
|
|
gcore.GlobalEvent.fire(ActionEvent.SHOW_ACTIVITY_RED_POINT, bid, status);
|
},
|
updataFestvalRedStatus: function updataFestvalRedStatus(bid, data) {
|
var red_status = this.getRedPointStatus(data);
|
var festval_bid = MainuiConst.icon.festval;
|
|
if (bid == ActionConst.ActionRankCommonType.festval_day) {
|
festval_bid = MainuiConst.icon.festval_spring;
|
} else if (bid == ActionConst.ActionRankCommonType.lover_day) {
|
festval_bid = MainuiConst.icon.festval_lover;
|
}
|
|
MainuiController.getInstance().setFunctionTipsStatus(festval_bid, red_status);
|
},
|
getRedPointStatus: function getRedPointStatus(data) {
|
if (!data) return false;
|
var red_status = false;
|
|
for (var k = 0; k < data.length; ++k) {
|
var v = data[k];
|
|
if (v.status == 1) {
|
red_status = true;
|
break;
|
}
|
}
|
|
return red_status;
|
},
|
updataCombineLoginRedStatus: function updataCombineLoginRedStatus(data) {
|
if (!data) return;
|
var red_status = false;
|
|
for (var k = 0; k < data.length; ++k) {
|
var v = data[k];
|
|
if (v.status == 1) {
|
red_status = true;
|
break;
|
}
|
}
|
|
MainuiController.getInstance().setFunctionTipsStatus(MainuiConst.icon.combine_login, red_status);
|
},
|
updataPreferentialRedStatus: function updataPreferentialRedStatus(status, id) {
|
if (true) return; //暂时屏蔽掉 不需要
|
// id = id or MainuiConst.icon.preferential
|
// if status then
|
// if self.prefer_fisrt_flag == nil then
|
// self.prefer_fisrt_flag = {}
|
// end
|
// if not self.prefer_fisrt_flag[id] then
|
// self.prefer_fisrt_flag[id] = true
|
// else
|
// status = false
|
// end
|
// end
|
// MainuiController:getInstance():setFunctionTipsStatus(id, status)
|
},
|
clearFundSrvData: function clearFundSrvData() {
|
this.fund_datas = {};
|
}
|
});
|
|
cc._RF.pop();
|