超值返利提交

dev_chengFeng
jiaoyangna 2021-12-17 11:22:54 +08:00
parent 052d7418ca
commit ec53e8ad84
3 changed files with 21 additions and 22 deletions

View File

@ -1381,6 +1381,7 @@ ActivityTypeDef = {
jingjishilian = 88, jingjishilian = 88,
chaozhifanli = 90, chaozhifanli = 90,
chaozhifanli30 = 91,
} }
--活动结束需要处理面板关闭类型 --活动结束需要处理面板关闭类型
ActivityTypePanel = { ActivityTypePanel = {

View File

@ -8,8 +8,8 @@ local activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardCo
local TabBox = require("Modules/Common/TabBox") local TabBox = require("Modules/Common/TabBox")
local tabs = {} local tabs = {}
local BTNS = { local BTNS = {
[1] = {bg1 = "b_baibao_andi",bg2 = "b_baibao_liangdi",text1 = "6\n",showType = 48,}, [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,}, [2] = {bg1 = "b_baibao_andi",bg2 = "b_baibao_liangdi",text1 = "30\n",showType = 49,actType = ActivityTypeDef.chaozhifanli30},
} }
local curPage = 1 local curPage = 1
function PremiumRebatePanel:InitComponent() function PremiumRebatePanel:InitComponent()
@ -88,13 +88,14 @@ end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写) --界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function PremiumRebatePanel:OnShow() function PremiumRebatePanel:OnShow()
self.actData = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.chaozhifanli) curPage = 1
self.actConfigData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",ActivityTypeDef.chaozhifanli)
self:Refresh(true,true) self:Refresh(true,true)
end end
function PremiumRebatePanel:Refresh(isTop,isAni) function PremiumRebatePanel:Refresh(isTop,isAni)
self.actData = ActivityGiftManager.GetActivityInfo(BTNS[curPage].actType)
self.giftData = DynamicActivityManager.GetGiftDataByType({DataType.Direct,5,BTNS[curPage].showType}) 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:SetRewardShow(isTop,isAni)
self:SetTime() self:SetTime()
end end
@ -104,6 +105,7 @@ function PremiumRebatePanel:SetRewardShow(isTop,isAni)
self.scrollView:SetData(self.giftData, function (index, item) self.scrollView:SetData(self.giftData, function (index, item)
self:ShowSingleHero(item, self.giftData[index],index) self:ShowSingleHero(item, self.giftData[index],index)
end,not isTop,not isAni) end,not isTop,not isAni)
self.scrollView:SetIndex(self.actData.mission[1].progress)
end end
function PremiumRebatePanel:ShowSingleHero(go,_data,index) function PremiumRebatePanel:ShowSingleHero(go,_data,index)
@ -134,22 +136,20 @@ function PremiumRebatePanel:ShowSingleHero(go,_data,index)
btnText.gameObject:SetActive(true) btnText.gameObject:SetActive(true)
btnText.text = string.format("%s 元",_data.data.price) btnText.text = string.format("%s 元",_data.data.price)
local missionData = self.actData.mission[(curPage - 1)*15 + index] local missionData = self.actData.mission[(curPage - 1)*15 + index]
if missionData then if missionData.state == 0 and index == missionData.progress then
if missionData.state == 0 then Util.SetGray(btnGet,false)
Util.SetGray(btnGet,false) Util.AddOnceClick(btnGet,function ()
Util.AddOnceClick(btnGet,function () PayManager.Pay(_data.data.shopData.goodsId, function(id)
PayManager.Pay(_data.data.shopData.goodsId, function(id) FirstRechargeManager.RefreshAccumRechargeValue(_data.data.shopData.goodsId)
FirstRechargeManager.RefreshAccumRechargeValue(_data.data.shopData.goodsId) OperatingManager.SetHadBuyGoodsId({_data.data.shopData.goodsId})
OperatingManager.SetHadBuyGoodsId({_data.data.shopData.goodsId}) missionData.state = 0
missionData.state = 0 self:ShowSingleHero(go,_data,index)
self:ShowSingleHero(go,_data,index) self:Refresh(false,false)
self:Refresh(false,false)
end)
end) end)
else end)
Util.SetGray(btnGet,true) elseif missionData.state == 1 then
btnText.text = "已购买" Util.SetGray(btnGet,true)
end btnText.text = "已购买"
else else
Util.SetGray(btnGet,true) Util.SetGray(btnGet,true)
PopupTipPanel.ShowTip("累计购买X天后才可购买") PopupTipPanel.ShowTip("累计购买X天后才可购买")

View File

@ -378,14 +378,13 @@ function this.SetMissionData()
Util.AddOnceClick(this.RewardList[j].Btn,function() Util.AddOnceClick(this.RewardList[j].Btn,function()
JumpManager.GoJump(dataConfig.Jump[1]) JumpManager.GoJump(dataConfig.Jump[1])
Game.GlobalEvent:DispatchEvent(GameEvent.PatFace.PatFaceClear) Game.GlobalEvent:DispatchEvent(GameEvent.PatFace.PatFaceClear)
this:ClosePanel()
end) end)
Util.AddOnceClick(this.RewardList[j].btnGet,function() Util.AddOnceClick(this.RewardList[j].btnGet,function()
if curPage == 3 and j == 3 then if curPage == 3 and j == 3 then
DynamicActivityManager.Index = 5
JumpManager.GoJump(36012) JumpManager.GoJump(36012)
Game.GlobalEvent:DispatchEvent(GameEvent.PatFace.PatFaceClear) Game.GlobalEvent:DispatchEvent(GameEvent.PatFace.PatFaceClear)
this:ClosePanel()
else else
NetManager.GetActivityRewardRequest(idList[curPage][j].id, actData.activityId,function(drop) NetManager.GetActivityRewardRequest(idList[curPage][j].id, actData.activityId,function(drop)
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function() 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 this.RewardList[index].btnTip.text = idList[curPage][index].state1
else else
this.RewardList[index].btnGet.gameObject:SetActive(true) this.RewardList[index].btnGet.gameObject:SetActive(true)
LogGreen("curPage:"..curPage.." index:"..index.." missionId:"..missionId)
this.RewardList[index].btnGetTip.text = idList[curPage][index].state2 this.RewardList[index].btnGetTip.text = idList[curPage][index].state2
end end
end end