From d1bb3391acf6acd04b38563b0e4f21ff0b92fc53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BD=AA?= <2han9b1a0@gmial.com> Date: Mon, 24 Jan 2022 17:09:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=B6=85=E5=80=BC=E5=9F=BA=E9=87=91?= =?UTF-8?q?=E3=80=91=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Common/GlobalDefine.lua | 2 + .../ActivityGift/ActivityGiftManager.lua | 4 +- .../~Lua/Modules/Main/MainPanel.lua | 12 --- .../NewActivity/CommonActPageManager.lua | 98 ++++++++++++++++++- .../Modules/Operating/UppperMonthCard.lua | 83 +++++++--------- .../~Lua/Modules/Player/RedpotManager.lua | 6 ++ 6 files changed, 142 insertions(+), 63 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index 604b16ba88..1105d460db 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1383,6 +1383,8 @@ ActivityTypeDef = { SurpriseBox = 69,--惊喜礼盒 TeHuiShenZhuang = 73,--特惠神装 ShanHeShiLian = 68,--山河试炼 + ChaoZhiJiJin_128 = 78,--超值基金128 + ChaoZhiJiJin_328 = 79,--超值基金328 --主题活动 ShengXingYouLi=50,--升星有礼(指定猎妖师进阶) diff --git a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua index 8265b9d319..4c11f56a45 100644 --- a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua @@ -138,9 +138,9 @@ function this.InitActivityServerData(msg, isUpdate) if GlobalActivity[v.activityId] then this.CheckMoneyProgress(v) this.mission[v.activityId] = v - LogYellow("刷新活动数据activityId:" .. v.activityId .. " value:" .. v.value) + -- LogYellow("刷新活动数据activityId:" .. v.activityId .. " value:" .. v.value) for n, m in ipairs(v.mission) do - --LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress) + -- LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress) if (v.activityId == ActivityTypeDef.OnlineGift) then this.onlineOpen = true this.onlineGetRewardState[m.missionId] = m.state diff --git a/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua index bfb226c1bf..bbe9586389 100644 --- a/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Main/MainPanel.lua @@ -1166,7 +1166,6 @@ function this:OnShow() this.InitFuncShow() this.RefreshActivityShow() this.RefreshFuncNewText() - this.RefreshGiftBtnShow() -- 刷新一次编队战斗力 FormationManager.RefreshMainFormationPower() this.TimeFormat() @@ -1432,15 +1431,6 @@ function this.TimeFormat() else showTab = false end - elseif v.ActId == 668 then - local actInfo = ActivityGiftManager.GetActivityInfoByType(v.ActiveType) - if actInfo and actInfo.value > 0 and (OperatingManager.IsBaseOpen(GoodsTypeDef.MONTHCARD_128) or OperatingManager.IsBaseOpen(GoodsTypeDef.MONTHCARD_328)) then - showTab = true - -- elseif OperatingManager.IsBaseOpen(GoodsTypeDef.MONTHCARD_128) or OperatingManager.IsBaseOpen(GoodsTypeDef.MONTHCARD_328) then - -- showTab = true - else - showTab = false - end elseif v.ShowTime == 1 and activityTabs[k].go.gameObject.activeSelf then if v.ActiveType > 0 then local QingLong = ActivityGiftManager.IsActivityTypeOpen(v.ActiveType) @@ -1721,8 +1711,6 @@ function this.RefreshActivityShow() end elseif v.FunType and v.FunType == 41 then showTab = DailyRechargeManager.GetDailyRechargeExist() - elseif v.ActiveType == 78 then - showTab = ActivityGiftManager.GetActivityValueInfo(v.ActiveType, activityId) > 0 or OperatingManager.IsBaseOpen(GoodsTypeDef.MONTHCARD_128) or OperatingManager.IsBaseOpen(GoodsTypeDef.MONTHCARD_328) else showTab = true end diff --git a/Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua b/Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua index f55916882d..bec38b3324 100644 --- a/Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/NewActivity/CommonActPageManager.lua @@ -386,11 +386,83 @@ local TypeUpdateFunc = { [ActivityTypeDef.zhongzhichengcheng] = function ()--秘宝达人 this.GetExpertData(5,ActivityTypeDef.zhongzhichengcheng) end, + [ActivityTypeDef.ChaoZhiJiJin_128] = function ()--超值基金128 + local curData = dataList[ActivityTypeDef.ChaoZhiJiJin_128] + --判断是否可领取 + curData.FreelyData.isGet = false + curData.FreelyData.isAllGet = true + for i = 1,#curData.rewards do + if curData.rewards[i].state == 0 then + curData.FreelyData.isGet = true + end + end + --数据 + local tempData = {} + local configData = ConfigManager.GetAllConfigsDataByKey(ConfigName.LuxuryFundConfig,"Type",ActivityTypeDef.ChaoZhiJiJin_128) + curData.FreelyData.isAllGet = #curData.rewards == #configData + for j = 1, #configData do + tempData[j] = {} + tempData[j].missionId = configData[j].Id + tempData[j].otherData = {} + tempData[j].otherData.Day = configData[j].Day + tempData[j].otherData.Reward = configData[j].reward + tempData[j].otherData.State = 1 + for i = 1, #curData.rewards do + if curData.rewards[i].missionId == configData[j].Id then + if curData.rewards[i].state == 0 then + tempData[j].otherData.State = 2--可领取 + elseif curData.rewards[i].state == 1 then + tempData[j].otherData.State = 3--已经领取 + end + end + end + end + curData.rewards = tempData + table.sort(curData.rewards,function (a,b) + return a.missionId < b.missionId + end) + end, + [ActivityTypeDef.ChaoZhiJiJin_328] = function ()--超值基金328 + local curData = dataList[ActivityTypeDef.ChaoZhiJiJin_328] + --判断是否可领取 + curData.FreelyData.isGet = false + curData.FreelyData.isAllGet = true + for i = 1,#curData.rewards do + if curData.rewards[i].state == 0 then + curData.FreelyData.isGet = true + end + end + --数据 + local tempData = {} + local configData = ConfigManager.GetAllConfigsDataByKey(ConfigName.LuxuryFundConfig,"Type",ActivityTypeDef.ChaoZhiJiJin_328) + curData.FreelyData.isAllGet = #curData.rewards == #configData + for j = 1, #configData do + tempData[j] = {} + tempData[j].missionId = configData[j].Id + tempData[j].otherData = {} + tempData[j].otherData.Day = configData[j].Day + tempData[j].otherData.Reward = configData[j].reward + tempData[j].otherData.State = 1 + for i = 1, #curData.rewards do + if curData.rewards[i].missionId == configData[j].Id then + if curData.rewards[i].state == 0 then + tempData[j].otherData.State = 2--可领取 + elseif curData.rewards[i].state == 1 then + tempData[j].otherData.State = 3--已经领取 + end + end + end + end + curData.rewards = tempData + table.sort(curData.rewards,function (a,b) + return a.missionId < b.missionId + end) + end, } --超凡入圣 function this.InitMissionDdataUpStar(curData) - local actRewardConfigs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId", curData.activityId) + local actRewardConfigs = ConfigManager.GetAllConfigsDataByKey(ConfigName.LuxuryFundConfig,"ActivityId", curData.activityId) for i = 1, #curData.rewards do for j = 1, #actRewardConfigs do if curData.rewards[i].missionId == actRewardConfigs[j].Id then @@ -745,4 +817,28 @@ function this.ShowIcon(Obj,linkActId) return end +function this.ChaoZhiJiJin128Red() + local data = this.GetData(ActivityTypeDef.ChaoZhiJiJin_128) + for i = 1, #data do + if data[i].otherData.State == 2 then + LogRed("ChaoZhiJiJin128Red return true") + return true + end + end + LogRed("ChaoZhiJiJin128Red return false") + return false +end + +function this.ChaoZhiJiJin328Red() + local data = this.GetData(ActivityTypeDef.ChaoZhiJiJin_328) + for i = 1, #data do + if data[i].otherData.State == 2 then + LogGreen("ChaoZhiJiJin328Red return true") + return true + end + end + LogGreen("ChaoZhiJiJin328Red return false") + return false +end + return CommonActPageManager \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Operating/UppperMonthCard.lua b/Assets/ManagedResources/~Lua/Modules/Operating/UppperMonthCard.lua index e5ff5e01e1..0bd9a53f5b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Operating/UppperMonthCard.lua +++ b/Assets/ManagedResources/~Lua/Modules/Operating/UppperMonthCard.lua @@ -88,13 +88,15 @@ function UpperMonthCard:BindEvent() UIManager.OpenPanel(UIName.HelpPopup,self.actConfig.HelpId,self.helpPosition.x,self.helpPosition.y) end) Util.AddOnceClick(self.btnBuy, function() - if self.actInfo.value < 2 then + if self.actInfo.value < 1 then PayManager.Pay(self.baseType, function(id) self:RechargeSuccessFunc(id) end) elseif self.isGet then NetManager.GetActivityRewardRequest(0,self.actInfo.activityId,function(msg) - UIManager.OpenPanel(UIName.RewardItemPopup, msg, 1) + UIManager.OpenPanel(UIName.RewardItemPopup, msg, 1,function () + self:OnShow() + end) end) end if self.actType == 78 then @@ -124,10 +126,11 @@ function UpperMonthCard:OnShow(_sortingOrder) self.gameObject:SetActive(true) self.sortingOrder = _sortingOrder self.actType = self.actConfig.ActiveType - self.actInfo = ActivityGiftManager.GetActivityInfoByType(self.actType) + -- self.actInfo = ActivityGiftManager.GetActivityInfoByType(self.actType) + self.actInfo = CommonActPageManager.GetData(self.actType) if not self.actInfo then self.parent:ClosePanel() - return + return end self.baseType = globalActivity[self.actInfo.activityId].CanBuyRechargeId[1] self:SetPanelType() @@ -157,42 +160,33 @@ end --- 设置不同界面的奖励信息 function UpperMonthCard:SetRewardInfo() - local mission = self.actInfo.mission - table.sort(mission,function(a,b) - return a.missionId < b.missionId - end) + local mission = self.actInfo.rewards if not self.itemLst then self.itemLst = {} end - for i = 1,math.max(#mission,LengthOfTable(self.itemLst)) do - if not mission[i] then - self.itemLst[i].go.gameObject:SetActive(false) - else - if not self.itemLst[i] then - self.itemLst[i] = {} - self.itemLst[i].go = newObjToParent(self.itemPre,self.grid) - self.itemLst[i].name = Util.GetGameObject(self.itemLst[i].go, "name"):GetComponent("Text") - self.itemLst[i].itemPos = Util.GetGameObject(self.itemLst[i].go, "itemPos") - self.itemLst[i].itemView = SubUIManager.Open(SubUIConfig.ItemView,self.itemLst[i].itemPos.transform) - self.itemLst[i].yiGet = Util.GetGameObject(self.itemLst[i].go, "yilingqu") - self.itemLst[i].redPoint = Util.GetGameObject(self.itemLst[i].go, "redPoint") - end - self.itemLst[i].go.gameObject:SetActive(true) - self.itemLst[i].name.text = string.format("第%s天",NumToChinese[i]) - local reward = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LuxuryFundConfig,"Type",self.baseType,"Day",i).reward[1] - self.itemLst[i].itemView:OnOpen(false, reward, 1.1, false, false, false, self.sortingOrder) - --1 已领取 0 未领 - if mission[i].state == 1 then - self.itemLst[i].yiGet.gameObject:SetActive(true) - self.itemLst[i].redPoint.gameObject:SetActive(false) - else - self.itemLst[i].yiGet.gameObject:SetActive(false) - if mission[i].progress == 1 then - self.itemLst[i].redPoint.gameObject:SetActive(true) - else - self.itemLst[i].redPoint.gameObject:SetActive(false) - end - end + for i = 1,#mission do + if not self.itemLst[i] then + self.itemLst[i] = {} + self.itemLst[i].go = newObjToParent(self.itemPre,self.grid) + self.itemLst[i].name = Util.GetGameObject(self.itemLst[i].go, "name"):GetComponent("Text") + self.itemLst[i].itemPos = Util.GetGameObject(self.itemLst[i].go, "itemPos") + self.itemLst[i].itemView = SubUIManager.Open(SubUIConfig.ItemView,self.itemLst[i].itemPos.transform) + self.itemLst[i].yiGet = Util.GetGameObject(self.itemLst[i].go, "yilingqu") + self.itemLst[i].redPoint = Util.GetGameObject(self.itemLst[i].go, "redPoint") + end + self.itemLst[i].go.gameObject:SetActive(true) + self.itemLst[i].name.text = string.format("第%s天",NumToChinese[i]) + local reward = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LuxuryFundConfig,"Type",self.baseType,"Day",i).reward[1] + self.itemLst[i].itemView:OnOpen(false, reward, 1.1, false, false, false, self.sortingOrder) + --1 已领取 0 未领 + self.itemLst[i].yiGet.gameObject:SetActive(false) + if mission[i].otherData.State == 1 then + self.itemLst[i].redPoint.gameObject:SetActive(false) + elseif mission[i].otherData.State == 2 then + self.itemLst[i].redPoint.gameObject:SetActive(true) + elseif mission[i].otherData.State == 3 then + self.itemLst[i].yiGet.gameObject:SetActive(true) + self.itemLst[i].redPoint.gameObject:SetActive(false) end end local v = self.gridRect.sizeDelta @@ -202,23 +196,16 @@ end --- 根据是否购买了显示信息 function UpperMonthCard:SetBuyState() - if self.actInfo.value < 2 then + if self.actInfo.value < 1 then self.btnBuy.gameObject:SetActive(true) self.btnBuyImage.sprite = self.spLoader:LoadSprite(state[0].bg) self.textBuy.text = MoneyUtil.GetMoneyUnitNameWithMoney(chargeConfig[self.baseType].Price) self.btnBuyRed.gameObject:SetActive(false) self.tip.gameObject:SetActive(false) else - self.isGet = false - self.isAllGet = true - for i = 1,#self.actInfo.mission do - if self.actInfo.mission[i].state == 0 and self.actInfo.mission[i].progress == 1 then - self.isGet = true - end - if self.actInfo.mission[i].state == 0 then - self.isAllGet = false - end - end + self.isGet = self.actInfo.FreelyData.isGet + self.isAllGet = self.actInfo.FreelyData.isAllGet + if self.isGet then self.btnBuy.gameObject:SetActive(true) self.btnBuyImage.sprite = self.spLoader:LoadSprite(state[1].bg) diff --git a/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua index 6adfc17cc8..2f63f42cb2 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua @@ -342,6 +342,9 @@ function this.InitRedPointAllRelate() --命格 RPData:SetParent(RedPointType.Gem,RedPointType.Practice_main) + --超值基金 + RPData:SetParent(RedPointType.jijin328,RedPointType.chaozhijijin) + RPData:SetParent(RedPointType.jijin128,RedPointType.chaozhijijin) for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.ActivityGroups)) do if v.RpType > 0 and v.RpTypeParent > 0 then @@ -658,6 +661,9 @@ function this.RegisterRedCheckFunc() --家园 RPData:AddCheckFunc(RedPointType.HomeLand,HomeLandManager.CheckRedMain,FUNCTION_OPEN_TYPE.HOMELAND) RPData:AddCheckFunc(RedPointType.FestevalRed,ActivityGiftManager.FestevalRedCheck) + --超值基金 + RPData:AddCheckFunc(RedPointType.jijin128,CommonActPageManager.ChaoZhiJiJin128Red) + RPData:AddCheckFunc(RedPointType.jijin328,CommonActPageManager.ChaoZhiJiJin328Red) end -- 向红点绑定物体