| 
									
										
										
										
											2020-08-06 17:52:32 +08:00
										 |  |  | require("Base/BasePanel") | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | local TreasureOfHeavenPanel = Inherit(BasePanel) | 
					
						
							|  |  |  | local this = TreasureOfHeavenPanel | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  | local curScore = 0--当前分数 | 
					
						
							|  |  |  | local rewardStateData = {} | 
					
						
							| 
									
										
										
										
											2020-07-24 18:30:26 +08:00
										 |  |  | local treasureState = nil | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  | local rewardData--表内活动数据 | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | --初始化组件(用于子类重写) | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:InitComponent() | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     --topBar/btnBack | 
					
						
							|  |  |  |     this.btnBack = Util.GetGameObject(this.transform, "bg/btnBack") | 
					
						
							|  |  |  |     this.buyBtn = Util.GetGameObject(this.transform, "bg/topBar/buyBtn") | 
					
						
							|  |  |  |     this.Text1 = Util.GetGameObject(this.buyBtn, "buy") | 
					
						
							|  |  |  |     this.Text2 = Util.GetGameObject(this.buyBtn, "hadbuy") | 
					
						
							| 
									
										
										
										
											2020-06-18 20:39:29 +08:00
										 |  |  |     this.tips = Util.GetGameObject(this.transform, "bg/topBar/tips"):GetComponent("Text") | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  |     this.time = Util.GetGameObject(this.transform, "bg/topBar/tips/actTime"):GetComponent("Text") | 
					
						
							|  |  |  |     this.quesBtn = Util.GetGameObject(this.transform, "bg/quesBtn") | 
					
						
							|  |  |  |     this.helpPosition=this.quesBtn:GetComponent("RectTransform").localPosition | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     --Content | 
					
						
							|  |  |  |     this.scoreText = Util.GetGameObject(this.transform, "bg/pageContent/bg/score/number"):GetComponent("Text") | 
					
						
							|  |  |  |     this.treasureList = Util.GetGameObject(this.transform, "bg/pageContent/treasureList") | 
					
						
							|  |  |  |     this.itemPre = Util.GetGameObject(this.treasureList, "itemPro") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     --设置滚动条 | 
					
						
							|  |  |  |     this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.treasureList.transform,this.itemPre,nil,Vector2.New(950, 1000),1,1,Vector2.New(100, 25)) | 
					
						
							|  |  |  |     this.ScrollView.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, 0) | 
					
						
							|  |  |  |     this.ScrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5) | 
					
						
							|  |  |  |     this.ScrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5) | 
					
						
							|  |  |  |     this.ScrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5) | 
					
						
							|  |  |  |     this.ScrollView.moveTween.MomentumAmount = 1 | 
					
						
							|  |  |  |     this.ScrollView.moveTween.Strength = 2 | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  | end | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | --绑定事件(用于子类重写) | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:BindEvent() | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     Util.AddClick(this.btnBack,function() | 
					
						
							|  |  |  |         this:ClosePanel() | 
					
						
							|  |  |  |     end) | 
					
						
							|  |  |  |     Util.AddClick(this.quesBtn,function() | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  |         LogGreen(this.helpPosition.x.."+"..this.helpPosition.y) | 
					
						
							|  |  |  |         UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.TreasureOfHeaven,this.helpPosition.x,this.helpPosition.y) | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     end) | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:OnSortingOrderChange() | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --添加事件监听(用于子类重写) | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:AddListener() | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     Game.GlobalEvent:AddEvent(GameEvent.TreasureOfHeaven.RechargeSuccess, self.refresh,self) | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --移除事件监听(用于子类重写) | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:RemoveListener() | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeSuccess, self.refresh,self) | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --界面打开时调用(用于子类重写) | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:OnOpen(...) | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     --初始化数据 | 
					
						
							|  |  |  |     | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | -- 打开,重新打开时回调 | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:OnShow() | 
					
						
							| 
									
										
										
										
											2020-06-23 18:36:24 +08:00
										 |  |  |     this.tips.text = Language[11988] | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  |     this.time.text=TimeToDHMS(TreasureOfHeavenManger.GetLimitTime()-GetTimeStamp()) | 
					
						
							|  |  |  |     TreasureOfHeavenPanel:ShowTime() | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     TreasureOfHeavenPanel:refresh() | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  | function TreasureOfHeavenPanel:refresh() | 
					
						
							|  |  |  |     rewardData = TreasureOfHeavenManger.GetAllRewardData() | 
					
						
							|  |  |  |     treasureState = TreasureOfHeavenManger.GetTreasureState()--秘宝礼包状态 0:可购买  1:已购买 | 
					
						
							|  |  |  |     rewardStateData = TreasureOfHeavenManger.GetState()--任务状态 | 
					
						
							|  |  |  |     if #rewardStateData <= 0 then | 
					
						
							|  |  |  |         NetManager.TreasureOfHeavenScoreRequest(function(msg) | 
					
						
							|  |  |  |             curScore = TreasureOfHeavenManger.GetScore()--当前分数 | 
					
						
							|  |  |  |             rewardStateData = TreasureOfHeavenManger.GetState()--任务状态 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             TreasureOfHeavenPanel:topBar() | 
					
						
							|  |  |  |             TreasureOfHeavenPanel:showTaskList() | 
					
						
							|  |  |  |          end) | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |         curScore = TreasureOfHeavenManger.GetScore()--当前分数 | 
					
						
							|  |  |  |         TreasureOfHeavenPanel:topBar() | 
					
						
							|  |  |  |         TreasureOfHeavenPanel:showTaskList() | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --topBar按钮状态 | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:topBar() | 
					
						
							|  |  |  |     --设置礼包购买按钮状态 | 
					
						
							| 
									
										
										
										
											2020-07-24 18:30:26 +08:00
										 |  |  |     this.buyBtn:GetComponent("Button").interactable = treasureState == 0 | 
					
						
							|  |  |  |     this.Text1.gameObject:SetActive(treasureState == 0) | 
					
						
							|  |  |  |     this.Text2.gameObject:SetActive(treasureState == 1) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if treasureState == 0 then | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |         Util.AddOnceClick(this.buyBtn,function() | 
					
						
							| 
									
										
										
										
											2020-08-19 10:05:01 +08:00
										 |  |  |             UIManager.OpenPanel(UIName.HeavenUnlockExtraRewardPanel,1) | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |         end) | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2020-07-24 18:30:26 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     this.scoreText.text = curScore | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --任务列表 | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:showTaskList() | 
					
						
							|  |  |  |     this.ScrollView:SetData(rewardData,function(index, rewardItem) | 
					
						
							|  |  |  |         TreasureOfHeavenPanel:SingleTask(rewardItem, rewardData[index]) | 
					
						
							|  |  |  |     end) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     --定位打开界面时位置 | 
					
						
							|  |  |  |     local t = 0 | 
					
						
							|  |  |  |     if treasureState == 0 then | 
					
						
							|  |  |  |         for i = 1, #rewardStateData do | 
					
						
							|  |  |  |             if rewardStateData[i].state == 0 then | 
					
						
							|  |  |  |                 t = i | 
					
						
							|  |  |  |                 break | 
					
						
							|  |  |  |             end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |     elseif treasureState == 1 then | 
					
						
							|  |  |  |         for i = 1, #rewardStateData do | 
					
						
							|  |  |  |             if rewardStateData[i].state == 1 or rewardStateData[i].state == 0 then | 
					
						
							|  |  |  |                 t = i | 
					
						
							|  |  |  |                 break | 
					
						
							|  |  |  |             end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |     this.ScrollView:SetIndex(t-2) | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  | local itemsList={} | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  | --单个任务 | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:SingleTask(rewardItem, rewardSingleData) | 
					
						
							|  |  |  |     local scoreLevel = Util.GetGameObject(rewardItem, "scoreLevel"):GetComponent("Text") | 
					
						
							|  |  |  |     local pos1 = Util.GetGameObject(rewardItem, "itemPos_1") | 
					
						
							|  |  |  |     local pos3 = Util.GetGameObject(rewardItem, "itemPos_3") | 
					
						
							|  |  |  |     local pos4 = Util.GetGameObject(rewardItem, "itemPos_4") | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     if not itemsList[rewardItem] then | 
					
						
							|  |  |  |         local item1 = SubUIManager.Open(SubUIConfig.ItemView, pos1.transform) | 
					
						
							|  |  |  |         local item3 = SubUIManager.Open(SubUIConfig.ItemView, pos3.transform) | 
					
						
							|  |  |  |         local item4 = SubUIManager.Open(SubUIConfig.ItemView, pos4.transform) | 
					
						
							|  |  |  |         itemsList[rewardItem] ={item1,item3,item4} | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     scoreLevel.text = rewardSingleData.Integral | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  |     itemsList[rewardItem][1]:OnOpen(false, {rewardSingleData.Reward[1][1], rewardSingleData.Reward[1][2]}, 0.8, false) | 
					
						
							|  |  |  |     itemsList[rewardItem][2]:OnOpen(false, {rewardSingleData.TreasureReward[1][1], rewardSingleData.TreasureReward[1][2]}, 0.8, false) | 
					
						
							|  |  |  |     itemsList[rewardItem][3]:OnOpen(false, {rewardSingleData.TreasureReward[2][1], rewardSingleData.TreasureReward[2][2]}, 0.8, false) | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     --初始化按钮状态 | 
					
						
							|  |  |  |     TreasureOfHeavenPanel:InitButtonState(rewardItem, rewardSingleData) | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | --初始化按钮状态 | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:InitButtonState(rewardItem, rewardSingleData) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     local btnDeal = Util.GetGameObject(rewardItem, "btnDeal") | 
					
						
							|  |  |  |     local get = Util.GetGameObject(rewardItem, "btnDeal/get") | 
					
						
							|  |  |  |     local getAgain = Util.GetGameObject(rewardItem, "btnDeal/getAgain") | 
					
						
							|  |  |  |     local unfinished = Util.GetGameObject(rewardItem, "btnDeal/unfinished") | 
					
						
							|  |  |  |     local finished = Util.GetGameObject(rewardItem, "finished") | 
					
						
							|  |  |  |     local redPoint = Util.GetGameObject(rewardItem, "btnDeal/redPoint") | 
					
						
							|  |  |  |     --当前任务领取情况 | 
					
						
							|  |  |  |     local state = rewardStateData[rewardSingleData.Id].state | 
					
						
							|  |  |  |     --判断 | 
					
						
							|  |  |  |     if curScore >= rewardSingleData.Integral then | 
					
						
							|  |  |  |         if (state == -1) then | 
					
						
							|  |  |  |             btnDeal.gameObject:SetActive(false) | 
					
						
							|  |  |  |             get.gameObject:SetActive(false) | 
					
						
							|  |  |  |             getAgain.gameObject:SetActive(false) | 
					
						
							|  |  |  |             unfinished.gameObject:SetActive(false) | 
					
						
							|  |  |  |             finished.gameObject:SetActive(true) | 
					
						
							|  |  |  |         elseif (state == 1) then | 
					
						
							|  |  |  |             btnDeal.gameObject:SetActive(true) | 
					
						
							|  |  |  |             get.gameObject:SetActive(false) | 
					
						
							|  |  |  |             getAgain.gameObject:SetActive(true) | 
					
						
							|  |  |  |             unfinished.gameObject:SetActive(false) | 
					
						
							|  |  |  |             finished.gameObject:SetActive(false) | 
					
						
							|  |  |  |         else --rewardSingleData.state == 0 | 
					
						
							|  |  |  |             btnDeal.gameObject:SetActive(true) | 
					
						
							|  |  |  |             get.gameObject:SetActive(true) | 
					
						
							|  |  |  |             getAgain.gameObject:SetActive(false) | 
					
						
							|  |  |  |             unfinished.gameObject:SetActive(false) | 
					
						
							|  |  |  |             finished.gameObject:SetActive(false) | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |         btnDeal.gameObject:SetActive(true) | 
					
						
							|  |  |  |         get.gameObject:SetActive(false) | 
					
						
							|  |  |  |         getAgain.gameObject:SetActive(false) | 
					
						
							|  |  |  |         unfinished.gameObject:SetActive(true) | 
					
						
							|  |  |  |         finished.gameObject:SetActive(false) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |     --添加点击事件 | 
					
						
							|  |  |  |     Util.AddOnceClick(btnDeal,function() | 
					
						
							|  |  |  |         TreasureOfHeavenPanel:OnBtnDealClicked(rewardItem,rewardSingleData) | 
					
						
							|  |  |  |     end) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     --红点状态 | 
					
						
							|  |  |  |     redPoint:SetActive(TreasureOfHeavenManger.RedPointState(rewardStateData[rewardSingleData.Id],treasureState)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --按钮事件 | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:OnBtnDealClicked(rewardItem,rewardSingleData) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     local btnDeal = Util.GetGameObject(rewardItem, "btnDeal") | 
					
						
							|  |  |  |     local get = Util.GetGameObject(rewardItem, "btnDeal/get") | 
					
						
							|  |  |  |     local getAgain = Util.GetGameObject(rewardItem, "btnDeal/getAgain") | 
					
						
							|  |  |  |     local unfinished = Util.GetGameObject(rewardItem, "btnDeal/unfinished") | 
					
						
							|  |  |  |     local finished = Util.GetGameObject(rewardItem, "btnDeal/finished") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if curScore >= rewardSingleData.Integral then--分数达到要求 | 
					
						
							|  |  |  |         if (rewardStateData[rewardSingleData.Id].state == 0 and treasureState == 0) or--任务未领取+礼包未购买 | 
					
						
							|  |  |  |         (rewardStateData[rewardSingleData.Id].state == 1 and treasureState == 1) or--任务已领取+礼包已购买 | 
					
						
							|  |  |  |         (rewardStateData[rewardSingleData.Id].state == 0 and treasureState == 1)then--任务未领取+礼包已购买 | 
					
						
							|  |  |  |             NetManager.GetTreasureOfHeavenRewardRequest(rewardStateData[rewardSingleData.Id].id,function(msg) | 
					
						
							|  |  |  |                 UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1) | 
					
						
							|  |  |  |                 --需要刷新界面 | 
					
						
							|  |  |  |                 if treasureState == 0 then--判断是否已经购买了礼包 | 
					
						
							|  |  |  |                     TreasureOfHeavenManger.SetSingleRewardState(rewardStateData[rewardSingleData.Id].id,1) | 
					
						
							|  |  |  |                 else | 
					
						
							|  |  |  |                     TreasureOfHeavenManger.SetSingleRewardState(rewardStateData[rewardSingleData.Id].id,-1) | 
					
						
							|  |  |  |                 end | 
					
						
							|  |  |  |                 TreasureOfHeavenPanel:refresh()--刷新界面 | 
					
						
							|  |  |  |             end) | 
					
						
							|  |  |  |         elseif rewardStateData[rewardSingleData.Id].state == 1 and treasureState == 0 then----任务已领取+礼包未购买(弹出购买界面) | 
					
						
							| 
									
										
										
										
											2020-08-19 10:05:01 +08:00
										 |  |  |             UIManager.OpenPanel(UIName.HeavenUnlockExtraRewardPanel,1) | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |         end | 
					
						
							|  |  |  |     else--分数未达到要求 | 
					
						
							| 
									
										
										
										
											2020-06-23 18:36:24 +08:00
										 |  |  |         PopupTipPanel.ShowTip(Language[11989]) | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     end | 
					
						
							|  |  |  | end | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  | function TreasureOfHeavenPanel:ShowTime() | 
					
						
							|  |  |  |     if self.localTimer then | 
					
						
							|  |  |  |         self.localTimer:Stop() | 
					
						
							|  |  |  |         self.localTimer = nil | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |     local t = TreasureOfHeavenManger.GetLimitTime() | 
					
						
							| 
									
										
										
										
											2020-07-24 12:11:00 +08:00
										 |  |  |     local time | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  |     self.localTimer = Timer.New(function() | 
					
						
							| 
									
										
										
										
											2020-07-24 12:11:00 +08:00
										 |  |  |         time = t-GetTimeStamp() | 
					
						
							|  |  |  |         if t-GetTimeStamp() <= 0  then | 
					
						
							|  |  |  |             time = 0 | 
					
						
							|  |  |  |             t = TreasureOfHeavenManger.GetLimitTime() | 
					
						
							| 
									
										
										
										
											2020-07-24 18:30:26 +08:00
										 |  |  |             treasureState = nil | 
					
						
							|  |  |  |             TreasureOfHeavenPanel:refresh() | 
					
						
							| 
									
										
										
										
											2020-07-24 12:11:00 +08:00
										 |  |  |         end | 
					
						
							|  |  |  |         this.time.text=TimeToDHMS(time) | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  |     end,1,-1,true) | 
					
						
							|  |  |  |     self.localTimer:Start() | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | --界面关闭时调用(用于子类重写) | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:OnClose() | 
					
						
							| 
									
										
										
										
											2020-06-30 18:59:44 +08:00
										 |  |  |     if self.localTimer then | 
					
						
							|  |  |  |         self.localTimer:Stop() | 
					
						
							|  |  |  |         self.localTimer = nil | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --界面销毁时调用(用于子类重写) | 
					
						
							|  |  |  | function TreasureOfHeavenPanel:OnDestroy() | 
					
						
							| 
									
										
										
										
											2020-06-03 19:09:01 +08:00
										 |  |  |     rewardStateData = {} | 
					
						
							| 
									
										
										
										
											2020-05-25 19:16:23 +08:00
										 |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-23 18:36:24 +08:00
										 |  |  | return TreasureOfHeavenPanel |