BogoShareInviteViewController.m 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. //
  2. // BogoShareInviteViewController.m
  3. // BuguLive
  4. //
  5. // Created by 宋晨光 on 2020/11/6.
  6. // Copyright © 2020 xfg. All rights reserved.
  7. //
  8. #import "BogoShareInviteViewController.h"
  9. @interface BogoShareInviteViewController ()<UITableViewDelegate,UITableViewDataSource>
  10. @property(nonatomic, strong) UIScrollView *scrollView;
  11. @property(nonatomic, strong) UITableView *tableView;
  12. @property(nonatomic, strong) UILabel *sumInomeLabel;////可提现金额
  13. @property(nonatomic, strong) UILabel *sumPeopleLabel;//邀请人数
  14. @property(nonatomic, strong) UIView *teamView;//我的团队group
  15. @property(nonatomic, strong) UIView *withDrawView;//提现记录group
  16. @end
  17. @implementation BogoShareInviteViewController
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. self.view.backgroundColor = [UIColor colorWithHexString:@"#2A1648"];
  21. UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  22. backBtn.frame = CGRectMake(15, 20, kRealValue(30), kRealValue(30));
  23. [backBtn setImage:[UIImage imageNamed:@"back_w"] forState:UIControlStateNormal];
  24. [backBtn addTarget:self action:@selector(clickBackBtn:) forControlEvents:UIControlEventTouchUpInside];
  25. [self setUpView];
  26. [self.view addSubview:backBtn];
  27. }
  28. - (void)viewWillAppear:(BOOL)animated {
  29. [super viewWillAppear:animated];
  30. self.navigationController.navigationBarHidden = YES;
  31. self.navigationController.navigationBar.hidden = YES;
  32. }
  33. -(void)clickBackBtn:(UIButton *)sender{
  34. [self.navigationController popViewControllerAnimated:YES];
  35. }
  36. -(void)setUpView{
  37. self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  38. self.scrollView.contentSize = CGSizeMake(0, kScreenH * 1.8);
  39. [self.view addSubview:self.scrollView];
  40. UIImageView *bgTopImgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kRealValue(421))];
  41. bgTopImgView.image = [UIImage imageNamed:@"bogo_invite_bgTop"];
  42. [self.scrollView addSubview:bgTopImgView];
  43. UIButton *inviteRuleBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  44. inviteRuleBtn.frame = CGRectMake(kScreenW - kRealValue(76) + 15, kRealValue(50), kRealValue(76), kRealValue(34.5));
  45. inviteRuleBtn.titleLabel.font = [UIFont systemFontOfSize:14];
  46. [inviteRuleBtn setTitle:ASLocalizedString(@"邀请规则")forState:UIControlStateNormal];
  47. [inviteRuleBtn setTitleColor:[UIColor colorWithHexString:@"#2A1648"] forState:UIControlStateNormal];
  48. inviteRuleBtn.backgroundColor = [UIColor colorWithHexString:@"#1BB897"];
  49. inviteRuleBtn.layer.cornerRadius = kRealValue(34.5 / 2);
  50. inviteRuleBtn.layer.masksToBounds = YES;
  51. [inviteRuleBtn addTarget:self action:@selector(clickRuleBtn:) forControlEvents:UIControlEventTouchUpInside];
  52. // inviteRuleBtn.backgroundColor = kWhiteColor;
  53. UIImageView *topBgImgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kRealValue(350))];
  54. topBgImgView.image = [UIImage imageNamed:@"bogo_task_invite_topBgImg"];
  55. topBgImgView.userInteractionEnabled = YES;
  56. //中间部分UI
  57. UIView *minddleView = [[UIImageView alloc]initWithFrame:CGRectMake(kRealValue(12), kRealValue(213), kScreenW - kRealValue(12 * 2), kRealValue(181))];
  58. minddleView.backgroundColor = kWhiteColor;
  59. minddleView.layer.cornerRadius = 5;
  60. minddleView.layer.masksToBounds = YES;
  61. //累计收益
  62. UILabel *sumInomeLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, kRealValue(40), kScreenW / 2, kRealValue(30))];
  63. sumInomeLabel.text = @"0.00";
  64. sumInomeLabel.textColor = [UIColor colorWithHexString:@"#926111"];
  65. sumInomeLabel.font = [UIFont systemFontOfSize:30];
  66. sumInomeLabel.textAlignment = NSTextAlignmentCenter;
  67. _sumInomeLabel = sumInomeLabel;
  68. //累MainScreenWidth
  69. UILabel *sumInomeStrLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, kRealValue(88), kScreenW / 2, kRealValue(20))];
  70. sumInomeStrLabel.text = ASLocalizedString(@"可提现金额(元)");
  71. sumInomeStrLabel.textColor = [UIColor colorWithHexString:@"#FF553C"];
  72. sumInomeStrLabel.font = [UIFont systemFontOfSize:15];
  73. sumInomeStrLabel.textAlignment = NSTextAlignmentCenter;
  74. //成功邀请的人
  75. UILabel *sumPeopleLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenW / 2 - 10, kRealValue(40), kScreenW / 2, kRealValue(30))];
  76. sumPeopleLabel.text = @"0.00";
  77. sumPeopleLabel.textColor = [UIColor colorWithHexString:@"#926111"];
  78. sumPeopleLabel.font = [UIFont systemFontOfSize:30];
  79. sumPeopleLabel.textAlignment = NSTextAlignmentCenter;
  80. _sumPeopleLabel = sumPeopleLabel;
  81. UILabel *sumPeopleStrLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenW / 2, kRealValue(88), kScreenW / 2, kRealValue(20))];
  82. sumPeopleStrLabel.text = ASLocalizedString(@"成功邀请(人)");
  83. sumPeopleStrLabel.textColor = [UIColor colorWithHexString:@"#FF553C"];
  84. sumPeopleStrLabel.font = [UIFont systemFontOfSize:15];
  85. sumPeopleStrLabel.textAlignment = NSTextAlignmentCenter;
  86. [minddleView addSubview:sumInomeLabel];
  87. [minddleView addSubview:sumPeopleLabel];
  88. [minddleView addSubview:sumInomeStrLabel];
  89. [minddleView addSubview:sumPeopleStrLabel];
  90. UIButton *inviteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  91. inviteBtn.frame = CGRectMake(0, minddleView.bottom + kRealValue(10), kRealValue(246), kRealValue(40));
  92. inviteBtn.centerX = kScreenW / 2;
  93. [inviteBtn setTitle:ASLocalizedString(@"立即邀请好友赚钱")forState:UIControlStateNormal];
  94. [inviteBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
  95. [inviteBtn setBackgroundImage:[UIImage imageNamed:@"bogo_invite_button"] forState:UIControlStateNormal];
  96. [inviteBtn addTarget:self action:@selector(clickInviteBtn:) forControlEvents:UIControlEventTouchUpInside];
  97. [self.scrollView addSubview:topBgImgView];
  98. [self.scrollView addSubview:minddleView];
  99. [self.scrollView addSubview:inviteRuleBtn];
  100. [self.scrollView addSubview:inviteBtn];
  101. [self setUpTeamViewWithTop:inviteBtn.bottom];
  102. [self setUpWithDrawView];
  103. }
  104. -(void)setUpTeamViewWithTop:(CGFloat)top{
  105. UIView *teamView = [[UIView alloc]initWithFrame:CGRectMake(0, top, kScreenW, kRealValue(208))];
  106. self.teamView = teamView;
  107. UIButton *teamTopBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  108. teamTopBtn.frame = CGRectMake(0, kRealValue(30), kRealValue(192), kRealValue(24));
  109. teamTopBtn.centerX = kScreenW / 2;
  110. [teamTopBtn setTitle:ASLocalizedString(@"我的团队")forState:UIControlStateNormal];
  111. [teamTopBtn setBackgroundImage:[UIImage imageNamed:@"bogo_invite_teamLine"] forState:UIControlStateNormal];
  112. CGFloat viewWidth = (kScreenW - kRealValue(14.5 + 13) - 8.5) / 2;
  113. //一级团队
  114. UIImageView *firstTeamImgView = [[UIImageView alloc]initWithFrame:CGRectMake(14, teamTopBtn.bottom + kRealValue(24), viewWidth, kRealValue(130))];
  115. firstTeamImgView.image = [UIImage imageNamed:@"bogo_invite_firstTeam_bg"];
  116. firstTeamImgView.userInteractionEnabled = YES;
  117. UILabel *firstL = [[UILabel alloc]initWithFrame:CGRectMake(15, 10, firstTeamImgView.width - 10, 49)];
  118. firstL.text = ASLocalizedString(@"一级团队");
  119. firstL.textColor = kWhiteColor;
  120. firstL.font = [UIFont systemFontOfSize:20];
  121. UIButton *firstInfoBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  122. firstInfoBtn.frame = CGRectMake(kRealValue(16), firstL.bottom + kRealValue(40), kRealValue(75), kRealValue(30));
  123. [firstInfoBtn setTitle:ASLocalizedString(@"详情 >")forState:UIControlStateNormal];
  124. [firstInfoBtn setTitleColor:[UIColor colorWithHexString:@"#198ED5"] forState:UIControlStateNormal];
  125. [firstInfoBtn setBackgroundImage:[UIImage imageNamed:@"bogo_invite_firstTeam_button"] forState:UIControlStateNormal];
  126. firstInfoBtn.titleLabel.font = [UIFont systemFontOfSize:15];
  127. firstInfoBtn.titleEdgeInsets = UIEdgeInsetsMake(-5, 0, 0, 0);
  128. [firstTeamImgView addSubview:firstL];
  129. [firstTeamImgView addSubview:firstInfoBtn];
  130. //二级团队
  131. UIImageView *secondTeamImgView = [[UIImageView alloc]initWithFrame:CGRectMake(firstTeamImgView.right + kRealValue(8), teamTopBtn.bottom + kRealValue(24), viewWidth, kRealValue(62))];
  132. secondTeamImgView.image = [UIImage imageNamed:@"bogo_invite_secondTeam_bg"];
  133. secondTeamImgView.userInteractionEnabled = YES;
  134. UILabel *secondL = [[UILabel alloc]initWithFrame:CGRectMake(15, 22, kRealValue(70), kRealValue(28))];
  135. secondL.text = ASLocalizedString(@"二级团队");
  136. secondL.textColor = kWhiteColor;
  137. secondL.font = [UIFont systemFontOfSize:15];
  138. UIButton *secondInfoBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  139. secondInfoBtn.frame = CGRectMake(viewWidth - kRealValue(60 + 10), 0, kRealValue(61), kRealValue(28));
  140. [secondInfoBtn setTitle:ASLocalizedString(@"详情 >")forState:UIControlStateNormal];
  141. [secondInfoBtn setTitleColor:[UIColor colorWithHexString:@"#EC4164"] forState:UIControlStateNormal];
  142. [secondInfoBtn setBackgroundImage:[UIImage imageNamed:@"bogo_invite_firstTeam_button"] forState:UIControlStateNormal];
  143. secondInfoBtn.titleLabel.font = [UIFont systemFontOfSize:15];
  144. secondInfoBtn.titleEdgeInsets = UIEdgeInsetsMake(-5, 0, 0, 0);
  145. [secondTeamImgView addSubview:secondL];
  146. [secondTeamImgView addSubview:secondInfoBtn];
  147. //三级团队
  148. UIImageView *thirdTeamImgView = [[UIImageView alloc]initWithFrame:CGRectMake(firstTeamImgView.right + kRealValue(8), secondTeamImgView.bottom + kRealValue(5), viewWidth, kRealValue(62))];
  149. thirdTeamImgView.image = [UIImage imageNamed:@"bogo_invite_thirdTeam_bg"];
  150. thirdTeamImgView.userInteractionEnabled = YES;
  151. UILabel *thirdL = [[UILabel alloc]initWithFrame:CGRectMake(15, 22, kRealValue(70), kRealValue(28))];
  152. thirdL.text = ASLocalizedString(@"三级团队");
  153. thirdL.textColor = kWhiteColor;
  154. thirdL.font = [UIFont systemFontOfSize:15];
  155. UIButton *thirdInfoBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  156. thirdInfoBtn.frame = CGRectMake(viewWidth - kRealValue(60 + 10), 0, kRealValue(61), kRealValue(28));
  157. [thirdInfoBtn setTitle:ASLocalizedString(@"详情 >")forState:UIControlStateNormal];
  158. [thirdInfoBtn setTitleColor:[UIColor colorWithHexString:@"#F27A0C"] forState:UIControlStateNormal];
  159. [thirdInfoBtn setBackgroundImage:[UIImage imageNamed:@"bogo_invite_thirdTeam_button"] forState:UIControlStateNormal];
  160. thirdInfoBtn.titleLabel.font = [UIFont systemFontOfSize:15];
  161. thirdInfoBtn.titleEdgeInsets = UIEdgeInsetsMake(-5, 0, 0, 0);
  162. [thirdTeamImgView addSubview:thirdL];
  163. [thirdTeamImgView addSubview:thirdInfoBtn];
  164. [teamView addSubview:teamTopBtn];
  165. [teamView addSubview:firstTeamImgView];
  166. [teamView addSubview:secondTeamImgView];
  167. [teamView addSubview:thirdTeamImgView];
  168. [self.scrollView addSubview:teamView];
  169. }
  170. //提现记录
  171. -(void)setUpWithDrawView{
  172. UIButton *withDrawBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  173. withDrawBtn.frame = CGRectMake(0, self.teamView.bottom + kRealValue(30), kRealValue(192), kRealValue(24));
  174. [withDrawBtn setTitle:ASLocalizedString(@"提现记录")forState:UIControlStateNormal];
  175. [withDrawBtn setBackgroundImage:[UIImage imageNamed:@"bogo_invite_teamLine"] forState:UIControlStateNormal];
  176. withDrawBtn.centerX = kScreenW / 2;
  177. [self.scrollView addSubview:withDrawBtn];
  178. }
  179. //立即邀请好友赚钱
  180. -(void)clickInviteBtn:(UIButton *)sender{
  181. }
  182. //邀请规则
  183. -(void)clickRuleBtn:(UIButton *)sender{
  184. }
  185. @end