【ID1010850】首充豪礼100元档去除
parent
1691fd03da
commit
d14c0fe589
|
@ -54,7 +54,7 @@ function DayRewardItem:SetValue(context,_sortingOrder)
|
||||||
--else
|
--else
|
||||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
||||||
local AccumRecharge = 0
|
local AccumRecharge = 0
|
||||||
for _, missInfo in pairs(activityInfo.mission) do
|
for _, missInfo in ipairs(activityInfo.mission) do
|
||||||
if missInfo and missInfo.progress then
|
if missInfo and missInfo.progress then
|
||||||
AccumRecharge = missInfo.progress
|
AccumRecharge = missInfo.progress
|
||||||
end
|
end
|
||||||
|
@ -87,7 +87,7 @@ function DayRewardItem:SetValue(context,_sortingOrder)
|
||||||
end
|
end
|
||||||
|
|
||||||
function DayRewardItem:OnReceivedBtnClicked()
|
function DayRewardItem:OnReceivedBtnClicked()
|
||||||
NetManager.GetActivityRewardRequest(self.context.Id,ActivityTypeDef.FirstRecharge, function(drop)
|
NetManager.GetActivityRewardRequest(self.context.Id, self.context.ActivityId, function(drop)
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1)
|
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1)
|
||||||
ActivityGiftManager.SetActivityInfo(self.context.ActivityId, self.context.Id, 1)
|
ActivityGiftManager.SetActivityInfo(self.context.ActivityId, self.context.Id, 1)
|
||||||
self.receiveBtn.gameObject:SetActive(false)
|
self.receiveBtn.gameObject:SetActive(false)
|
||||||
|
|
|
@ -19,47 +19,28 @@ end
|
||||||
function this.GetFirstRechargeRedPointStatus()
|
function this.GetFirstRechargeRedPointStatus()
|
||||||
local redPoint = false
|
local redPoint = false
|
||||||
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge) then
|
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge) then
|
||||||
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge) then
|
redPoint = redPoint or this.GetRedPointStatus(1)
|
||||||
redPoint = redPoint or this.GetSixMoneyTabRedPointStatus()
|
redPoint = redPoint or this.GetRedPointStatus(2)
|
||||||
redPoint = redPoint or this.GetHundredTabRedPointStatus()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return redPoint
|
return redPoint
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.GetSixMoneyTabRedPointStatus()
|
function this.GetRedPointStatus(index)
|
||||||
local redPoint = false
|
local redPoint = false
|
||||||
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(1)
|
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(index)
|
||||||
for _, rewardInfo in ConfigPairs(activityRewardConfig) do
|
|
||||||
if rewardInfo.ActivityId == ActivityTypeDef.FirstRecharge and
|
|
||||||
rewardInfo.Values[1][1] == money then
|
|
||||||
redPoint = redPoint or this.GetDayItemRedPoint(rewardInfo)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return redPoint
|
|
||||||
end
|
|
||||||
|
|
||||||
function this.GetHundredTabRedPointStatus()
|
|
||||||
local redPoint = false
|
|
||||||
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(2)
|
|
||||||
for _, rewardInfo in ConfigPairs(activityRewardConfig) do
|
|
||||||
if rewardInfo.ActivityId == ActivityTypeDef.FirstRecharge and
|
|
||||||
rewardInfo.Values[1][1] == money then
|
|
||||||
redPoint = redPoint or this.GetDayItemRedPoint(rewardInfo)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return redPoint
|
|
||||||
end
|
|
||||||
|
|
||||||
function this.GetDayItemRedPoint(context)
|
|
||||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
||||||
local AccumRecharge = 0
|
for _, missionInfo in ipairs(activityInfo.mission) do
|
||||||
for _, missInfo in pairs(activityInfo.mission) do
|
local rewardInfo = activityRewardConfig[missionInfo.missionId]
|
||||||
if missInfo and missInfo.progress then
|
if rewardInfo and rewardInfo.Values[1][1] == money then
|
||||||
AccumRecharge = missInfo.progress
|
redPoint = redPoint or this.GetDayItemRedPoint(missionInfo, rewardInfo)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--if this.GetAccumRechargeValue() == 0 then
|
return redPoint
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function this.GetDayItemRedPoint(missionInfo, context)
|
||||||
|
local AccumRecharge = missionInfo.progress
|
||||||
if AccumRecharge == 0 then
|
if AccumRecharge == 0 then
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
|
@ -72,7 +53,7 @@ function this.GetDayItemRedPoint(context)
|
||||||
local day = GetTimePass(this.GetRechargeTime())
|
local day = GetTimePass(this.GetRechargeTime())
|
||||||
--local day = GetTimePass(math.floor(GetTimeStamp()))
|
--local day = GetTimePass(math.floor(GetTimeStamp()))
|
||||||
if context.Values[1][2] <= day then
|
if context.Values[1][2] <= day then
|
||||||
local state = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.FirstRecharge, context.Id).state
|
local state = missionInfo.state
|
||||||
return state ~= 1
|
return state ~= 1
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -28,6 +28,8 @@ local TipConfig = {
|
||||||
[2] = "s_shouchong_15_zh"
|
[2] = "s_shouchong_15_zh"
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
--
|
||||||
|
local _MoneyDataNum = {}
|
||||||
|
|
||||||
|
|
||||||
function FirstRechargePanel:InitComponent()
|
function FirstRechargePanel:InitComponent()
|
||||||
|
@ -168,16 +170,50 @@ function FirstRechargePanel:OnShow()
|
||||||
--self.reChargeTips.text = string.format("已充值 %s 元", FirstRechargeManager.GetAccumRechargeValue())
|
--self.reChargeTips.text = string.format("已充值 %s 元", FirstRechargeManager.GetAccumRechargeValue())
|
||||||
self.activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
self.activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
||||||
local AccumRecharge = 0
|
local AccumRecharge = 0
|
||||||
for _, missInfo in pairs(self.activityInfo.mission) do
|
_MoneyDataNum = {}
|
||||||
|
for _, missInfo in ipairs(self.activityInfo.mission) do
|
||||||
if missInfo and missInfo.progress then
|
if missInfo and missInfo.progress then
|
||||||
|
-- 获取充值额度
|
||||||
AccumRecharge = missInfo.progress
|
AccumRecharge = missInfo.progress
|
||||||
|
|
||||||
|
-- 构建数据
|
||||||
|
local money = activityRewardConfig[missInfo.missionId].Values[1][1]
|
||||||
|
local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(money)
|
||||||
|
if not _MoneyDataNum[index] then
|
||||||
|
_MoneyDataNum[index] = {}
|
||||||
|
end
|
||||||
|
table.insert(_MoneyDataNum[index], missInfo)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- 判断数据
|
||||||
|
local minIndex
|
||||||
|
for index, dataList in pairs(_MoneyDataNum) do
|
||||||
|
if dataList and #dataList > 0 then
|
||||||
|
-- 排序
|
||||||
|
table.sort(dataList,function(a,b)
|
||||||
|
return a.missionId < b.missionId
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- 找到最小的
|
||||||
|
if not minIndex or index < minIndex then
|
||||||
|
minIndex = index
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 如果想看的不存在就显示最小的
|
||||||
|
if not _MoneyDataNum[self.selectTabIndex] or #_MoneyDataNum[self.selectTabIndex] <= 0 then
|
||||||
|
self.selectTabIndex = minIndex
|
||||||
|
end
|
||||||
|
|
||||||
self.reChargeTips.text = Language[10664]..string.format(MoneyUtil.GetMoneyUnitName(),AccumRecharge)--string.format(Language[10665], AccumRecharge)
|
self.reChargeTips.text = Language[10664]..string.format(MoneyUtil.GetMoneyUnitName(),AccumRecharge)--string.format(Language[10665], AccumRecharge)
|
||||||
self:OnTabChanged(self.selectTabIndex)
|
self:OnTabChanged(self.selectTabIndex)
|
||||||
for i = 1, kMaxTab do
|
for i = 1, kMaxTab do
|
||||||
self:SetTabRedPointStatus(i)
|
self:SetTabRedPointStatus(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 判断页签切换是否显示
|
||||||
|
Util.GetGameObject(self.transform, "frame/tabsContent"):SetActive(table.nums(_MoneyDataNum)>1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function FirstRechargePanel:OnTabClicked(index)
|
function FirstRechargePanel:OnTabClicked(index)
|
||||||
|
@ -205,17 +241,7 @@ function FirstRechargePanel:OnTabChanged(index)
|
||||||
|
|
||||||
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(index)
|
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(index)
|
||||||
|
|
||||||
local tempData = {}
|
local tempData = _MoneyDataNum[index]
|
||||||
for _, missInfo in pairs(self.activityInfo.mission) do
|
|
||||||
if missInfo.missionId then
|
|
||||||
if activityRewardConfig[missInfo.missionId].Values[1][1] == money then
|
|
||||||
table.insert(tempData,missInfo)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
table.sort(tempData,function(a,b)
|
|
||||||
return a.missionId < b.missionId
|
|
||||||
end)
|
|
||||||
for _, missInfo in ipairs(tempData) do
|
for _, missInfo in ipairs(tempData) do
|
||||||
if missInfo and missInfo.progress and activityRewardConfig[missInfo.missionId].Values[1][1] == money then
|
if missInfo and missInfo.progress and activityRewardConfig[missInfo.missionId].Values[1][1] == money then
|
||||||
AccumRecharge = missInfo.progress
|
AccumRecharge = missInfo.progress
|
||||||
|
@ -251,12 +277,9 @@ end
|
||||||
|
|
||||||
function FirstRechargePanel:ShowContent(index)
|
function FirstRechargePanel:ShowContent(index)
|
||||||
local tempData = {}
|
local tempData = {}
|
||||||
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(index)
|
|
||||||
for _, rewardInfo in ConfigPairs(activityRewardConfig) do
|
for _, missionInfo in ipairs(_MoneyDataNum[index]) do
|
||||||
if rewardInfo.ActivityId == ActivityTypeDef.FirstRecharge and
|
table.insert(tempData, activityRewardConfig[missionInfo.missionId])
|
||||||
rewardInfo.Values[1][1] == money then
|
|
||||||
table.insert(tempData, rewardInfo)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- self.rewardValue.text = tempData[1].TotalValues
|
-- self.rewardValue.text = tempData[1].TotalValues
|
||||||
|
@ -301,12 +324,7 @@ function FirstRechargePanel:OnRechargeBtnClicked()
|
||||||
end
|
end
|
||||||
|
|
||||||
function FirstRechargePanel:SetTabRedPointStatus(tabIndex)
|
function FirstRechargePanel:SetTabRedPointStatus(tabIndex)
|
||||||
local redPointStatus = false
|
local redPointStatus = FirstRechargeManager.GetRedPointStatus(tabIndex)
|
||||||
if tabIndex == 1 then
|
|
||||||
redPointStatus = redPointStatus or FirstRechargeManager.GetSixMoneyTabRedPointStatus()
|
|
||||||
else
|
|
||||||
redPointStatus = redPointStatus or FirstRechargeManager.GetHundredTabRedPointStatus()
|
|
||||||
end
|
|
||||||
self.tabRedPoint[tabIndex]:SetActive(redPointStatus)
|
self.tabRedPoint[tabIndex]:SetActive(redPointStatus)
|
||||||
end
|
end
|
||||||
--界面关闭时调用(用于子类重写)
|
--界面关闭时调用(用于子类重写)
|
||||||
|
|
|
@ -398,7 +398,7 @@ function RewardItemSingleShowPopup:OnShow()
|
||||||
local configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",id)
|
local configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",id)
|
||||||
for i = 1,#configs do
|
for i = 1,#configs do
|
||||||
if configs[i].Reward[1][1] == heroConfig.Id then
|
if configs[i].Reward[1][1] == heroConfig.Id then
|
||||||
local mission = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.FirstRecharge, configs[i].Id)
|
local mission = ActivityGiftManager.GetActivityInfo(id, configs[i].Id)
|
||||||
if mission.state ~= 1 then
|
if mission.state ~= 1 then
|
||||||
isShow = true
|
isShow = true
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue