Commit 3e89b6be0f8aa00bc2b5b5e8a6d44e991a8a2910

Authored by 王军波
1 parent 7249b72d

身份证

Showing 15 changed files with 331 additions and 177 deletions
CNLiveBPersonalVerificationModule.podspec
... ... @@ -113,6 +113,8 @@ s.subspec 'CNBPersonCardInfo' do |card|
113 113 card.dependency 'CNLiveCustomUI'
114 114 ##用户库
115 115 card.dependency 'CNLiveUserManagement'
  116 + ##相册
  117 + card.dependency 'CNLiveImagePickerController'
116 118 # #网络请求
117 119 card.dependency 'CNLiveRequestBastKit'
118 120 card.dependency 'CNLiveEnvironment'
... ...
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/observer_idcard_own@2x.png 0 → 100644

4.11 KB

CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/observer_idcard_own@3x.png 0 → 100644

7.87 KB

CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Controller/ApplyForShootController.h
... ... @@ -8,16 +8,6 @@
8 8  
9 9 #import <UIKit/UIKit.h>
10 10  
11   -@protocol ApplyForShootControllerDelegate <NSObject>
12   -
13   -- (void)completeRefresh;
14   -
15   -@end
16   -
17 11 @interface ApplyForShootController : UIViewController
18 12  
19   -@property (nonatomic, weak) id <ApplyForShootControllerDelegate>delegate;
20   -
21   -- (instancetype)initWithIsMineVC:(BOOL)isMineVC;
22   -
23 13 @end
... ...
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Controller/ApplyForShootController.m
... ... @@ -25,27 +25,32 @@
25 25 #import "CNLiveBusinessTools.h"
26 26 #import "CNLiveEnvironment.h"
27 27 #import "CNLiveIDCardAuthGetImage.h"
28   -static NSString *shootCellId = @"shootCellId";
29   -static NSString *confirmCellId = @"confirmCellId";
  28 +#import "CNBPersonalVerificationController.h"
  29 +#import <CNLiveImagePickerController/TZImagePickerController.h>
  30 +#import <CNLiveImagePickerController/TZImageManager.h>
  31 +#import <CNLiveCommonCategory/CNLiveCommonCategory.h>
30 32  
31   -@interface ApplyForShootController ()<UIAlertViewDelegate,UITableViewDelegate,UITableViewDataSource>
  33 +@interface ApplyForShootController ()<UIAlertViewDelegate,UITableViewDelegate,UITableViewDataSource,UINavigationControllerDelegate, UIImagePickerControllerDelegate>
32 34  
33 35 @property (nonatomic, strong) UITableView *tableView;
34 36 @property (nonatomic, strong) NSArray <AgreementModel*>*dataArray;
35 37  
36 38 @property (nonatomic, strong) UIImage *fontImage;
37 39 @property (nonatomic, strong) UIImage *backImage;
  40 +@property (nonatomic, strong) UIImage *iconImage;
38 41 @property (nonatomic, strong) NSMutableArray *imageDatas;
39 42  
40 43 @property (nonatomic, copy) NSString *realName;
41 44 @property (nonatomic, copy) NSString *idCardNo;
  45 +@property (nonatomic, copy) NSString *address;
42 46  
43 47 @property (nonatomic, assign) BOOL isFont;
44 48 @property (nonatomic, assign) BOOL isDataSucc;
45 49 @property (nonatomic, assign) BOOL isFontSucc;
46 50 @property (nonatomic, assign) BOOL isBackSucc;
47   -@property (nonatomic, assign) BOOL isMineVC; //是否是"我的"页面
  51 +@property (nonatomic, assign) BOOL isOwnSucc;
48 52 @property (nonatomic, assign) BOOL isHandler;//是否监听识别结果
  53 +@property (nonatomic, strong) UIImagePickerController *pickerVC;
49 54  
50 55 @property (nonatomic, strong) ApplyForConfirmCell *confirmCell;
51 56  
... ... @@ -58,35 +63,21 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
58 63 void (^_failHandler)(NSError *);
59 64 }
60 65  
61   -- (void)viewWillAppear:(BOOL)animated {
62   - [super viewWillAppear:animated];
63   -}
64   -
65   -- (instancetype)initWithIsMineVC:(BOOL)isMineVC
66   -{
67   - self = [super init];
68   - if (self) {
69   - self.isMineVC = isMineVC;
70   - }
71   - return self;
72   -}
73   -
74 66 - (void)viewDidLoad {
75 67 [super viewDidLoad];
76   - self.title = @"资质上传";
  68 + self.title = @"拍摄照片";
77 69 self.view.backgroundColor = [UIColor whiteColor];
78 70 self.imageDatas = [NSMutableArray array];
79   -#pragma mark -warning 这里注释掉了
  71 + self.pickerVC = [[UIImagePickerController alloc] init];
  72 + self.pickerVC.delegate = self;
80 73 [[AipOcrService shardService] authWithAK:BDAppKey andSK:BDSecret];
81 74 [self loadData];
82 75 [self.view addSubview:self.tableView];
83   -// if (@available(iOS 11, *)) {
84   -// if (self.isViewLoaded) {
85   -// self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
86   -// }
87   -// } else {
88   -// self.automaticallyAdjustsScrollViewInsets = NO;
89   -// }
  76 + if (@available(iOS 11.0, *)) {
  77 + self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  78 + }else{
  79 + self.automaticallyAdjustsScrollViewInsets = NO;
  80 + }
90 81 [self configCallback];
91 82  
92 83 }
... ... @@ -97,13 +88,21 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
97 88 @{
98 89 @"shootTitle":@"第一步",
99 90 @"shootImage":@"observer_idcard_front",
100   - @"isFront":@"1"
  91 + @"isFront":@"1",
  92 + @"isOwn":@"0"
101 93 },
102 94 @{
103 95 @"shootTitle":@"第二步",
104 96 @"shootImage":@"observer_idcard_back",
105   - @"isFront":@"0"
106   - }
  97 + @"isFront":@"0",
  98 + @"isOwn":@"0"
  99 + },
  100 + @{
  101 + @"shootTitle":@"第三步",
  102 + @"shootImage":@"observer_idcard_own",
  103 + @"isFront":@"0",
  104 + @"isOwn":@"1"
  105 + },
