YOUPAILZGameCertificationVC.m 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. //
  2. // YOUPAILZGameCertificationVC.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/4/26.
  6. // Copyright © 2021 leo. All rights reserved.
  7. //
  8. #import "YOUPAILZGameCertificationVC.h"
  9. #import "YOUPAILZGameModel.h"
  10. #import "YOUPAILZUploadGameImageView.h"
  11. #import "YOUPAILZWriteGameInfoView.h"
  12. @interface YOUPAILZGameCertificationVC ()<UIScrollViewDelegate>
  13. @property (nonatomic, strong)NSMutableArray <UIImageView *>*youpaipimgVs;
  14. @property (nonatomic, strong)NSMutableArray <UILabel *>*youpaiplabs;
  15. @property (nonatomic, weak)UIScrollView *youpaipscrollView;
  16. @property (nonatomic, weak)YOUPAILZUploadGameImageView *youpaipuploadGameImageView;
  17. @property (nonatomic, weak)YOUPAILZWriteGameInfoView *youpaipwriteGameInfoView;
  18. @end
  19. @implementation YOUPAILZGameCertificationVC
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. self.view.backgroundColor = [UIColor whiteColor];
  23. self.title = self.youpaipgameModel.youpaipname;
  24. self.youpaipimgVs = [NSMutableArray array];
  25. self.youpaiplabs = [NSMutableArray array];
  26. [self youpaifsetupUI];
  27. }
  28. - (void)youpaifsetupUI{
  29. NSArray *contents = @[
  30. @"游戏认证",
  31. @"填写资料",
  32. @"平台审核"
  33. ];
  34. UIView *bgV = [[UIView alloc] init];;
  35. [self.view addSubview:bgV];
  36. [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
  37. make.left.right.offset(0.0f);
  38. make.top.offset(NavBarHeight + 20.0f);
  39. make.height.offset(22.0f);
  40. }];
  41. for (NSInteger i = 0; i < contents.count; i++) {
  42. UIImageView *imgV = [[UIImageView alloc] init];
  43. imgV.image = [UIImage imageNamed:@"vqu_images_game_certification_nol"];
  44. [bgV addSubview:imgV];
  45. [self.youpaipimgVs addObject:imgV];
  46. [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
  47. if(i == 0){
  48. make.left.offset(ScaleSize(42.0f));
  49. }else if (i == 1){
  50. make.centerX.equalTo(bgV.mas_centerX);
  51. }else{
  52. make.right.offset(-ScaleSize(42.0f));
  53. }
  54. make.centerY.offset(0);
  55. }];
  56. UILabel *lab = [[UILabel alloc] init];
  57. lab.font = LCFont15;
  58. lab.text = contents[i];
  59. lab.textColor = HexColorFromRGB(0xCCCCCC);
  60. [self.view addSubview:lab];
  61. [self.youpaiplabs addObject:lab];
  62. [lab mas_makeConstraints:^(MASConstraintMaker *make) {
  63. make.top.equalTo(bgV.mas_bottom).offset(7.0f);
  64. make.centerX.equalTo(imgV.mas_centerX);
  65. }];
  66. }
  67. for (NSInteger i = 0; i < self.youpaipimgVs.count - 1; i ++) {
  68. UIView *lineV = [[UIView alloc] init];
  69. lineV.backgroundColor = [HexColorFromRGB(0xCCCCCC) colorWithAlphaComponent:0.15f];
  70. [self.view addSubview:lineV];
  71. [lineV mas_makeConstraints:^(MASConstraintMaker *make) {
  72. make.left.equalTo(self.youpaipimgVs[i].mas_right).offset(10.0f);
  73. make.right.equalTo(self.youpaipimgVs[i + 1].mas_left).offset(-10.0f);
  74. make.height.offset(1.0f);
  75. make.centerY.equalTo(self.youpaipimgVs[i].mas_centerY);
  76. }];
  77. }
  78. UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, NavBarHeight + 85.0f, KScreenWidth, KScreenHeight - (NavBarHeight + 85.0f))];
  79. scrollView.showsVerticalScrollIndicator = NO;
  80. scrollView.showsHorizontalScrollIndicator = NO;
  81. scrollView.delegate = self;
  82. scrollView.scrollEnabled = NO;
  83. [self.view addSubview:scrollView];
  84. self.youpaipscrollView = scrollView;
  85. YOUPAILZUploadGameImageView *uploadGameImageView = [[YOUPAILZUploadGameImageView alloc] initWithModel:self.youpaipgameModel];
  86. self.youpaipuploadGameImageView = uploadGameImageView;
  87. YOUPAILZWriteGameInfoView *writeGameInfoView = [[YOUPAILZWriteGameInfoView alloc] initWithModel:self.youpaipgameModel];
  88. self.youpaipwriteGameInfoView = writeGameInfoView;
  89. NSArray *contentVs = @[uploadGameImageView,writeGameInfoView];
  90. for (NSInteger i = 0; i < contentVs.count; i ++) {
  91. UIView *v = contentVs[i];
  92. v.frame = CGRectMake(i * KScreenWidth, 0, KScreenWidth, scrollView.mj_h);
  93. [scrollView addSubview:v];
  94. }
  95. scrollView.contentSize = CGSizeMake(contentVs.count * KScreenWidth, scrollView.mj_h);
  96. [self youpaifsetCurrentIndex:self.youpaipindex];
  97. }
  98. - (void)youpaifsetCurrentIndex:(NSInteger)index{
  99. if (index == 0) {
  100. UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  101. btn.frame = CGRectMake(0, 0, 56.0f, 24.0f);
  102. btn.layer.cornerRadius = 12.0f;
  103. btn.clipsToBounds = YES;
  104. btn.backgroundColor = ZYPinkColor;
  105. btn.titleLabel.font = LCFont12;
  106. [btn setTitle:@"下一步" forState:UIControlStateNormal];
  107. [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  108. [btn addTarget:self action:@selector(youpaifnavBtnClick) forControlEvents:UIControlEventTouchUpInside];
  109. self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
  110. }else{
  111. self.navigationItem.rightBarButtonItem = nil;
  112. }
  113. for (NSInteger i = 0; i < self.youpaipimgVs.count; i ++) {
  114. if (i <= index) {
  115. self.youpaipimgVs[i].image = [UIImage imageNamed:@"vqu_images_game_certification_sel"];
  116. }else{
  117. self.youpaipimgVs[i].image = [UIImage imageNamed:@"vqu_images_game_certification_nol"];
  118. }
  119. }
  120. for (NSInteger i = 0; i < self.youpaiplabs.count; i ++) {
  121. if (i <= index) {
  122. self.youpaiplabs[i].textColor = HexColorFromRGB(0x333333);
  123. }else{
  124. self.youpaiplabs[i].textColor = HexColorFromRGB(0xCCCCCC);
  125. }
  126. }
  127. self.youpaipscrollView.contentOffset = CGPointMake(index * KScreenWidth, 0);
  128. }
  129. - (void)youpaifnavBtnClick{
  130. if (self.youpaipgameModel.youpaipselectedImage != nil) {
  131. YOUPAILZGameCertificationVC *vc = [[YOUPAILZGameCertificationVC alloc] init];
  132. vc.youpaipgameModel = self.youpaipgameModel;
  133. vc.youpaipindex = 1;
  134. [self.navigationController pushViewController:vc animated:YES];
  135. }else{
  136. [ZCHUDHelper showTitle:@"请上传技能图"];
  137. }
  138. }
  139. @end