local UIGoldenHeroStoryEndingShow = UIViewClass() function UIGoldenHeroStoryEndingShow:OnOpened(context) self.activityId = context.activityId self.goldenHeroID = context.heroType local endingData = context.endingData self:RegistSystemEvent(EventID.UI_OperationActivity_CloseView, self.OnCloseActivitySelf) UIUtils.SetImageByAssetBundle(self.img_SecretPicture, endingData.bgName) -- 结局图片 UIUtils.SetLabelText(self.txt_Ending, Const_IDS[endingData.endingTitle]) -- 结局标题 UIUtils.SetLabelText(self.txt_EndingInfo, Const_IDS[endingData.endingDes]) -- 结局描述 end function UIGoldenHeroStoryEndingShow:OnCloseActivitySelf(viewClassPath, activityId) if viewClassPath == self.__viewClassPath then if self.activityId and activityId == self.activityId then self:CloseView() end end end function UIGoldenHeroStoryEndingShow:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIGoldenHeroStoryEndingShow:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() end end return UIGoldenHeroStoryEndingShow