JXShowDayFulLiVc.m 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. //
  2. // JXShowDayFulLiVc.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/20.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXShowDayFulLiVc.h"
  9. @interface JXShowDayFulLiVc()
  10. @property (nonatomic,weak) JXShowDayFulLiVc *show;
  11. @end
  12. @implementation JXShowDayFulLiVc
  13. -(instancetype)initWithFrame:(CGRect)frame{
  14. if (self=[super initWithFrame:frame]) {
  15. UIView *backView=[[UIView alloc]init];
  16. backView.userInteractionEnabled=YES;
  17. backView.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.1];
  18. [self addSubview:backView];
  19. [backView mas_makeConstraints:^(MASConstraintMaker *make) {
  20. make.top.mas_equalTo(0);
  21. make.left.and.right.mas_equalTo(0);
  22. make.bottom.mas_equalTo(0);
  23. }];
  24. UIImageView *whiteShowView=[[UIImageView alloc]init];
  25. whiteShowView.userInteractionEnabled=YES;
  26. whiteShowView.image=[UIImage imageNamed:@"beijing"];
  27. whiteShowView.contentMode=UIViewContentModeScaleToFill;
  28. [backView addSubview:whiteShowView];
  29. [whiteShowView mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.width.mas_equalTo(JX_SCREEN_WIDTH-90);
  31. make.height.mas_equalTo(JX_SCREEN_WIDTH-90);
  32. make.centerX.mas_equalTo(backView.mas_centerX);
  33. make.centerY.mas_equalTo(backView.mas_centerY);
  34. }];
  35. //恭喜获得
  36. UIImageView *titleL=[[UIImageView alloc]init];
  37. titleL.userInteractionEnabled=YES;
  38. titleL.image=[UIImage imageNamed:@"gongxihuode"];
  39. [whiteShowView addSubview:titleL];
  40. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  41. make.centerX.mas_equalTo(backView.mas_centerX);
  42. make.top.mas_equalTo(55);
  43. make.width.mas_equalTo(128);
  44. make.height.mas_equalTo(31);
  45. }];
  46. UIButton *coinJXBtn=[[UIButton alloc]init];
  47. coinJXBtn.titleLabel.font=[UIFont systemFontOfSize:20 weight:UIFontWeightMedium];
  48. [coinJXBtn setTitleColor:[UIColor colorWithRed:158/255.0 green:108/255.0 blue:71/255.0 alpha:1.0] forState:UIControlStateNormal];;
  49. [coinJXBtn setTitle:@"20即信币" forState:UIControlStateNormal];
  50. [coinJXBtn setBackgroundImage:[UIImage imageNamed:@"zhongj"] forState:UIControlStateNormal];
  51. [whiteShowView addSubview:coinJXBtn];
  52. self.coinBtn=coinJXBtn;
  53. [coinJXBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  54. make.top.mas_equalTo(titleL.mas_bottom).mas_offset(20);
  55. make.centerX.mas_equalTo(titleL.mas_centerX);
  56. }];
  57. UILabel *tipLael=[[UILabel alloc]init];
  58. tipLael.font=[UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
  59. tipLael.text=@"可在“我-即信钱包”中查看奖励";
  60. tipLael.textColor=[UIColor colorWithRed:158/255.0 green:108/255.0 blue:71/255.0 alpha:1.0];
  61. tipLael.textAlignment=NSTextAlignmentCenter;
  62. [whiteShowView addSubview:tipLael];
  63. [tipLael mas_makeConstraints:^(MASConstraintMaker *make) {
  64. make.top.mas_equalTo(coinJXBtn.mas_bottom).mas_offset(20);
  65. make.centerX.mas_equalTo(whiteShowView.mas_centerX);
  66. }];
  67. UIButton *tongYiBtn=[[UIButton alloc]init];
  68. tongYiBtn.titleLabel.font=[UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
  69. [tongYiBtn setTitle:@"分享到群聊并领取奖励" forState:UIControlStateNormal];
  70. [tongYiBtn setTitleColor:[UIColor colorWithRed:158/255.0 green:108/255.0 blue:71/255.0 alpha:1.0] forState:UIControlStateNormal];;
  71. [tongYiBtn setBackgroundImage:[UIImage imageNamed:@"xiawu"] forState:UIControlStateNormal];
  72. tongYiBtn.layer.cornerRadius=6;
  73. tongYiBtn.layer.masksToBounds=YES;
  74. tongYiBtn.contentMode=UIViewContentModeScaleAspectFill;
  75. [whiteShowView addSubview:tongYiBtn];
  76. self.tongYiBtn=tongYiBtn;
  77. [tongYiBtn addTarget:self action:@selector(tongyiBtn:) forControlEvents:UIControlEventTouchUpInside];
  78. [tongYiBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  79. make.top.mas_equalTo(tipLael.mas_bottom).mas_offset(22);
  80. make.centerX.mas_equalTo(tipLael.mas_centerX);
  81. make.height.mas_equalTo(44);
  82. }];
  83. // [self thirdBtnAction];
  84. }
  85. return self;
  86. }
  87. +(void)showView{
  88. JXShowDayFulLiVc *show=[[JXShowDayFulLiVc alloc]init];
  89. show.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.7];
  90. show.frame=[UIScreen mainScreen].bounds;
  91. [[UIApplication sharedApplication].keyWindow addSubview:show];
  92. }
  93. -(void)showView{
  94. JXShowDayFulLiVc *show=[[JXShowDayFulLiVc alloc]init];
  95. show.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.7];
  96. show.frame=[UIScreen mainScreen].bounds;
  97. [[UIApplication sharedApplication].keyWindow addSubview:show];
  98. }
  99. +(void)closeView{
  100. }
  101. -(void)dissmisView{
  102. [self removeFromSuperview];
  103. }
  104. - (void)tongyiBtn:(UIButton *)sender{
  105. [self removeFromSuperview];
  106. }
  107. @end