惊喜礼包推送修改提交

dev_chengFeng
jiaoyangna 2021-06-17 15:05:44 +08:00
parent b1e3d0a163
commit bc20fa57fc
3 changed files with 15 additions and 39 deletions

View File

@ -1130,7 +1130,7 @@ function this.TimeFormat()
if ishow then
if v.ActId == 666 then
local giftList = {}
giftList = OperatingManager.GetInfoList()
giftList = OperatingManager.GetInfoList(v.ShopData)
if #giftList > 0 then
local time = giftList[1].endTime - GetTimeStamp()
if time < 1 then
@ -1430,7 +1430,7 @@ function this.RefreshActivityShow()
if v.ActId == 666 then
--限时折扣
local giftList = {}
giftList = OperatingManager.GetInfoList()
giftList = OperatingManager.GetInfoList(v.ShopData)
if #giftList > 0 then
local time = giftList[1].endTime - GetTimeStamp()
if time < 1 then

View File

@ -967,45 +967,22 @@ function this.GetTimeLimitSkinInfoList()
return nil
end
--为限时折扣写的(含有多个)
function this.GetInfoList()
function this.GetInfoList(showData)
local giftList={}
local infoList = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift)--拿取所有类型5礼包信息(包含需要的礼包)
local infoList2 = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",21)
for index, value in pairs(infoList) do
if not showData or #showData < 1 then
return giftList
end
local giftList2 = {}
for i = 1,#showData[1] do
local infoList2 = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",showData[1][i])
for i = 1, #infoList2 do
if infoList2[i].Id == value.goodsId and value.dynamicBuyTimes > 0 then
table.insert(giftList,value)
end
table.insert(giftList2,infoList2[i])
end
end
local infoList3 = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",8)
for index, value in pairs(infoList) do
for i = 1, #infoList3 do
if infoList3[i].Id == value.goodsId and value.dynamicBuyTimes > 0 then
table.insert(giftList,value)
end
end
end
local infoList4 = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",25)
for index, value in pairs(infoList) do
for i = 1, #infoList4 do
if infoList4[i].Id == value.goodsId and value.dynamicBuyTimes > 0 then
table.insert(giftList,value)
end
end
end
local infoList5 = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",26)
for index, value in pairs(infoList) do
for i = 1, #infoList5 do
if infoList5[i].Id == value.goodsId and value.dynamicBuyTimes > 0 then
table.insert(giftList,value)
end
end
end
local infoList6 = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",31)
for index, value in pairs(infoList) do
for i = 1, #infoList6 do
if infoList6[i].Id == value.goodsId and value.dynamicBuyTimes > 0 then
for i = 1, #giftList2 do
if giftList2[i].Id == value.goodsId and value.dynamicBuyTimes > 0 then
table.insert(giftList,value)
end
end

View File

@ -17,10 +17,11 @@ local fun--回调
local rechargeData
local activityType = {
[1] = {name = Language[11935],timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 21,Text = Language[12319]},
[2] = {name = Language[11936],timePos = Vector3.New(0,-567,0),comp = "bg2",showType = 8},
[2] = {name = Language[11936],timePos = Vector3.New(0,-567,0),comp = "bg2",showType = 8,Text = ""},
[3] = {name = "关卡推送礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 25,Text = Language[12320]},
[4] = {name = "心魔试炼礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 26,Text = Language[12321]},
[5] = {name = "灵兽推送礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 31,Text = "恭喜您获得极品灵兽,这是为您准备的灵兽成长礼包,助您实力飞升"},
[6] = {name = "惊喜礼包",timePos = Vector3.New(0,-255.6,0),comp = "bg1",showType = 31,Text = "购买惊喜礼盒成功激活限时豪礼,祝您战力飞升,一路通关"},
}
--初始化组件(用于子类重写)
function this:InitComponent()
@ -185,10 +186,8 @@ function this:Refresh()
LogBlue("#curGiftId:"..tostring(curGiftId))
if curType == 1 then
this.tip.text = string.format(activityType[curType].Text,RechargeConfig[curGiftId].Desc)
elseif curType == 3 or curType == 4 or curType == 5 then
this.tip.text = string.format(activityType[curType].Text)
else
this.tip.text = ""
this.tip.text = string.format(activityType[curType].Text)
end
this.arrowsLeft:SetActive(num > 1)