107 106 ];
108 107 NSMutableArray *arrayM = [NSMutableArray array];
109 108 for (NSDictionary *dic in array) {
... ... @@ -125,7 +124,6 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
125 124 return ;
126 125 }
127 126 weakSelf.isHandler = NO;
128   - NSLog(@">>>>>>>>>>>>>>>>>>>>>>result: %@", result);
129 127 NSString *title = @"识别结果";
130 128 NSMutableString *message = [NSMutableString string];
131 129  
... ... @@ -227,8 +225,8 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
227 225 NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0];
228 226 ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index];
229 227 cell.imgV.image = weakSelf.fontImage;
230   - if (weakSelf.isBackSucc) {
231   - weakSelf.confirmCell.confirmButton.backgroundColor = CNLiveColorWithHexString(@"#23D41E");
  228 + if (weakSelf.isBackSucc && weakSelf.isOwnSucc) {
  229 + weakSelf.confirmCell.confirmButton.backgroundColor = RGBA(76, 170, 252, 1);
232 230 [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
233 231 }
234 232 } else {
... ... @@ -237,8 +235,8 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
237 235 NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0];
238 236 ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index];
239 237 cell.imgV.image = weakSelf.backImage;
240   - if (weakSelf.isFontSucc) {
241   - weakSelf.confirmCell.confirmButton.backgroundColor = CNLiveColorWithHexString(@"#23D41E");
  238 + if (weakSelf.isFontSucc && weakSelf.isOwnSucc) {
  239 + weakSelf.confirmCell.confirmButton.backgroundColor = RGBA(76, 170, 252, 1);
242 240 [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
243 241 }
244 242 }
... ... @@ -332,8 +330,8 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
332 330 NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0];
333 331 ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index];
334 332 cell.imgV.image = weakSelf.fontImage;
335   - if (weakSelf.isBackSucc) {
336   - weakSelf.confirmCell.confirmButton.backgroundColor = CNLiveColorWithHexString(@"#23D41E");
  333 + if (weakSelf.isBackSucc && weakSelf.isOwnSucc) {
  334 + weakSelf.confirmCell.confirmButton.backgroundColor = RGBA(76, 170, 252, 1);
337 335 [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
338 336 }
339 337 } else {
... ... @@ -342,8 +340,8 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
342 340 NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0];
343 341 ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index];
344 342 cell.imgV.image = weakSelf.backImage;
345   - if (weakSelf.isFontSucc) {
346   - weakSelf.confirmCell.confirmButton.backgroundColor = CNLiveColorWithHexString(@"#23D41E");
  343 + if (weakSelf.isFontSucc && weakSelf.isOwnSucc) {
  344 + weakSelf.confirmCell.confirmButton.backgroundColor = RGBA(76, 170, 252, 1);
347 345 [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
348 346 }
349 347 }
... ... @@ -478,11 +476,6 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
478 476 }
479 477 }
480 478  
481   -#pragma mark - 测试版点击图片传假图片
482   -- (void)takeTestPhoto:(BOOL)isFront {
483   - NSLog(@"测试版点击图片传假图片");
484   -}
485   -
486 479 #pragma mark -
487 480 #pragma mark - 提交 Action !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
488 481 - (void)submit:(UIButton *)sender {
... ... @@ -490,16 +483,6 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
490 483 sender.selected = !sender.selected;
491 484 sender.userInteractionEnabled = NO;
492 485  
493   - ///////////////////////////////////////////////测试
494   -// self.realName = @"李五";
495   -// self.idCardNo = @"370404199205160035";
496   -// self.isFontSucc = YES;
497   -// self.isBackSucc = YES;
498   -// self.fontImage = [UIImage imageNamed:@"dl_shibai"];
499   -// self.backImage = [UIImage imageNamed:@"dl_shibai"];
500   - ///////////////////////////////////////////////测试
501   -
502   -
503 486 if (!self.isFontSucc) {
504 487 sender.selected = !sender.selected;
505 488 sender.userInteractionEnabled = YES;
... ... @@ -510,34 +493,25 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
510 493 sender.userInteractionEnabled = YES;
511 494 [QMUITips showWithText:@"请上传证件照片(后)" inView:self.view hideAfterDelay:1.5];
512 495 return;
  496 + } else if (!self.isOwnSucc) {
  497 + sender.selected = !sender.selected;
  498 + sender.userInteractionEnabled = YES;
  499 + [QMUITips showWithText:@"请上传本人照片" inView:self.view hideAfterDelay:1.5];
  500 + return;
513 501 }
514 502  
515   - NSMutableDictionary *idCardObvDic = [NSMutableDictionary dictionaryWithCapacity:2];
516   - [idCardObvDic setObject:[NSString stringWithFormat:@"%.0f",self.fontImage.size.width] forKey:@"imageWidth"];
517   - [idCardObvDic setObject:[NSString stringWithFormat:@"%.0f",self.fontImage.size.height] forKey:@"imageHeight"];
518   - NSString *idCardObvInfo = [self convertToJsonData:idCardObvDic];
519   -
520   - NSMutableDictionary *idCardRevDic = [NSMutableDictionary dictionaryWithCapacity:2];
521   - [idCardRevDic setObject:[NSString stringWithFormat:@"%.0f",self.backImage.size.width] forKey:@"imageWidth"];
522   - [idCardRevDic setObject:[NSString stringWithFormat:@"%.0f",self.backImage.size.height] forKey:@"imageHeight"];
523   - NSString *idCardRevInfo = [self convertToJsonData:idCardRevDic];
524   -
525   -// NSLog(@"%@---%@",idCardObvInfo,idCardRevInfo);
526   -
527 503 NSMutableDictionary *params = [@{
528   - @"witSid" : CNUserShareModel.uid,
529   - @"realName" : self.realName,
530   - @"idCardNo" : self.idCardNo,
531   - @"mobile" : CNUserShareModel.mobile,
532   - @"idCardObvInfo" : idCardObvInfo ? idCardObvInfo : @"",
533   - @"idCardRevInfo" : idCardRevInfo ? idCardRevInfo : @""
  504 + @"sid" : CNUserShareModel.uid?CNUserShareModel.uid:@"",
  505 + @"realName" : self.realName?self.realName:@"",
  506 + @"idCardNo" : self.idCardNo?self.idCardNo:@"",
  507 + @"address" : self.address?self.address:@"",
534 508 } mutableCopy];
535 509  
536 510 NSMutableDictionary *para = [CNLiveBusinessTools encryptionSignWithParameter:[NSMutableDictionary dictionaryWithDictionary:params] encryptionKey:APPKey];
537 511  
538 512 __weak typeof(self) weakSelf = self;
539 513 AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
540   - [manager POST:CNApplyWitnessUrl parameters:para headers:nil constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
  514 + [manager POST:@"https://apiwjjtest.cnlive.com/Daren/buser/saveIdentity.action" parameters:para headers:nil constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
541 515  
542 516 NSData *fontData = [weakSelf imageDatasWithImage:self.fontImage];
543 517 NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
... ... @@ -553,6 +527,12 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
553 527 [formData appendPartWithFileData:backData name:[NSString stringWithFormat:@"idCardRev"] fileName:fileName2 mimeType:@"image/png"]; // mimeType: image/jpg,image/png
554 528 }
555 529  
  530 + NSData *iconData = [weakSelf imageDatasWithImage:self.iconImage];
  531 + NSString *fileName3 = [NSString stringWithFormat:@"%@%@.png",[formatter stringFromDate:[NSDate date]],@(3)];
  532 + if (iconData) {
  533 + [formData appendPartWithFileData:iconData name:[NSString stringWithFormat:@"icon"] fileName:fileName3 mimeType:@"image/png"];
  534 + }
  535 +
556 536 } progress:^(NSProgress * _Nonnull uploadProgress) {
557 537  
558 538 } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
... ... @@ -561,44 +541,9 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
561 541  
562 542 if ([[NSString stringWithFormat:@"%@",responseObject[@"errorCode"]] isEqualToString:@"0"]) {
563 543  
564   - NSDictionary *data = [NSDictionary dictionaryWithDictionary:responseObject[@"data"]];
565   - NSString *reviewStatus = [NSString stringWithFormat:@"%@",data[@"reviewStatus"]];//0-申请成功审核中,1-审核失败(可再次申请),2审核成功(已成为目击者)
566   - if ([reviewStatus isEqualToString:@"0"]) {
567   - dispatch_async(dispatch_get_main_queue(), ^{
568   -// CNApplyStatusController *statusVC = [[CNApplyStatusController alloc] initWithType:AuditStatusTypeAppling];
569   -// statusVC.applyStatusVCDelegate = weakSelf;
570   -// [[AppDelegate sharedAppDelegate] pushViewController:statusVC withBackTitle:@" "];
571   - if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(completeRefresh)]) {
572   - [weakSelf.delegate completeRefresh];
573   - }
574   - [weakSelf backAction];
575   - });
576   - } else if ([reviewStatus isEqualToString:@"1"]) {
577   - dispatch_async(dispatch_get_main_queue(), ^{
578   -// CNApplyStatusController *statusVC = [[CNApplyStatusController alloc] initWithType:AuditStatusTypeApplyFailed];
579   -// statusVC.applyStatusVCDelegate = weakSelf;
580   -// [[AppDelegate sharedAppDelegate] pushViewController:statusVC withBackTitle:@" "];
581   - if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(completeRefresh)]) {
582   - [weakSelf.delegate completeRefresh];
583   - }
584   - [weakSelf backAction];
585   - });
586   - } else if ([reviewStatus isEqualToString:@"2"]) {
587   - dispatch_async(dispatch_get_main_queue(), ^{
588   -// CNApplyStatusController *statusVC = [[CNApplyStatusController alloc] initWithType:AuditStatusTypeAppling];
589   -// statusVC.applyStatusVCDelegate = weakSelf;
590   -// [[AppDelegate sharedAppDelegate] pushViewController:statusVC withBackTitle:@" "];
591   - if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(completeRefresh)]) {
592   - [weakSelf.delegate completeRefresh];
593   - }
594   - [weakSelf backAction];
595   - });
596   - } else {
597   -
598   - sender.selected = !sender.selected;
599   - sender.userInteractionEnabled = YES;
600   - [QMUITips showError:responseObject[@"errorMessage"] inView:self.view hideAfterDelay:1.5];
601   - }
  544 + //成功
  545 + CNBPersonalVerificationController *vc = [[CNBPersonalVerificationController alloc]init];
  546 + [self.navigationController pushViewController:vc animated:NO];
602 547  
603 548 } else {//接口失败
604 549  
... ... @@ -616,13 +561,6 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
616 561 }];
617 562 }
618 563  
619   -#pragma mark - CNApplyStatusVCDelegate !!!!!!!!!!!!
620   -- (void)statusVCBackRefreshH5WitnessStatus {
621   - if (self.delegate && [self.delegate respondsToSelector:@selector(completeRefresh)]) {
622   - [self.delegate completeRefresh];
623   - }
624   -}
625   -
626 564 #pragma mark - Action !!!!!!!!!!!!!!!!!!!
627 565 - (void)backAction
628 566 {
... ... @@ -657,27 +595,41 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
657 595 }
658 596  
659 597 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
660   - return 3;
  598 + return self.dataArray.count+1;
661 599 }
662 600  
663 601 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
664 602  
665   - if (indexPath.row == 0 || indexPath.row == 1) {
  603 + if (indexPath.row < self.dataArray.count) {
666 604 AgreementModel *model = self.dataArray[indexPath.row];
667   - ApplyForShootCell *cell = [tableView dequeueReusableCellWithIdentifier:shootCellId forIndexPath:indexPath];
668   - cell.selectionStyle = UITableViewCellSelectionStyleNone;
669   - cell.model = model;
  605 + NSString *shootCellId = [NSString stringWithFormat:@"%zd",indexPath.row];
  606 + ApplyForShootCell *cell = [tableView dequeueReusableCellWithIdentifier:shootCellId];
  607 + if (!cell) {
  608 + cell = [[ApplyForShootCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:shootCellId];
  609 + cell.model = model;
  610 + cell.selectionStyle = UITableViewCellSelectionStyleNone;
  611 + }
670 612 __weak __typeof(self)weakSelf = self;
671 613 cell.clickShootBtnBlock = ^() {
672   - [weakSelf takePhoto:model.isFront];
  614 + if (model.isOwn) {
  615 + //拍照||相册
  616 + [weakSelf iconAction];
  617 + } else {
  618 + //身份证
  619 + [weakSelf takePhoto:model.isFront];
  620 + }
673 621 };
674 622 return cell;
675 623  
676 624 } else {
677   - ApplyForConfirmCell *cell = [tableView dequeueReusableCellWithIdentifier:confirmCellId forIndexPath:indexPath];
  625 + NSString *confirmCellId = [NSString stringWithFormat:@"%zd",indexPath.row];
  626 + ApplyForConfirmCell *cell = [tableView dequeueReusableCellWithIdentifier:confirmCellId];
  627 + if (!cell) {
  628 + cell = [[ApplyForConfirmCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:confirmCellId];
  629 + }
678 630 cell.selectionStyle = UITableViewCellSelectionStyleNone;
679 631 AgreementModel *model = [[AgreementModel alloc] init];
680   - model.confirmTitle = @"提交";
  632 + model.confirmTitle = @"下一步";
681 633 cell.model = model;
682 634 __weak __typeof(self)weakSelf = self;
683 635 cell.clickBtnBlock = ^(UIButton *btn){
... ... @@ -690,8 +642,12 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
690 642 }
691 643  
692 644 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
693   - if (indexPath.row==0 || indexPath.row==1) {
694   - return 256;
  645 + if (indexPath.row < self.dataArray.count) {
  646 + if (indexPath.row == 2) {
  647 + return 299;
  648 + } else {
  649 + return 256;
  650 + }
695 651 } else {
696 652 if (kNavigationBarHeight+256*2+145<KScreenHeight) {
697 653 return KScreenHeight-kNavigationBarHeight-256*2;
... ... @@ -701,6 +657,172 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
701 657 }
702 658 }
703 659  
  660 +#pragma mark - 自拍
  661 +-(void)photoBtnClick {
  662 +
  663 + __weak __typeof(self)weakSelf = self;
  664 + [self.view createAlertViewTitleArray:@[@"拍照",@"从手机相册选择"] subTitleArr:@[@"",@""] textColor:RGBA(76, 170, 252, 1) subTitleColor:[UIColor whiteColor] firstFont:UIFontMake(18.0f) font:UIFontMake(18.0f) subFont:UIFontMake(18.0f) cancelTitle:@"取消" cancelFont:UIFontMake(18.0f) cancelTitleColor:UIColorMake(102, 102, 102) actionBlock:^(UIButton *button, NSInteger didRow) {
  665 + switch (didRow) {
  666 + case 0:{
  667 + [weakSelf takeToXFPhoto];
  668 + }
  669 + break;
  670 + case 1:{
  671 + [weakSelf pushTZImagePickerController];
  672 + }
  673 + break;
  674 + default:
  675 + break;
  676 + }
  677 + }];
  678 +}
  679 +
  680 +#pragma mark - 跳转到相机
  681 +-(void)takeToXFPhoto {
  682 + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
  683 + self.pickerVC.sourceType = UIImagePickerControllerSourceTypeCamera;
  684 + //设置拍照后的图片可被编辑
  685 + self.pickerVC.modalPresentationStyle = UIModalPresentationFullScreen;
  686 + self.pickerVC.cameraDevice = UIImagePickerControllerCameraDeviceFront;
  687 + self.pickerVC.allowsEditing = YES;
  688 + [self presentViewController:self.pickerVC animated:YES completion:nil];
  689 + }
  690 +}
  691 +
  692 +#pragma mark - UIImagePickerControllerDelegate
  693 +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
  694 +
  695 + NSString *type = [info objectForKey:UIImagePickerControllerMediaType];
  696 + //当选择的类型是图片
  697 + if ([type isEqualToString:@"public.image"])
  698 + {
  699 + NSString *key = nil;
  700 + if (picker.allowsEditing) {
  701 + key = UIImagePickerControllerEditedImage;
  702 + }
  703 + else {
  704 + key = UIImagePickerControllerOriginalImage;
  705 + }
  706 + //获取图片
  707 + UIImage *image = [info objectForKey:key];
  708 + //设置头像
  709 + [self handleIconWithImage:image];
  710 + //关闭相册界面
  711 + [picker dismissViewControllerAnimated:YES completion:^{
  712 +
  713 + }];
  714 + }
  715 +}
  716 +
  717 +- (void)handleIconWithImage:(UIImage *)image {
  718 + // 固定方向
  719 + image = [image fixOrientation];//这个方法是UIImage+Extras.h中方法
  720 + //压缩图片质量
  721 + image = [self reduceImage:image percent:0.5];
  722 +
  723 +// CGSize imageSize = image.size;
  724 +// imageSize.height = 320;
  725 +// imageSize.width = 320;
  726 +// image = [self imageWithImageSimple:image scaledToSize:imageSize];
  727 + __weak typeof(self)weakSelf = self;
  728 + dispatch_async(dispatch_get_main_queue(), ^{
  729 + NSIndexPath *index = [NSIndexPath indexPathForRow:2 inSection:0];
  730 + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index];
  731 + cell.imgV.image = image;
  732 + weakSelf.isOwnSucc = YES;
  733 + weakSelf.iconImage = image;
  734 + if (weakSelf.isFont && weakSelf.isBackSucc) {
  735 + weakSelf.confirmCell.confirmButton.backgroundColor = RGBA(76, 170, 252, 1);
  736 + [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
  737 + }
  738 + });
  739 +
  740 +}
  741 +
  742 +//压缩图片质量
  743 +-(UIImage *)reduceImage:(UIImage *)image percent:(float)percent {
  744 + NSData *imageData = UIImageJPEGRepresentation(image, percent);
  745 + UIImage *newImage = [UIImage imageWithData:imageData];
  746 + return newImage;
  747 +}
  748 +//压缩图片尺寸
  749 +- (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)newSize {
  750 + UIGraphicsBeginImageContext(newSize);
  751 + [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
  752 + UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
  753 + UIGraphicsEndImageContext();
  754 + return newImage;
  755 +}
  756 +
  757 +//当用户取消选择的时候,调用该方法
  758 +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
  759 + [picker dismissViewControllerAnimated:YES completion:^{}];
  760 +}
  761 +
  762 +// 自拍cell点击事件
  763 +- (void)iconAction {
  764 + AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
  765 + if ((authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied) && iOS7Later) {
  766 + // 无权限 做一个友好的提示
  767 + [self goPrivacySetting];
  768 + } else if (authStatus == AVAuthorizationStatusNotDetermined) {
  769 + // fix issue 466, 防止用户首次拍照拒绝授权时相机页黑屏
  770 + if (iOS7Later) {
  771 + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
  772 + if (granted) {
  773 + dispatch_sync(dispatch_get_main_queue(), ^{
  774 + [self photoBtnClick];
  775 + });
  776 + }
  777 + }];
  778 + } else {
  779 + [self photoBtnClick];
  780 + }
  781 + } else {
  782 + [self photoBtnClick];
  783 + }
  784 +}
  785 +// 隐私设置提醒
  786 +- (void)goPrivacySetting {
  787 + dispatch_async(dispatch_get_main_queue(), ^{
  788 + NSString *appName = [[NSBundle mainBundle].infoDictionary valueForKey:@"CFBundleDisplayName"];
  789 + if (!appName) appName = [[NSBundle mainBundle].infoDictionary valueForKey:@"CFBundleName"];
  790 + NSString *message = [NSString stringWithFormat:@"请去-> [设置 - 隐私 - 相机 - %@] 打开访问开关",appName];
  791 + QMUIAlertAction *action1 = [QMUIAlertAction actionWithTitle:@"确定" style:QMUIAlertActionStyleCancel handler:^(__kindof QMUIAlertController *aAlertController, QMUIAlertAction *action) {
  792 +
  793 + }];
  794 + QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"警告" message:message preferredStyle:QMUIAlertControllerStyleAlert];
  795 + [alertController addAction:action1];
  796 + [alertController showWithAnimated:YES];
  797 +
  798 + });
  799 +}
  800 +
  801 +#pragma maek -从相册选择
  802 +- (void)pushTZImagePickerController {
  803 + __weak typeof(self)weakSelf = self;
  804 + TZImagePickerController *picker = [[TZImagePickerController alloc]initWithMaxImagesCount:1 delegate:self];
  805 + picker.modalPresentationStyle = UIModalPresentationFullScreen;
  806 + picker.allowPickingVideo = NO;
  807 + picker.allowPreview = NO;
  808 + picker.allowPickingGif = NO;
  809 + picker.allowTakePicture = NO;
  810 + [picker setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
  811 + dispatch_async(dispatch_get_main_queue(), ^{
  812 + NSIndexPath *index = [NSIndexPath indexPathForRow:2 inSection:0];
  813 + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index];
  814 + cell.imgV.image = [photos firstObject];
  815 + weakSelf.isOwnSucc = YES;
  816 + weakSelf.iconImage = [photos firstObject];
  817 + if (weakSelf.isFont && weakSelf.isBackSucc) {
  818 + weakSelf.confirmCell.confirmButton.backgroundColor = RGBA(76, 170, 252, 1);
  819 + [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
  820 + }
  821 + });
  822 + }];
  823 + [self presentViewController:picker animated:YES completion:nil];
  824 +}
  825 +
