BGFinishLiveView.m 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //
  2. // BGFinishLiveView.m
  3. // BuguLive
  4. //
  5. // Created by bugu on 2019/12/10.
  6. // Copyright © 2019 xfg. All rights reserved.
  7. //
  8. #import "BGFinishLiveView.h"
  9. @implementation BGFinishLiveView
  10. - (id)init
  11. {
  12. self = [[[NSBundle mainBundle] loadNibNamed:@"BGFinishLiveView" owner:self options:nil] lastObject];
  13. if(self)
  14. {
  15. self.frame = CGRectMake(0, 0, kScreenW, kScreenH);
  16. self.backgroundColor = kClearColor;
  17. self.bgView.backgroundColor = kGrayTransparentColor1;
  18. // // 毛玻璃效果
  19. // UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
  20. // UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect];
  21. // effectView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
  22. // [self.bgView sendSubviewToBack:effectView];
  23. //// bringSubviewToFront:effectView];
  24. //// insertSubview:effectView atIndex:0];
  25. // [self.bgView addSubview:effectView];
  26. self.userHeadImgView.layer.borderWidth = 1;
  27. self.userHeadImgView.layer.borderColor = kWhiteColor.CGColor;
  28. self.userHeadImgView.layer.cornerRadius = CGRectGetHeight(self.userHeadImgView.frame)/2;
  29. self.userHeadImgView.clipsToBounds = YES;
  30. self.hostContrainerView.backgroundColor = [[UIColor whiteColor]colorWithAlphaComponent:0.19];
  31. self.audienceBGView.backgroundColor = [[UIColor whiteColor]colorWithAlphaComponent:0.19];
  32. self.audienceBGView.layer.cornerRadius = 4;
  33. self.audienceBGView.layer.masksToBounds = YES;
  34. self.audienceBGView.hidden = YES;
  35. self.lineView.backgroundColor = [[UIColor whiteColor]colorWithAlphaComponent:0.13];
  36. NSString * pk = @"0";
  37. NSString * str = [NSString stringWithFormat:ASLocalizedString(@"击败了%@%%的用户"),pk];
  38. NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc]initWithString:str];
  39. [attribute setAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FFE629"]} range:NSMakeRange(ASLocalizedString(@"击败了").length, pk.length+1)];
  40. [_pkLabel setAttributedText:attribute];
  41. _pkLabel.hidden = YES;
  42. self.screenshotShareBtn.hidden = YES;
  43. self.consumStrLabel.text = [GlobalVariables sharedInstance].appModel.ticket_name;
  44. self.numberTitleStr.text = ASLocalizedString(@"观看人数");
  45. [self.backHomeBtn setTitle:ASLocalizedString(@"返回首页") forState:UIControlStateNormal];
  46. self.timeLab.text = ASLocalizedString(@"直播时长");
  47. [self.shareFollowBtn setTitle:ASLocalizedString(@"关注主播") forState:UIControlStateNormal];
  48. }
  49. return self;
  50. }
  51. - (void)layoutSubviews
  52. {
  53. [super layoutSubviews];
  54. self.userHeadImgView.layer.cornerRadius = CGRectGetWidth(self.userHeadImgView.frame)/2;
  55. self.topBtnConstraint.constant = MG_TOP_MARGIN + 5;
  56. }
  57. - (IBAction)shareFollowAction:(id)sender {
  58. if (_shareFollowBlock)
  59. {
  60. _shareFollowBlock();
  61. }
  62. }
  63. - (IBAction)backHomeAction:(id)sender {
  64. if (_backHomeBlock)
  65. {
  66. _backHomeBlock();
  67. }
  68. }
  69. - (IBAction)screenshotShareBtnAction:(id)sender {
  70. if (_screenshotShareBlock)
  71. {
  72. _screenshotShareBlock();
  73. }
  74. }
  75. @end