local UIHeroFundChooseTips = UIViewClass() function UIHeroFundChooseTips:OnOpened(context) self.id = context.id self.type = context.type self:RefreshFundChooseTips(context.type) end function UIHeroFundChooseTips:RefreshFundChooseTips(type) local id = self.id local data if type == LuaConst.ShowGoldenType.Hero then data = DataSheetManager.HeroNum:GetDataByID(id) UIUtils.SetLabel(self.lab_Info, string.FormatByIdsId(Const_IDS.IDS_HeroFund_Tips4, UIUtils.GetLocalizedTxt(Const_IDS[data.NameIDS]))) UTL.Item.ItemSquareIcon(self.item, self.img_QualityBg, data.PieceItem) elseif type == LuaConst.ShowGoldenType.Horse then data = DataSheetManager.HorseData:GetDataByHorseID(id) UIUtils.SetLabel(self.lab_Info, string.FormatByIdsId(Const_IDS.IDS_HorseFund_Tips4, UIUtils.GetLocalizedTxt(Const_IDS[data.HorseName]))) UTL.Item.ItemSquareIcon(self.item, self.img_QualityBg, data.PieceItem) elseif type == LuaConst.ShowGoldenType.Treasure then data = DataSheetManager.TreasureData:GetDataByTreasureID(id) UIUtils.SetLabel(self.lab_Info, string.FormatByIdsId(Const_IDS.IDS_TreasureFund_Tips4, UIUtils.GetLocalizedTxt(Const_IDS[data.TreasureName]))) UTL.Item.ItemSquareIcon(self.item, self.img_QualityBg, data.PieceItem) end local _, _, getStarLevelFunc = CTL.HeroFund.Get_Has_ReachMax_GetStarLevel_Func(type) local breakLevel = getStarLevelFunc(id) UIUtils.SetLabel(self.lab_Break, "+" .. breakLevel) UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS.IDS_COMMON_PROMPT) end function UIHeroFundChooseTips:OnBackButtonPressed() self:OnButtonClicked(self.btn_Cancel) end function UIHeroFundChooseTips:OnButtonClicked(comp) if comp == self.btn_Cancel or comp == self.UICommonPopUp.btn_Close then self:CloseView() elseif comp == self.btn_Exchange then MDL.HeroFund.HeroFundSelectReq(self.type, self.id) end end return UIHeroFundChooseTips