704 826 #pragma mark UIAlertViewDelegate
705 827 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
706 828 [self dismissViewControllerAnimated:YES completion:nil];
... ... @@ -732,10 +854,8 @@ static NSString *confirmCellId = @&quot;confirmCellId&quot;;
732 854 #pragma mark - SubViews
733 855 -(UITableView *)tableView {
734 856 if (!_tableView) {
735   - _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight-(self.isMineVC?kNavigationBarHeight:0)) style:UITableViewStylePlain];
  857 + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight, KScreenWidth, KScreenHeight-kNavigationBarHeight) style:UITableViewStylePlain];
736 858 _tableView.backgroundColor = RGB(242, 242, 242);
737   - [_tableView registerClass:[ApplyForShootCell class] forCellReuseIdentifier:shootCellId];
738   - [_tableView registerClass:[ApplyForConfirmCell class] forCellReuseIdentifier:confirmCellId];
739 859 _tableView.delegate = self;
740 860 _tableView.dataSource = self;
741 861 _tableView.separatorStyle = NO;
... ...
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Model/AgreementModel.h
... ... @@ -15,5 +15,6 @@
15 15 @property (nonatomic, copy) NSString *shootTitle;
16 16 @property (nonatomic, copy) NSString *shootImage;
17 17 @property (nonatomic, assign) BOOL isFront;
  18 +@property (nonatomic, assign) BOOL isOwn;
