YOUPAIFinishMsgWindow.m 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. //
  2. // YOUPAILPYoungOpenWindow.m
  3. // livePro
  4. //
  5. // Created by leo on 2019/12/26.
  6. // Copyright © 2019 caiPro. All rights reserved.
  7. //
  8. #import "YOUPAIFinishMsgWindow.h"
  9. #import "NSString+YYAdd.h"
  10. @interface YOUPAIFinishMsgWindow ()<UIGestureRecognizerDelegate>
  11. @property(nonatomic,assign)CGFloat youpaiplefpadding,youpaipimgVHeight,youpaipimgVWidth,youpaiptitleHeight;
  12. @property(nonatomic,strong)UIImageView *youpaipimgV;
  13. @property(nonatomic,strong)UIButton *youpaipopenBtn;
  14. @property(nonatomic,strong)UILabel *youpaiptitleLab,*youpaipnoticeLab;
  15. @end
  16. @implementation YOUPAIFinishMsgWindow
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. // [self.view setFrame:CGRectMake(0, 0, _vWith, _vHeight)];
  20. // CAShapeLayer *maskLayer = [CAShapeLayer layer];
  21. // UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.view.bounds cornerRadius:25];
  22. // maskLayer.path = path.CGPath;
  23. // self.view.layer.mask = maskLayer;
  24. // [self.view setBackgroundColor:[UIColor whiteColor]];
  25. _youpaipimgVWidth = self.vWidth;
  26. _youpaipimgVHeight = 257* self.vWidth/640.0;
  27. _youpaiplefpadding = (KScreenWidth-_youpaipimgVWidth)/2.0;
  28. [self.baseView addSubview:self.youpaipimgV];
  29. [self.baseView addSubview:self.youpaiptitleLab];
  30. [self.baseView addSubview:self.youpaipopenBtn];
  31. [self.baseView addSubview:self.youpaipnoticeLab];
  32. NSString *titleStr = @"完善资料后即可认识小哥哥小姐姐啦~";
  33. [_youpaiptitleLab setText:titleStr];
  34. CGSize titleSize = [titleStr sizeForFont:LCBoldFont(16) size:CGSizeMake(self.vWidth-104, 200) mode:NSLineBreakByWordWrapping];
  35. _youpaiptitleHeight = titleSize.height;
  36. [_youpaipopenBtn setTitle:@"完善资料" forState:UIControlStateNormal];
  37. [_youpaiptitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.left.equalTo(self.baseView).with.offset(25);
  39. make.right.equalTo(self.baseView).with.offset(-25);
  40. make.top.equalTo(_youpaipimgV.mas_bottom).with.offset(10);
  41. // make.height.mas_equalTo(_titleHeight);
  42. }];
  43. [_youpaipopenBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  44. make.left.equalTo(self.baseView).with.offset(25);
  45. make.right.equalTo(self.baseView).with.offset(-25);
  46. make.top.equalTo(_youpaiptitleLab.mas_bottom).with.offset(20);
  47. make.height.mas_equalTo(48);
  48. }];
  49. [_youpaipopenBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(230, 48) FromColors:@[LZBFB6FFColor,LZ7C69FEColor] ByGradientType:1] forState:UIControlStateNormal];
  50. // Do any additional setup after loading the view.
  51. }
  52. -(UIImageView *)youpaipimgV
  53. {
  54. if(!_youpaipimgV)
  55. {
  56. _youpaipimgV = [[UIImageView alloc]initWithFrame:CGRectMake((self.vWidth-135)/2, 23, 135, 135)];
  57. [_youpaipimgV setImage:[UIImage imageNamed:@"vqu_images_finishMsg"]];
  58. }
  59. return _youpaipimgV;
  60. }
  61. -(UILabel *)youpaiptitleLab
  62. {
  63. if(!_youpaiptitleLab)
  64. {
  65. _youpaiptitleLab = [[UILabel alloc]init];
  66. [_youpaiptitleLab setTextColor:HexColorFromRGB(0x2A2935)];
  67. [_youpaiptitleLab setFont:LCBoldFont(16)];
  68. _youpaiptitleLab.numberOfLines = 0;
  69. // _titleLab.lineBreakMode = NSLineBreakByWordWrapping;
  70. [_youpaiptitleLab setTextAlignment:NSTextAlignmentLeft];
  71. }
  72. return _youpaiptitleLab;
  73. }
  74. -(UIButton *)youpaipopenBtn
  75. {
  76. if(!_youpaipopenBtn)
  77. {
  78. _youpaipopenBtn = [[UIButton alloc]init];
  79. [_youpaipopenBtn.titleLabel setFont:LCBoldFont(15)];
  80. _youpaipopenBtn.layer.cornerRadius = 8;
  81. _youpaipopenBtn.layer.masksToBounds = YES;
  82. [_youpaipopenBtn addTarget:self action:@selector(youpaifcancelWindow) forControlEvents:UIControlEventTouchUpInside];
  83. [_youpaipopenBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  84. }
  85. return _youpaipopenBtn;
  86. }
  87. -(void)youpaifcancelWindow
  88. {
  89. [self dismissViewControllerAnimated:YES completion:nil];
  90. if (self.youpaipfinishMsgdelegate) {
  91. [self.youpaipfinishMsgdelegate youpaifjumFinishMsgClick];
  92. }
  93. }
  94. /*
  95. #pragma mark - Navigation
  96. // In a storyboard-based application, you will often want to do a little preparation before navigation
  97. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  98. // Get the new view controller using [segue destinationViewController].
  99. // Pass the selected object to the new view controller.
  100. }
  101. */
  102. @end