YOUPAILZInfoImperfectView.m 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // YOUPAILZInfoImperfectView.m
  3. // MSYOUPAI
  4. //
  5. // Created by CY on 2022/3/9.
  6. // Copyright © 2022 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZInfoImperfectView.h"
  9. @implementation YOUPAILZInfoImperfectView
  10. - (instancetype)initWithFrame:(CGRect)frame{
  11. if (self = [super initWithFrame:frame]) {
  12. [self youpaifinitUI];
  13. }
  14. return self;
  15. }
  16. - (void)youpaifinitUI{
  17. self.layer.cornerRadius = 8.0f;
  18. self.clipsToBounds = YES;
  19. self.backgroundColor = HexColorFromRGB(0xF3F1FF);
  20. UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  21. [closeBtn setImage:[UIImage imageNamed:@"vqu_images_L_info_close1"] forState:UIControlStateNormal];
  22. [closeBtn addTarget:self action:@selector(closeBtnClick) forControlEvents:UIControlEventTouchUpInside];
  23. [self addSubview:closeBtn];
  24. [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.right.offset(-8.0f);
  26. make.centerY.equalTo(self);
  27. make.size.mas_offset(CGSizeMake(20.0f, 20.0f));
  28. }];
  29. UIButton *goEditBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  30. [goEditBtn setTitle:@"前往" forState:UIControlStateNormal];
  31. [goEditBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  32. goEditBtn.titleLabel.font = LCFont12;
  33. goEditBtn.layer.cornerRadius = 12.0f;
  34. goEditBtn.clipsToBounds = YES;
  35. [goEditBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(48.0f, 24.0f) FromColors:@[LZBFB6FFColor,LZ7C69FEColor] ByGradientType:GradientLeftToRight] forState:UIControlStateNormal];
  36. [goEditBtn addTarget:self action:@selector(goEditBtnClick) forControlEvents:UIControlEventTouchUpInside];
  37. [self addSubview:goEditBtn];
  38. [goEditBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.right.equalTo(closeBtn.mas_left).offset(0.0f);
  40. make.centerY.equalTo(self);
  41. make.size.mas_offset(CGSizeMake(48.0f, 24.0f));
  42. }];
  43. UILabel *textL = [[UILabel alloc] init];
  44. textL.textColor = LZ273145Color;
  45. textL.font = LCFont12;
  46. [self addSubview:textL];
  47. NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:@"完善资料送钻石,你有钻石待领取"];
  48. [str addAttribute:NSForegroundColorAttributeName value:LZ7C69FEColor range:NSMakeRange(4, 3)];
  49. [str addAttribute:NSForegroundColorAttributeName value:LZ7C69FEColor range:NSMakeRange(10, 2)];
  50. textL.attributedText = str;
  51. [textL mas_makeConstraints:^(MASConstraintMaker *make) {
  52. make.left.offset(12.0f);
  53. make.top.bottom.offset(0.0f);
  54. }];
  55. }
  56. - (void)goEditBtnClick{
  57. if (self.goEditUserInfoPageBlock != nil) {
  58. self.goEditUserInfoPageBlock();
  59. }
  60. }
  61. - (void)closeBtnClick{
  62. [self removeFromSuperview];
  63. }
  64. @end