local UIDragonArterySummaryPanel = UIViewClass() local TIME_EXIT = 60 --离开副本倒计时 function UIDragonArterySummaryPanel:OnOpened(context) UIUtils.SetActive(self.group_Bottom, not context.isShareOpen) UIUtils.SetActive(self.btn_ShareClose, context.isShareOpen) for i, v in ipairs(context.result.country) do self:ShowCountryInfo(self.group_Main[i], v, i) end if context.isShareOpen == false then self:StartRepeatFunc(self.OnBackButtonPressed, TIME_EXIT, 1) end end function UIDragonArterySummaryPanel:ShowCountryInfo(comp, info, index) if index == 1 then if info.dragonSoul > 0 then UIUtils.SetActive(comp.img_DragonSoul, true) comp.lab_DragonSoul.text = info.dragonSoul else UIUtils.SetActive(comp.img_DragonSoul, false) end UIUtils.SetLabelText(comp.lab_rank, Const_IDS.IDS_DragonArtey_Winner) else comp.lab_rank.text = string.FormatByIdsId(Const_IDS.IDS_DragonArtey_RankTitle2, index) end comp.state_Country:SetState(info.countryId - 1) comp.lab_CountryIntegral.text = info.totalScore local isContains = false for i, v in ipairs(info.players) do if v.playerAcid == self.context.targetAcid then isContains = true UIUtils.SetActive(comp.group_MyRank.gameObject, true) self:ShowPlayerInfo(comp.group_MyRank, v, i) if self.context.isShareOpen == false then self:UpdateMyReward(i, index, v.score) end end comp.loop_DragonArterySummary:AddData(v, 0) end if isContains == false then UIUtils.SetActive(comp.group_MyRank.gameObject, false) UIUtils.SetActive(comp.group_Mine, false) else UIUtils.SetActive(comp.group_Mine, true) end end function UIDragonArterySummaryPanel:OnCellInit(scrollRect, index, cellTable, data) UIUtils.SetActive(cellTable.img_Bg, index % 2 == 0) self:ShowPlayerInfo(cellTable, data, index + 1) end function UIDragonArterySummaryPanel:ShowPlayerInfo(comp, info, index) if index <= 3 then comp.UIState:SetState(index - 1) else comp.UIState:SetState(3) end comp.txt_Rank.text = index CTL.Guild.SetGuildEmblem(comp.img_GuildIcon, comp.txt_Guild, info.emblemFrame, info.emblemContent) comp.txt_Name.text = info.playerName comp.txt_Server.text = "S." .. info.serId comp.txt_Integral.text = info.score end function UIDragonArterySummaryPanel:UpdateMyReward(playerRank, countryRank, score) local minPoint = DataSheetManager.ConstData:GetDataByID("DragonArteryRewardPoint").IntValue if playerRank > 0 and score >= minPoint then UIUtils.SetActive(self.group_reward, true) UIUtils.SetActive(self.group_noReward, false) local dragonArteryType = MDL.DragonArtery.GetEnterDragonArteryType() local reward = DataSheetManager.DragonArteryPersonRank:GetDataByCountryRank_BattleFieldID_PersonRank(countryRank, dragonArteryType, playerRank) local rewardArray = DataSheetManager.DragonArteryRankReward:GetDataByID(reward.RewardID).Item_Table for i, v in ipairs(rewardArray) do local contentItem = self:InstantiateCollection(self.group_Item, self.ItemTemplate.gameObject) contentItem.ItemID = v.ItemID UIUtils.SetActive(contentItem.gameObject, true) UTL.Item.SetItemCell(contentItem, v.ItemID, v.ItemNum) end else UIUtils.SetActive(self.group_reward, false) UIUtils.SetActive(self.group_noReward, true) self.lab_RewardTips.text = string.FormatByIdsId(Const_IDS.IDS_DragonArtey_MinPoints, minPoint) end end function UIDragonArterySummaryPanel:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIDragonArterySummaryPanel:OnButtonClicked(comp) if comp == self.btn_Close or comp == self.btn_ShareClose then self:CloseView() if self.context.isShareOpen == false then --从分享结果打开的,不需要退出场景 MDL.Level.SendRoleLeaveFuben() end elseif comp == self.btn_Share then MDL.ChannelChat.ShareDragonArteryResult(MDL.ChannelChat.ChannelCfgId.World, self.context.result.battleId) CTL.Tips.AddTipsMsg(Const_IDS["IDS_GoldHeroActivity_SynergyBoss_Help_Hint13"]) else for i, v in ipairs(self.group_Main) do if comp == v.btn_Detail then UIManager.OpenView(Const_UI_Lua.UIEnum.UIDragonArterySummaryInfoPanel, { info = self.context.result.country[i], rankIndex = i }) return end end for i, v in ipairs(self.group_Item) do if comp == v.event_Click then UTL.ItemTips.ShowCommonTipsById(v.ItemID) return end end end end return UIDragonArterySummaryPanel