From 640c866388549aa390681d1bb3e67e3e7d947729 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 2 Apr 2021 11:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E9=95=BF=E7=A4=BC=E5=8C=85=20?= =?UTF-8?q?=E7=BA=A2=E7=82=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicActivity/DynamicActivityManager.lua | 3 --- .../~Lua/Modules/Operating/GrowthGiftPage.lua | 7 ++++--- .../~Lua/Modules/Recharge/View/GiftPre.lua | 1 - .../~Lua/Modules/Vip/VipManager.lua | 18 +++++++++++++++++- Assets/ManagedResources/~Lua/View/ShopView.lua | 1 - 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityManager.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityManager.lua index 65b4159533..83dcb6bf8d 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/DynamicActivityManager.lua @@ -547,7 +547,6 @@ function this.CreatSingleData(shopData,DataTypeIndex,buyType) curSortId = 2 end data.costId,data.finalNum,data.oriCostNum = ShopManager.calculateBuyCost(buyType, shopData.id, 1) - data.costId,data.finalNum,data.oriCostNum = ShopManager.calculateBuyCost(buyType, shopData.id, 1) data.price = data.finalNum elseif DataTypeIndex == DataType.Direct and rechargeCommodityConfig[shopData.goodsId].ShowType == buyType then data.shopData = shopData @@ -596,9 +595,7 @@ local stateSort = { function this.GetMissionDataByActId(activityId) local actiInfo = ActivityGiftManager.GetActivityInfoByType(activityId) local havaBought = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.GrowthReward, GlobalActivity[activityId].CanBuyRechargeId[1])--当前礼包ID(101\102\103\104\105) - LogGreen("havaBought:"..havaBought.buyTimes) local data = {} - LogGreen("actiInfo.mission:"..#actiInfo.mission) for k,v in ipairs(actiInfo.mission) do table.insert(data,this.CreatSingleMissionData(v,havaBought)) end diff --git a/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftPage.lua b/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftPage.lua index 67110691d4..1ae24e175a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftPage.lua +++ b/Assets/ManagedResources/~Lua/Modules/Operating/GrowthGiftPage.lua @@ -68,6 +68,8 @@ end -- 打开,重新打开时回调 function GrowthGiftPage:OnShow(_sortingOrder) + VipManager.SetGrowthPackagePointStatus()--成长礼包 + CheckRedPointStatus(RedPointType.GrowthPackage) self.gameObject:SetActive(true) if _sortingOrder then sortingOrder = _sortingOrder @@ -106,8 +108,7 @@ function GrowthGiftPage:OnShow(_sortingOrder) self.titleTip.gameObject:SetActive(true) else self.titleTip.gameObject:SetActive(false) - end - self.curGiftsId = GlobalActivity[self.curActiId].CanBuyRechargeId[1] + end self:RefreshData() end @@ -121,6 +122,7 @@ end --设置投资按钮初始状态 function GrowthGiftPage:SetBtnInvestState() + self.curGiftsId = GlobalActivity[self.curActiId].CanBuyRechargeId[1] self.gift = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.GrowthReward, self.curGiftsId) if self.gift and self.gift.buyTimes == 0 then self.btnInvest:GetComponent("Button").enabled = true @@ -136,7 +138,6 @@ end function GrowthGiftPage:RefreshGiftData(anim) self.mission = DynamicActivityManager.GetMissionDataByActId(self.curActiId) - if not self.missionPre then self.missionPre = {} end diff --git a/Assets/ManagedResources/~Lua/Modules/Recharge/View/GiftPre.lua b/Assets/ManagedResources/~Lua/Modules/Recharge/View/GiftPre.lua index bac50f87dc..1ee89907ff 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recharge/View/GiftPre.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recharge/View/GiftPre.lua @@ -100,7 +100,6 @@ function GiftPre:BindEvent() --直购商品 PayManager.Pay(self.data.data.shopData.goodsId, function(id) FirstRechargeManager.RefreshAccumRechargeValue(self.data.data.shopData.goodsId) - PlayerPrefs.SetInt(PlayerManager.uid.."czlb", 0) CheckRedPointStatus(RedPointType.DailyGift) CheckRedPointStatus(RedPointType.WeekGiftPage) CheckRedPointStatus(RedPointType.MonthGiftPage) diff --git a/Assets/ManagedResources/~Lua/Modules/Vip/VipManager.lua b/Assets/ManagedResources/~Lua/Modules/Vip/VipManager.lua index f797516fb7..914430b21b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Vip/VipManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Vip/VipManager.lua @@ -412,13 +412,17 @@ function this.CheckNewVipRP() end function this.CheckGrowthPackagePointStatus()--成长礼包 - local redointTime =PlayerPrefs.GetInt(PlayerManager.uid.."czlb", 0) local rechargeNum= VipManager.GetChargedNum()--已经充值的金额 local shopData = ShopManager.GetShopDataByType(SHOP_TYPE.VIP_GIFT).storeItem local shopItemConfig = ConfigManager.GetConfig(ConfigName.StoreConfig) for i = 1, #shopData do local boughtNum = ShopManager.GetShopItemHadBuyTimes(SHOP_TYPE.VIP_GIFT, shopData[i].id) if rechargeNum >= shopItemConfig[shopData[i].id].BuyRule[2] and boughtNum == 0 then + local costId,finalNum,oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.VIP_GIFT, shopData[i].id, 1) + if finalNum <= 0 then + return true + end + local redointTime = PlayerPrefs.GetInt(PlayerManager.uid.."czlb"..shopData[i].id) if redointTime == 0 then return true end @@ -427,6 +431,18 @@ function this.CheckGrowthPackagePointStatus()--成长礼包 return false end +function this.SetGrowthPackagePointStatus()--成长礼包 + local shopItemConfig = ConfigManager.GetConfig(ConfigName.StoreConfig) + local rechargeNum= VipManager.GetChargedNum()--已经充值的金额 + local shopData = ShopManager.GetShopDataByType(SHOP_TYPE.VIP_GIFT).storeItem + for i = 1, #shopData do + local boughtNum = ShopManager.GetShopItemHadBuyTimes(SHOP_TYPE.VIP_GIFT, shopData[i].id) + if rechargeNum >= shopItemConfig[shopData[i].id].BuyRule[2] and boughtNum == 0 then + PlayerPrefs.SetInt(PlayerManager.uid.."czlb"..shopData[i].id, 1) + end + end +end + ---主界面显示使用 function this.SetVipLevelImg() --- vip 0 暂时没有资源 diff --git a/Assets/ManagedResources/~Lua/View/ShopView.lua b/Assets/ManagedResources/~Lua/View/ShopView.lua index dcfe4d91a6..55e003cd32 100644 --- a/Assets/ManagedResources/~Lua/View/ShopView.lua +++ b/Assets/ManagedResources/~Lua/View/ShopView.lua @@ -559,7 +559,6 @@ function this:RechargeSuccessFunc(id) OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.DemonCrystal, id) self:RefreshShopInfo(false, false,true) --PopupTipPanel.ShowTip("购买成功,请到邮箱中领取!") - PlayerPrefs.SetInt(PlayerManager.uid.."czlb", 0) CheckRedPointStatus(RedPointType.GrowthPackage)--成长礼包红点检测 end