18 19  
19 20 @end
... ...
CNLiveIDCardAuthGetImage.h renamed to CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Model/CNLiveIDCardAuthGetImage.h
CNLiveIDCardAuthGetImage.m renamed to CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Model/CNLiveIDCardAuthGetImage.m
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Services/CNBPersonalAuthenticationService.h renamed to CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Services/CNIDCardAuthenticationServices.h
1 1 //
2   -// CNBPersonalAuthenticationService.h
  2 +// CNIDCardAuthenticationServices.h
3 3 // CNLiveBPersonalVerificationModule
4 4 //
5   -// Created by 殷巧娟 on 2020/4/17.
  5 +// Created by cnliveJunBo on 2020/4/22.
6 6 //
7 7  
8 8 #import <Foundation/Foundation.h>
9 9  
10 10 NS_ASSUME_NONNULL_BEGIN
11 11  
12   -@interface CNBPersonalAuthenticationService : NSObject
  12 +@interface CNIDCardAuthenticationServices : NSObject
13 13  
14 14 @end
15 15  
... ...
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Services/CNBPersonalAuthenticationService.m renamed to CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Services/CNIDCardAuthenticationServices.m
1 1 //
2   -// CNBPersonalAuthenticationService.m
  2 +// CNIDCardAuthenticationServices.m
3 3 // CNLiveBPersonalVerificationModule
4 4 //
5   -// Created by 殷巧娟 on 2020/4/17.
  5 +// Created by cnliveJunBo on 2020/4/22.
6 6 //
7 7  
8   -#import "CNBPersonalAuthenticationService.h"
  8 +#import "CNIDCardAuthenticationServices.h"
9 9  
10   -@implementation CNBPersonalAuthenticationService
  10 +@implementation CNIDCardAuthenticationServices
11 11  
12 12 @end
... ...
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/ApplyForConfirmCell.m
... ... @@ -42,7 +42,7 @@
42 42  
43 43 - (UIButton *)confirmButton {
44 44 if (!_confirmButton) {
45   - _confirmButton = [UIButton create_textButton:CGRectMake(30, 40, KScreenWidth-60, 45) backgroundColor:RGB(216, 216, 216) title:@"下一步" selectedTitle:@"提交中..." fontSize:18 normalColor:RGB(180, 180, 180) selectedColor:kWhiteColor cornerRadius:4.0 borderWidth:0 borderColor:nil];
  45 + _confirmButton = [UIButton create_textButton:CGRectMake(30, 40, KScreenWidth-60, 45) backgroundColor:RGB(216, 216, 216) title:@"下一步" selectedTitle:@"提交中..." fontSize:18 normalColor:RGB(180, 180, 180) selectedColor:kWhiteColor cornerRadius:22.5 borderWidth:0 borderColor:nil];
46 46 [_confirmButton addTarget:self action:@selector(agree:) forControlEvents:UIControlEventTouchUpInside];
47 47 }
48 48 return _confirmButton;
... ...
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/ApplyForShootCell.m
... ... @@ -36,6 +36,8 @@
36 36  
37 37 _titleLab.text = model.shootTitle;
38 38 _imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:model.shootImage bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]];
  39 + CGFloat width = KScreenWidth - 88;
  40 + CGFloat height = width*157.0/287.0;
