From 99b2c98128911444915ea20d2ff9497299f0fd73 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 1 Jul 2021 12:30:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=88=90=E9=95=BF=E5=9F=BA=E9=87=91?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E5=A4=8D=E7=BA=A2=E7=82=B9=E4=B8=8D=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Operating/OperatingManager.lua | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Assets/ManagedResources/~Lua/Modules/Operating/OperatingManager.lua b/Assets/ManagedResources/~Lua/Modules/Operating/OperatingManager.lua index 78152e7ba6..f40a04f579 100644 --- a/Assets/ManagedResources/~Lua/Modules/Operating/OperatingManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Operating/OperatingManager.lua @@ -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