推送礼包 完事儿

dev_chengFeng
ZhangBiao 2020-10-13 17:21:27 +08:00 committed by JieLing
parent 435590808a
commit 8c4ff7e148
1 changed files with 35 additions and 5 deletions

View File

@ -4,6 +4,7 @@ local this = UpGradePackagePanel
local RechargeConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)--整表数据
local upgradeConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",21)--五档奖励数据
local fightLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig)
local rechargeNum = 0
local cursortingOrder = 0
@ -61,7 +62,7 @@ function this:BindEvent()
curIndex = curIndex - 1
if curGiftList[curType][curIndex] then
else
while(curType <= 0) do
while(curType >= 0) do
if not activityType[curType] then
curType = LengthOfTable(activityType)
else
@ -152,9 +153,9 @@ function this:SetCurTypeAndIndex()
return curGiftList[curType][curIndex]
else
for k,v in pairs(curGiftList) do
for i = 1 ,#v do
if v and #v > 0 then
curType = k
curIndex = i
curIndex = 1
return curGiftList[curType][curIndex]
end
end
@ -163,13 +164,13 @@ function this:SetCurTypeAndIndex()
end
function this:Refresh()
local num = self:GetInfoList()
if num < 1 then
this:ClosePanel()
return
end
rechargeData = this:SetCurTypeAndIndex()
for k,v in pairs(activityType) do
Util.GetGameObject(self.gameObject,v.comp):SetActive(false)
end
@ -182,7 +183,36 @@ function this:Refresh()
level = (math.floor(PlayerManager.level/10)-1)*10+8
end
rechargeNum= VipManager.GetChargedNum()
this.tip.text = curType == 1 and Language[12000]..level..Language[12001] or ""
if curType == 1 then
this.tip.text = Language[12000]..level..Language[12001] or ""
elseif curType == 3 then
local specialConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,91).Value
local num = tonumber(specialConfig)
local value = fightLevelConfig[FightPointPassManager.lastPassFightId].SortId
local value2 = ConfigManager.GetConfigDataByKey(ConfigName.MainLevelConfig,"SortId",math.floor(value/num)*num).Name
this.tip.text ="恭喜您通关"..value2..",我们为您准备了超值礼包,帮助您快速通关"
elseif curType == 4 then
local specialConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,90).Value
local str = string.split(specialConfig,"|")
local nums = string.split(str[1],"#")
local canGet = false
local value = MonsterCampManager.monsterWave
local value2
if value < tonumber(nums[#nums]) then
local temp = tonumber(nums[#nums]) -tonumber(nums[#nums-1])
value2 = math.floor(value/temp) * temp
else
value2 = math.floor(value - tonumber(nums[#nums])/tonumber(str[2]))* tonumber(str[2]) + tonumber(nums[#nums])
end
this.tip.text ="恭喜您通过心魔试炼"..value2.."层,我们为您准备了超值礼包,帮助您快速通关"
else
this.tip.text = ""
end
-- this.tip.text = curType == 1 and Language[12000]..level..Language[12001] or ""
this.arrowsLeft:SetActive(num > 1)
this.arrowsRight:SetActive(num > 1)
curGiftId = rechargeData.goodsId