39 41 if (model.isFront) {
40 42 self.lineV.hidden = NO;
41 43 NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"请拍摄本人身份证正面 注意避免证件反光"];
... ... @@ -46,6 +48,23 @@
46 48 NSRange range3 = [[str string] rangeOfString:@" 注意避免证件反光"];
47 49 [str addAttribute:NSForegroundColorAttributeName value:RGBA(156, 156, 156, 1) range:range3];
48 50 _subTitleLab.attributedText = str;
  51 + [self.imgV mas_remakeConstraints:^(MASConstraintMaker *make) {
  52 + make.top.equalTo(self.subTitleLab.mas_bottom).offset(10);
  53 + make.left.equalTo(self).offset(44);
  54 + make.right.equalTo(self).offset(-44);
  55 + make.height.mas_equalTo(height);
  56 + }];
  57 + } else if (model.isOwn) {
  58 + self.lineV.hidden = YES;
  59 + NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"请上传您本人照片,确保肩部至头部清晰可见"];
  60 + [str addAttribute:NSForegroundColorAttributeName value:RGBA(156, 156, 156, 1) range:NSMakeRange(0, str.length)];
  61 + _subTitleLab.attributedText = str;
  62 + [self.imgV mas_remakeConstraints:^(MASConstraintMaker *make) {
  63 + make.top.equalTo(self.subTitleLab.mas_bottom).offset(10);
  64 + make.left.equalTo(self).offset(44);
  65 + make.width.mas_equalTo(133);
  66 + make.height.mas_equalTo(199);
  67 + }];
49 68 } else {
50 69 self.lineV.hidden = YES;
51 70 NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"请拍摄本人身份证反面 注意避免证件反光"];
... ... @@ -56,6 +75,12 @@
56 75 NSRange range3 = [[str string] rangeOfString:@" 注意避免证件反光"];
57 76 [str addAttribute:NSForegroundColorAttributeName value:RGBA(156, 156, 156, 1) range:range3];
58 77 _subTitleLab.attributedText = str;
  78 + [self.imgV mas_remakeConstraints:^(MASConstraintMaker *make) {
  79 + make.top.equalTo(self.subTitleLab.mas_bottom).offset(10);
  80 + make.left.equalTo(self).offset(44);
  81 + make.right.equalTo(self).offset(-44);
  82 + make.height.mas_equalTo(height);
  83 + }];
59 84 }
60 85  
61 86 }
... ... @@ -68,39 +93,38 @@
68 93 [self.contentView addSubview:self.imgV];
69 94 // [self.imgV addSubview:self.shootBtn];
70 95  
  96 + [self.lineV mas_makeConstraints:^(MASConstraintMaker *make) {
  97 + make.left.top.right.equalTo(self.contentView);
  98 + make.height.mas_equalTo(1);
  99 + }];
  100 + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
  101 + make.left.equalTo(self.contentView).offset(69);
  102 + make.top.equalTo(_lineV.mas_bottom).offset(22);
  103 + make.width.mas_equalTo(64);
  104 + make.height.mas_equalTo(16);
  105 + }];
  106 + [self.subTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
  107 + make.left.equalTo(self.contentView).offset(69);
  108 + make.top.equalTo(self.titleLab.mas_bottom).offset(15);
  109 + make.height.mas_equalTo(15);
  110 + }];
  111 + CGFloat width = KScreenWidth - 88;
  112 + CGFloat height = width*157.0/287.0;
  113 + [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) {
  114 + make.top.equalTo(self.subTitleLab.mas_bottom).offset(10);
  115 + make.left.equalTo(self).offset(44);
  116 + make.right.equalTo(self).offset(-44);
  117 + make.height.mas_equalTo(height);
  118 + }];
  119 + // [self.shootBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  120 + // make.center.equalTo(self.imgV);
  121 + // make.width.height.mas_equalTo(60);
  122 + // }];
