超值返利提交
parent
052d7418ca
commit
ec53e8ad84
|
@ -1381,6 +1381,7 @@ ActivityTypeDef = {
|
|||
jingjishilian = 88,
|
||||
|
||||
chaozhifanli = 90,
|
||||
chaozhifanli30 = 91,
|
||||
}
|
||||
--活动结束需要处理面板关闭类型
|
||||
ActivityTypePanel = {
|
||||
|
|
|
@ -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天后才可购买!")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue