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