71 123 }
72 124  
73 125 - (void)layoutSubviews {
74 126 [super layoutSubviews];
75 127  
76   - [self.lineV mas_makeConstraints:^(MASConstraintMaker *make) {
77   - make.left.top.right.equalTo(self.contentView);
78   - make.height.mas_equalTo(1);
79   - }];
80   - [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
81   - make.left.equalTo(self.contentView).offset(69);
82   - make.top.equalTo(_lineV.mas_bottom).offset(22);
83   - make.width.mas_equalTo(64);
84   - make.height.mas_equalTo(16);
85   - }];
86   - [self.subTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
87   - make.centerX.equalTo(self.contentView);
88   - make.top.equalTo(self.titleLab.mas_bottom).offset(15);
89   - make.width.mas_equalTo(245);
90   - make.height.mas_equalTo(15);
91   - }];
92   - CGFloat width = KScreenWidth - 88;
93   - CGFloat height = width*157.0/287.0;
94   - [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) {
95   - make.top.equalTo(self.subTitleLab.mas_bottom).offset(10);
96   - make.left.equalTo(self).offset(44);
97   - make.right.equalTo(self).offset(-44);
98   - make.height.mas_equalTo(height);
99   - }];
100   -// [self.shootBtn mas_makeConstraints:^(MASConstraintMaker *make) {
101   -// make.center.equalTo(self.imgV);
102   -// make.width.height.mas_equalTo(60);
103   -// }];
104 128 }
105 129  
106 130 - (void)shootPhotoAction:(UIButton *)sender{
... ...
Example/CNLiveBPersonalVerificationModule.xcodeproj/project.pbxproj
... ... @@ -371,13 +371,18 @@
371 371 "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework",
372 372 "${BUILT_PRODUCTS_DIR}/CNLiveCustomUI/CNLiveCustomUI.framework",
373 373 "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework",
  374 + "${BUILT_PRODUCTS_DIR}/CNLiveImagePickerController/CNLiveImagePickerController.framework",
374 375 "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework",
375 376 "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework",
  377 + "${BUILT_PRODUCTS_DIR}/CNLiveUploadManager/CNLiveUploadManager.framework",
376 378 "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework",
  379 + "${BUILT_PRODUCTS_DIR}/HappyDNS/HappyDNS.framework",
377 380 "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework",
378 381 "${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework",
379 382 "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework",
380 383 "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework",
  384 + "${BUILT_PRODUCTS_DIR}/Qiniu/Qiniu.framework",
  385 + "${BUILT_PRODUCTS_DIR}/SDAutoLayout/SDAutoLayout.framework",
381 386 "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
382 387 "${BUILT_PRODUCTS_DIR}/WebViewJavascriptBridge/WebViewJavascriptBridge.framework",
383 388 "${BUILT_PRODUCTS_DIR}/YYKit/YYKit.framework",
... ... @@ -399,13 +404,18 @@
399 404 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework",
400 405 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomUI.framework",
401 406 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework",
  407 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveImagePickerController.framework",
402 408 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework",
403 409 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework",
  410 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUploadManager.framework",
404 411 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework",
  412 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HappyDNS.framework",
405 413 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework",
406 414 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework",
407 415 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework",
408 416 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework",
  417 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Qiniu.framework",
  418 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDAutoLayout.framework",
409 419 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
410 420 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebViewJavascriptBridge.framework",
411 421 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKit.framework",
... ...
Example/CNLiveBPersonalVerificationModule/CNLIVEViewController.m
... ... @@ -11,6 +11,7 @@
11 11 #import "CNBPerAuthSuccessController.h"
12 12 #import "CNBPerCertificationController.h"
13 13 #import "CNLiveBPersonAuthentProtocol.h"
  14 +#import "ApplyForShootController.h"
14 15 @interface CNLIVEViewController ()
15 16  
16 17 @end
... ... @@ -41,7 +42,9 @@
41 42 }
42 43  
43 44 - (void)buttonAction {
44   - CNBPersonalVerificationController *vc = [[CNBPersonalVerificationController alloc]init];
  45 + ApplyForShootController *vc = [[ApplyForShootController alloc] init];
  46 +
  47 +// CNBPersonalVerificationController *vc = [[CNBPersonalVerificationController alloc]init];
45 48 [self.navigationController pushViewController:vc animated:NO];
46 49 // id <CNLiveBPersonAuthentProtocol>service = [[BeeHive shareInstance]createService:@protocol(CNLiveBPersonAuthentProtocol)];
47 50 // CNBPersonalVerificationController *vc = (CNBPersonalVerificationController *)[service pushToAddPerAuthInstitutionsController:@{}];
... ...
Example/CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Info.plist
... ... @@ -31,6 +31,10 @@
31 31 <key>NSAllowsArbitraryLoads</key>
32 32 <true/>
33 33 </dict>
  34 + <key>NSCameraUsageDescription</key>
  35 + <string>需要允许开启相机才能使用拍照功能</string>
  36 + <key>NSPhotoLibraryUsageDescription</key>
  37 + <string>需要允许打开相册才能访问相册照片和保存照片</string>
34 38 <key>UILaunchStoryboardName</key>
35 39 <string>LaunchScreen</string>
36 40 <key>UIMainStoryboardFile</key>
... ...