酷店

KDPWelcomePageViewController.m 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // KDPWelcomePageViewController.m
  3. // KuDianProject
  4. //
  5. // Created by admin on 2019/7/8.
  6. // Copyright © 2019 KDP. All rights reserved.
  7. //
  8. #import "KDPWelcomePageViewController.h"
  9. #import "KDPPhoneLoginViewController.h"
  10. @interface KDPWelcomePageViewController ()
  11. @end
  12. @implementation KDPWelcomePageViewController
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. // Do any additional setup after loading the view.
  16. self.navBar.hidden = YES;
  17. [self setSubviews];
  18. }
  19. - (void)setSubviews{
  20. UIImageView *backImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
  21. backImageView.image = [UIImage imageNamed:@"login_backicon"];
  22. backImageView.userInteractionEnabled = YES;
  23. [self.view addSubview:backImageView];
  24. UIImageView *topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_topicon"]];
  25. topImageView.frame = CGRectMake(SCREEN_WIDTH/2-139, Fitsize(52)+KDStatusHeight, 278, 108);
  26. [self.view addSubview:topImageView];
  27. CGFloat buttonWidth = (SCREEN_WIDTH - 70 - 2*62)/3;
  28. NSArray *titleArray = @[@"官方合作",@"精品货源",@"超高利润",@"一键推广",@"多维数据",@"专属客服"];
  29. for (NSInteger i = 0; i < 6; i ++) {
  30. NSInteger row = i / 3;
  31. NSInteger line = i % 3;
  32. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  33. button.frame = CGRectMake(35 + line*(buttonWidth+62), topImageView.bottom + Fitsize(80) + row*(80+30), buttonWidth, 80);
  34. [button setTitle:titleArray[i] forState:UIControlStateNormal];
  35. [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  36. button.titleLabel.font = FONT_SYS(14);
  37. button.showsTouchWhenHighlighted = NO;
  38. button.titleLabel.textAlignment = NSTextAlignmentCenter;
  39. [button setImage:[UIImage imageNamed:[NSString stringWithFormat:@"icon_%ld",(long)i+1]] forState:UIControlStateNormal];
  40. [button setButtonStyle:WSLButtonStyleImageTop spacing:7];
  41. [self.view addSubview:button];
  42. }
  43. UIButton *phoneLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  44. phoneLoginBtn.backgroundColor = [UIColor colorWithHex:0xFFE401];
  45. phoneLoginBtn.frame = CGRectMake(27, SCREEN_HEIGHT - 39-48-KDTabBottomHeight, SCREEN_WIDTH-54, 48);
  46. phoneLoginBtn.layer.cornerRadius = 29;
  47. phoneLoginBtn.layer.masksToBounds = YES;
  48. phoneLoginBtn.layer.shadowColor = [UIColor colorWithRed:243/255.0 green:119/255.0 blue:41/255.0 alpha:1.0].CGColor;
  49. phoneLoginBtn.layer.shadowOffset = CGSizeMake(0,6);
  50. phoneLoginBtn.layer.shadowOpacity = 1;
  51. phoneLoginBtn.layer.shadowRadius = 4;
  52. [phoneLoginBtn setTitleColor:[UIColor colorWithHex:0xF37828] forState:UIControlStateNormal];
  53. [phoneLoginBtn setTitle:@"手机号登录" forState:UIControlStateNormal];
  54. phoneLoginBtn.titleLabel.font = FONT_SYS(18);
  55. [phoneLoginBtn addTarget:self action:@selector(phoneLoginClick:) forControlEvents:UIControlEventTouchUpInside];
  56. [self.view addSubview:phoneLoginBtn];
  57. }
  58. - (void)phoneLoginClick:(UIButton *)sender{
  59. KDPPhoneLoginViewController *phoneLogin = [[KDPPhoneLoginViewController alloc] init];
  60. [self.navigationController presentViewController:[[UINavigationController alloc]initWithRootViewController:phoneLogin] animated:YES completion:nil];
  61. }
  62. @end