YOUPAILZSignWindow.m 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //
  2. // YOUPAILZSignWindow.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/9/9.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZSignWindow.h"
  9. @interface YOUPAILZSignWindow ()
  10. @end
  11. @implementation YOUPAILZSignWindow
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. self.baseView.hidden = YES;
  15. [self youpaifinitUI];
  16. }
  17. - (void)youpaifinitUI{
  18. UIView *bgV = [[UIView alloc] init];
  19. bgV.backgroundColor = [UIColor blackColor];
  20. bgV.layer.cornerRadius = 2.5f;
  21. bgV.clipsToBounds = YES;
  22. bgV.layer.borderColor = HexColorFromRGB(0x00DCFF).CGColor;
  23. bgV.layer.borderWidth = 1.0f;
  24. [self.view addSubview:bgV];
  25. [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.center.equalTo(self.view);
  27. make.size.mas_offset(CGSizeMake(ScaleSize(280.0f), ScaleSize(330.0f)));
  28. }];
  29. UIImageView *successTopImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_H_home_sign_success"]];
  30. [self.view addSubview:successTopImgV];
  31. [successTopImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  32. make.top.equalTo(bgV.mas_top).offset(-ScaleSize(10.5f));
  33. make.centerX.equalTo(bgV);
  34. make.size.mas_offset(CGSizeMake(ScaleSize(216.0f), ScaleSize(39.0f)));
  35. }];
  36. UILabel *timerL = [[UILabel alloc] init];
  37. timerL.font = LCFont(ScaleSize(12.0f));
  38. timerL.textColor = HexColorFromRGB(0xC3C3C3);
  39. timerL.textAlignment = NSTextAlignmentCenter;
  40. timerL.backgroundColor = [HexColorFromRGB(0x00A6C0) colorWithAlphaComponent:0.22f];
  41. timerL.layer.cornerRadius = ScaleSize(10.0f);
  42. timerL.clipsToBounds = YES;
  43. timerL.text = self.youpaipmsg;
  44. [bgV addSubview:timerL];
  45. [timerL mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.centerX.equalTo(bgV);
  47. make.top.equalTo(successTopImgV.mas_bottom).offset(ScaleSize(8.5f));
  48. make.size.mas_offset(CGSizeMake(ScaleSize(181.0f), ScaleSize(20.0f)));
  49. }];
  50. UIImageView *successImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_H_home_sign_success_center"]];
  51. [self.view addSubview:successImgV];
  52. [successImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  53. make.top.equalTo(timerL.mas_bottom).offset(ScaleSize(18.0f));
  54. make.centerX.equalTo(bgV);
  55. make.size.mas_offset(CGSizeMake(ScaleSize(124.0f), ScaleSize(124.0f)));
  56. }];
  57. UILabel *countL = [[UILabel alloc] init];
  58. countL.font = LCFont(ScaleSize(12.0f));
  59. countL.textColor = HexColorFromRGB(0xffffff);
  60. countL.textAlignment = NSTextAlignmentCenter;
  61. countL.backgroundColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake(ScaleSize(115.0f), ScaleSize(20.0f)) FromColors:@[HexColorFromRGB(0x01B676),HexColorFromRGB(0x039872)] ByGradientType:GradientLeftToRight]];
  62. countL.layer.cornerRadius = ScaleSize(10.0f);
  63. countL.clipsToBounds = YES;
  64. countL.text = self.youpaipbeans;
  65. [bgV addSubview:countL];
  66. [countL mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.centerX.equalTo(bgV);
  68. make.top.equalTo(successImgV.mas_bottom).offset(ScaleSize(16.0f));
  69. make.size.mas_offset(CGSizeMake(ScaleSize(115.0f), ScaleSize(20.0f)));
  70. }];
  71. UIButton *goSignBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  72. [goSignBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_H_home_go_sign_page"] forState:UIControlStateNormal];
  73. [goSignBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_H_home_go_sign_page"] forState:UIControlStateHighlighted];
  74. [goSignBtn addTarget:self action:@selector(youpaifgoSignBtnClick) forControlEvents:UIControlEventTouchUpInside];
  75. [bgV addSubview:goSignBtn];
  76. [goSignBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  77. make.centerX.equalTo(bgV);
  78. make.top.equalTo(countL.mas_bottom).offset(ScaleSize(24.0f));
  79. make.size.mas_offset(CGSizeMake(ScaleSize(212.0f), ScaleSize(45.5f)));
  80. }];
  81. UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  82. [closeBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_H_home_sign_close"] forState:UIControlStateNormal];
  83. [closeBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_H_home_sign_close"] forState:UIControlStateHighlighted];
  84. [closeBtn addTarget:self action:@selector(youpaifcloseBtnClick) forControlEvents:UIControlEventTouchUpInside];
  85. [self.view addSubview:closeBtn];
  86. [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  87. make.centerX.equalTo(bgV);
  88. make.top.equalTo(bgV.mas_bottom).offset(ScaleSize(24.0f));
  89. make.size.mas_offset(CGSizeMake(ScaleSize(29), ScaleSize(29)));
  90. }];
  91. }
  92. - (void)youpaifgoSignBtnClick{
  93. [self dismissViewControllerAnimated:YES completion:^{
  94. if (self.goSignBlock != nil) {
  95. self.goSignBlock(self.youpaiplink);
  96. }
  97. }];
  98. }
  99. - (void)youpaifcloseBtnClick{
  100. [self dismissViewControllerAnimated:YES completion:^{}];
  101. }
  102. @end