From ec53e8ad84101fd8a00a4d8b7aa56993a82123ff Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 17 Dec 2021 11:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E5=80=BC=E8=BF=94=E5=88=A9=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Common/GlobalDefine.lua | 1 + .../ContinuePackage/PremiumRebatePanel.lua | 38 +++++++++---------- .../Modules/Popup/SupremeHeroPopupNew.lua | 4 +- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index 296a1d0c66..a079f8d9d4 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1381,6 +1381,7 @@ ActivityTypeDef = { jingjishilian = 88, chaozhifanli = 90, + chaozhifanli30 = 91, } --活动结束需要处理面板关闭类型 ActivityTypePanel = { diff --git a/Assets/ManagedResources/~Lua/Modules/ContinuePackage/PremiumRebatePanel.lua b/Assets/ManagedResources/~Lua/Modules/ContinuePackage/PremiumRebatePanel.lua index 6519ba3e20..b342502546 100644 --- a/Assets/ManagedResources/~Lua/Modules/ContinuePackage/PremiumRebatePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/ContinuePackage/PremiumRebatePanel.lua @@ -8,8 +8,8 @@ local activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardCo local TabBox = require("Modules/Common/TabBox") local tabs = {} local BTNS = { - [1] = {bg1 = "b_baibao_andi",bg2 = "b_baibao_liangdi",text1 = "6\n元",showType = 48,}, - [2] = {bg1 = "b_baibao_andi",bg2 = "b_baibao_liangdi",text1 = "30\n元",showType = 49,}, + [1] = {bg1 = "b_baibao_andi",bg2 = "b_baibao_liangdi",text1 = "6\n元",showType = 48,actType = ActivityTypeDef.chaozhifanli}, + [2] = {bg1 = "b_baibao_andi",bg2 = "b_baibao_liangdi",text1 = "30\n元",showType = 49,actType = ActivityTypeDef.chaozhifanli30}, } local curPage = 1 function PremiumRebatePanel:InitComponent() @@ -88,13 +88,14 @@ end --界面打开或者重新打开后,界面刷新时调用(用于子类重写) function PremiumRebatePanel:OnShow() - self.actData = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.chaozhifanli) - self.actConfigData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",ActivityTypeDef.chaozhifanli) + curPage = 1 self:Refresh(true,true) end function PremiumRebatePanel:Refresh(isTop,isAni) + self.actData = ActivityGiftManager.GetActivityInfo(BTNS[curPage].actType) self.giftData = DynamicActivityManager.GetGiftDataByType({DataType.Direct,5,BTNS[curPage].showType}) + self.actConfigData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",BTNS[curPage].actType) self:SetRewardShow(isTop,isAni) self:SetTime() end @@ -104,6 +105,7 @@ function PremiumRebatePanel:SetRewardShow(isTop,isAni) self.scrollView:SetData(self.giftData, function (index, item) self:ShowSingleHero(item, self.giftData[index],index) end,not isTop,not isAni) + self.scrollView:SetIndex(self.actData.mission[1].progress) end function PremiumRebatePanel:ShowSingleHero(go,_data,index) @@ -134,22 +136,20 @@ function PremiumRebatePanel:ShowSingleHero(go,_data,index) btnText.gameObject:SetActive(true) btnText.text = string.format("%s 元",_data.data.price) local missionData = self.actData.mission[(curPage - 1)*15 + index] - if missionData then - if missionData.state == 0 then - Util.SetGray(btnGet,false) - Util.AddOnceClick(btnGet,function () - PayManager.Pay(_data.data.shopData.goodsId, function(id) - FirstRechargeManager.RefreshAccumRechargeValue(_data.data.shopData.goodsId) - OperatingManager.SetHadBuyGoodsId({_data.data.shopData.goodsId}) - missionData.state = 0 - self:ShowSingleHero(go,_data,index) - self:Refresh(false,false) - end) + if missionData.state == 0 and index == missionData.progress then + Util.SetGray(btnGet,false) + Util.AddOnceClick(btnGet,function () + PayManager.Pay(_data.data.shopData.goodsId, function(id) + FirstRechargeManager.RefreshAccumRechargeValue(_data.data.shopData.goodsId) + OperatingManager.SetHadBuyGoodsId({_data.data.shopData.goodsId}) + missionData.state = 0 + self:ShowSingleHero(go,_data,index) + self:Refresh(false,false) end) - else - Util.SetGray(btnGet,true) - btnText.text = "已购买" - end + end) + elseif missionData.state == 1 then + Util.SetGray(btnGet,true) + btnText.text = "已购买" else Util.SetGray(btnGet,true) PopupTipPanel.ShowTip("累计购买X天后才可购买!") diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/SupremeHeroPopupNew.lua b/Assets/ManagedResources/~Lua/Modules/Popup/SupremeHeroPopupNew.lua index c9a8b37ddb..80fbae8d70 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/SupremeHeroPopupNew.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/SupremeHeroPopupNew.lua @@ -378,14 +378,13 @@ function this.SetMissionData() Util.AddOnceClick(this.RewardList[j].Btn,function() JumpManager.GoJump(dataConfig.Jump[1]) Game.GlobalEvent:DispatchEvent(GameEvent.PatFace.PatFaceClear) - this:ClosePanel() end) Util.AddOnceClick(this.RewardList[j].btnGet,function() if curPage == 3 and j == 3 then + DynamicActivityManager.Index = 5 JumpManager.GoJump(36012) Game.GlobalEvent:DispatchEvent(GameEvent.PatFace.PatFaceClear) - this:ClosePanel() else NetManager.GetActivityRewardRequest(idList[curPage][j].id, actData.activityId,function(drop) UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function() @@ -424,7 +423,6 @@ function this.RefreshItemData(index,missionId) this.RewardList[index].btnTip.text = idList[curPage][index].state1 else this.RewardList[index].btnGet.gameObject:SetActive(true) - LogGreen("curPage:"..curPage.." index:"..index.." missionId:"..missionId) this.RewardList[index].btnGetTip.text = idList[curPage][index].state2 end end