From 9ed1f4f8c2f87034289f6a6fb691301d94586ca4 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Tue, 30 Mar 2021 20:20:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A6=8F=E6=98=9F=E9=AB=98=E7=85=A7?= =?UTF-8?q?=E3=80=91=E5=A2=9E=E5=8A=A0=E6=8B=8D=E8=84=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FuXingGaoZhao/FuXingGaoZhaoPanel.lua | 22 +++++++++---------- .../~Lua/Modules/Net/NetManager.lua | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/FuXingGaoZhao/FuXingGaoZhaoPanel.lua b/Assets/ManagedResources/~Lua/Modules/FuXingGaoZhao/FuXingGaoZhaoPanel.lua index 3b82217bff..9ed96d1515 100644 --- a/Assets/ManagedResources/~Lua/Modules/FuXingGaoZhao/FuXingGaoZhaoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FuXingGaoZhao/FuXingGaoZhaoPanel.lua @@ -5,6 +5,7 @@ local sortingOrder = 0 local rewardList = {} local itemPreList={} --item预设容器 local data +local func local timeData = string.split(ConfigManager.GetConfigDataByKey(ConfigName.SpecialConfig,"Id",109).Value,"#") --初始化组件(用于子类重写) @@ -20,7 +21,6 @@ function FuXingGaoZhao:InitComponent() table.insert(rewardList,self.mid.transform:GetChild(i-1)) end end - self.gift = ConfigManager.GetConfigDataByKey(ConfigName.StoreConfig,"Id",11001) self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft}) end --绑定事件(用于子类重写) @@ -33,13 +33,13 @@ function FuXingGaoZhao:BindEvent() Util.AddClick(self.getBtn,function () if data.ActState == 0 then local configData = ConfigManager.GetConfigDataByKey(ConfigName.SpecialConfig,"Id",110).Value - local string = string.split(configData,"#") - local costId, costNum = tonumber(string[1]),tonumber(string[2]) + local strings = string.split(configData,"#") + local costId, costNum = tonumber(strings[1]),tonumber(strings[2]) if costNum > BagManager.GetTotalItemNum(costId) then JumpManager.GoJump(36003) else local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name - MsgPanel.ShowTwo(string.format( "是否花费%s%s进行储值?",costNum,GetLanguageStrById(itemName)), nil, function() + MsgPanel.ShowTwo(string.format("是否花费%s%s进行储值?",costNum,itemName), nil, function() NetManager.FuXingStoreBuyRequest(data.activityId,function () PopupTipPanel.ShowTip("您已成功进行储值!") FuXingGaoZhao:Refresh() @@ -67,15 +67,11 @@ end function FuXingGaoZhao:OnSortingOrderChange() Util.AddParticleSortLayer(self.effect, self.sortingOrder - sortingOrder) sortingOrder = self.sortingOrder - -- if(#itemPreList ~= 0)then - -- for i=1,#itemPreList do - -- itemPreList[i]:SetEffectLayer(self.sortingOrder) - -- end - -- end end --界面打开时调用(用于子类重写) -function FuXingGaoZhao:OnOpen() +function FuXingGaoZhao:OnOpen(_func) + func = _func self.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main}) end @@ -154,7 +150,11 @@ function FuXingGaoZhao:OnClose() if self.timer then self.timer:Stop() self.timer = nil - end + end + if func then + func() + func = nil + end end --界面销毁时调用(用于子类重写) diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index fd28367046..f58748dd1e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -4891,7 +4891,7 @@ function this.FuXingStoreBuyRequest(activityId,func) local data = ActivityProto_pb.FuXingStoreBuyRequest() data.activityId = activityId local msg = data:SerializeToString() - Network:SendMessageWithCallBack(MessageTypeProto_pb.FU_XING_STORE_BUY_REQUEST, MessageTypeProto_pb.FU_XING_STORE_BUY_RESPONSE, nil, function(buffer) + Network:SendMessageWithCallBack(MessageTypeProto_pb.FU_XING_STORE_BUY_REQUEST, MessageTypeProto_pb.FU_XING_STORE_BUY_RESPONSE, msg, function(buffer) if func then func() end