local UIFriendRechargePurchase = UIViewClass() function UIFriendRechargePurchase:OnOpened(context) self.activityType = context.activityType self.activityId = context.activityId if MDL.FriendRecharge.GetRechargeType() == MDL.FriendRecharge.RechargeType.FRTeam then self.state_Type:SetState(0) local teamBackGround2Cfg = MDL.OperationActivity.FriendRechargeBackGround2:GetDataByActivityID_ModeType(self.activityId, 1) UIUtils.SetLabelText(self.lab_Title, Const_IDS[teamBackGround2Cfg.TitleIDS]) CTL.Character.SetSelfPortraitAndFrame(self.player1.UIHeroHead) local rechargeBaseInfo = MDL.FriendRecharge.GetRechargeBaseInfo() local memberInfo = MDL.FriendRecharge.GetMemberPlayerInfo(rechargeBaseInfo.completedAcid) if memberInfo then CTL.Character.SetPortraitAndFrame(self.player2.UIHeroHead, memberInfo.PortraitId or memberInfo.portraitId, memberInfo.FrameId or memberInfo.frameId) UIUtils.SetLabel(self.lab_Purchased, string.FormatByIdsId(Const_IDS.IDS_FriendRecharge_Invitation_Hint6, memberInfo.name)) else CTL.Character.SetPortraitAndFrame(self.player2.UIHeroHead, 100001, 0) UIUtils.SetLabelText(self.lab_Purchased, Const_IDS.IDS_FriendRecharge_Invitation_Hint21) end else self.state_Type:SetState(1) local soloBackGround2Cfg = MDL.OperationActivity.FriendRechargeBackGround2:GetDataByActivityID_ModeType(self.activityId, 2) UIUtils.SetLabelText(self.lab_Title, Const_IDS[soloBackGround2Cfg.TitleIDS]) CTL.Character.SetSelfPortraitAndFrame(self.player_Self.UIHeroHead) UIUtils.SetLabelText(self.lab_Purchased, Const_IDS.IDS_FriendRecharge_Invitation_Hint7) end CTL.Sound.PlayGameSound("UI_breakout_03") end function UIFriendRechargePurchase:OnButtonClicked(comp) if comp == self.event_Bottom then self:CloseView() end end return UIFriendRechargePurchase