【成长基金】修复红点不消失的问题

dev_chengFeng
gaoxin 2021-07-01 12:30:56 +08:00
parent a175e18946
commit 99b2c98128
1 changed files with 20 additions and 0 deletions

View File

@ -75,6 +75,18 @@ function this.IsGrowthGiftGoodsAvailable(goodsType)
end
return nil
end
--判断商品是否购买过
function this.IsBuyGift(goodsId)
if not goodsId then
return false
end
for _, v in ipairs(giftGoodsInfo)do
if v.goodsId == goodsId and v.buyTimes > 0 then
return true
end
end
return false
end
-- 判断商品数据是否在可用时间范围内
local function _IsGiftGoodsAvailable(gift)
@ -233,6 +245,14 @@ function this.GetGrowthRedPointState()
if not giftGoodsInfo then return false end
local openId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.GrowthReward)
if openId then
-- 判断对应礼包是否购买
local globalActConfigs = ConfigManager.TryGetConfigData(ConfigName.GlobalActivity, openId)
if not globalActConfigs or globalActConfigs.CanBuyRechargeId[1] == 0 then
return false
end
if not this.IsBuyGift(globalActConfigs.CanBuyRechargeId[1]) then
return false
end
local actRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)
for _, configInfo in ConfigPairs(actRewardConfig) do
if configInfo.ActivityId == openId then