CNLIVEViewController.m 3.4 KB
//
//  CNLIVEViewController.m
//  CNLiveBPersonalVerificationModule
//
//  Created by dawanzi on 04/06/2020.
//  Copyright (c) 2020 dawanzi. All rights reserved.
//

#import "CNLIVEViewController.h"
#import "CNBPersonalVerificationController.h"
#import "CNBPerAuthSuccessController.h"
#import "CNBPerCertificationController.h"
#import "CNLiveBPersonAuthentProtocol.h"
#import "ApplyForShootController.h"
#import "CNLiveIDCardAuthenProtocol.h"
@interface CNLIVEViewController ()

@end

@implementation CNLIVEViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(100, 100, 100, 100);
    button.backgroundColor = [UIColor cyanColor];
    [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    UIButton *successBtn = [UIButton buttonWithType:UIButtonTypeSystem];
    successBtn.frame = CGRectMake(240, 100, 100, 100);
    successBtn.backgroundColor = [UIColor purpleColor];
    [successBtn addTarget:self action:@selector(successBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:successBtn];
    for (int i = 0; i < 3; i ++) {
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = CGRectMake(20*(i +1) + 100*i, 240, 100, 100);
        button.backgroundColor = [UIColor greenColor];
        [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
        button.tag = 200 +i;
        [self.view addSubview:button];
    }
}

- (void)buttonAction {
//    ApplyForShootController *vc = [[ApplyForShootController alloc] init];
    
    id <CNLiveIDCardAuthenProtocol>service = [[BeeHive shareInstance]createService:@protocol(CNLiveIDCardAuthenProtocol)];
            ApplyForShootController *vc = (ApplyForShootController *)[service pushToCNLiveIDCardAuthController];
//    CNBPersonalVerificationController *vc = [[CNBPersonalVerificationController alloc]init];
    [self.navigationController pushViewController:vc animated:NO];
}
- (void)successBtnAction {
     id <CNLiveBPersonAuthentProtocol>service = [[BeeHive shareInstance]createService:@protocol(CNLiveBPersonAuthentProtocol)];
        CNBPerAuthSuccessController *vc = (CNBPerAuthSuccessController *)[service pushToPersonalAuthenticationSuccessController:@{}];
//  CNBPerAuthSuccessController *vc = [[CNBPerAuthSuccessController alloc]init];
    [self.navigationController pushViewController:vc animated:NO];
}
- (void)buttonClick:(UIButton *)sender {
    
    if (sender.tag == 200) {
        CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:@{@"checkStatus":@"3"}];
          [self.navigationController pushViewController:vc animated:NO];
    }else if (sender.tag == 201){
        CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:@{@"checkStatus":@"0"}];
        [self.navigationController pushViewController:vc animated:NO];
    }else {
        CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:@{@"checkStatus":@"2"}];
               [self.navigationController pushViewController:vc animated:NO];
    }
}
 
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end