From 7a43c51a48a541be3d4b47ee1dad7cbab56058c2 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Mon, 6 Dec 2021 11:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=BF=9E=E8=B4=AD=E7=A4=BC=E5=8C=85?= =?UTF-8?q?=E3=80=91=E6=AF=8F=E6=97=A5=E7=89=B9=E6=83=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NewActivity/CommonActPageManager.lua | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua b/Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua index a652fa1d13..c63930c77f 100644 --- a/Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua @@ -323,29 +323,39 @@ local TypeUpdateFunc = { for i = 1, #curData.rewards do for j = 1, #configData do if curData.rewards[i].missionId == configData[j].Id then - local tempData = {} - tempData.missionId = configData[j].Id - tempData.state = curData.rewards[i].state - tempData.otherData = {} - tempData.otherData.GoodId = configData[j].GoodId - tempData.otherData.canBuyDay = configData[j].BuyDay - curData.value - tempData.otherData.GoodType = configData[j].GoodType - tempData.otherData.Type = configData[j].Type - if configData[j].GoodType == 1 then - tempData.otherData.Name = rechargeConfig[configData[j].GoodId].Name - tempData.otherData.Reward = rechargeConfig[configData[j].GoodId].RewardShow - tempData.otherData.Price = rechargeConfig[configData[j].GoodId].Price - tempData.progress = OperatingManager.GetLeftBuyTime(5,configData[j].GoodId) - elseif configData[j].GoodType == 2 then - tempData.otherData.Name = goodsConfig[configData[j].GoodId].GoodsName - tempData.otherData.Reward = goodsConfig[configData[j].GoodId].Goods - tempData.otherData.Price = goodsConfig[configData[j].GoodId].Price - tempData.progress = goodsConfig[configData[j].GoodId].Limit - curData.rewards[i].progress + local func = function() + local tempData = {} + tempData.missionId = configData[j].Id + tempData.state = curData.rewards[i].state + tempData.otherData = {} + tempData.otherData.GoodId = configData[j].GoodId + tempData.otherData.canBuyDay = configData[j].BuyDay - curData.value + tempData.otherData.GoodType = configData[j].GoodType + tempData.otherData.Type = configData[j].Type + if configData[j].GoodType == 1 then + tempData.otherData.Name = rechargeConfig[configData[j].GoodId].Name + tempData.otherData.Reward = rechargeConfig[configData[j].GoodId].RewardShow + tempData.otherData.Price = rechargeConfig[configData[j].GoodId].Price + tempData.progress = OperatingManager.GetLeftBuyTime(5,configData[j].GoodId) + elseif configData[j].GoodType == 2 then + tempData.otherData.Name = goodsConfig[configData[j].GoodId].GoodsName + tempData.otherData.Reward = goodsConfig[configData[j].GoodId].Goods + tempData.otherData.Price = goodsConfig[configData[j].GoodId].Price + tempData.progress = goodsConfig[configData[j].GoodId].Limit - curData.rewards[i].progress + end + if not tempDataList[configData[j].Type] then + tempDataList[configData[j].Type] = {} + end + table.insert(tempDataList[configData[j].Type],tempData) end - if not tempDataList[configData[j].Type] then - tempDataList[configData[j].Type] = {} + --每日特惠类型为2每日只显示一个,前端手动关闭 + -- LogGreen("Type:"..tostring(configData[j].Type).." UnlockDay:"..tostring(configData[j].UnlockDay).." value:"..tostring(curData.value)) + if configData[j].Type == 2 and configData[j].UnlockDay == curData.value then + func() + elseif configData[j].Type ~= 2 then + func() end - table.insert(tempDataList[configData[j].Type],tempData) + end end end