Commit af7d2e7210262c62d70a433b8c561a67abb1ee06
1 parent
5e80a8de
修改个人资料认证
Showing
82 changed files
with
2190 additions
and
63 deletions
CNLiveBPersonalVerificationModule.podspec
| @@ -49,6 +49,9 @@ s.subspec 'CNBInstitutionInfo' do |institution| | @@ -49,6 +49,9 @@ s.subspec 'CNBInstitutionInfo' do |institution| | ||
| 49 | viewModel.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/*.{h,m}' | 49 | viewModel.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/*.{h,m}' |
| 50 | viewModel.dependency 'CNLiveBPersonalVerificationModule/CNBInstitutionInfo/Model' | 50 | viewModel.dependency 'CNLiveBPersonalVerificationModule/CNBInstitutionInfo/Model' |
| 51 | end | 51 | end |
| 52 | + institution.subspec 'Services' do |service| | ||
| 53 | + service.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Services/*.{h,m}' | ||
| 54 | + end | ||
| 52 | institution.resource_bundles = { | 55 | institution.resource_bundles = { |
| 53 | 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle'] | 56 | 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle'] |
| 54 | } | 57 | } |
| @@ -63,39 +66,60 @@ s.subspec 'CNBInstitutionInfo' do |institution| | @@ -63,39 +66,60 @@ s.subspec 'CNBInstitutionInfo' do |institution| | ||
| 63 | institution.dependency 'CNLiveBaseKit' | 66 | institution.dependency 'CNLiveBaseKit' |
| 64 | #基础类目 | 67 | #基础类目 |
| 65 | institution.dependency 'CNLiveCommonCategory' | 68 | institution.dependency 'CNLiveCommonCategory' |
| 66 | - ##基础UI | 69 | + #基础UI |
| 67 | institution.dependency 'CNLiveCustomUI' | 70 | institution.dependency 'CNLiveCustomUI' |
| 68 | - ##用户库 | 71 | + #用户库 |
| 69 | institution.dependency 'CNLiveUserManagement' | 72 | institution.dependency 'CNLiveUserManagement' |
| 70 | - # #网络请求 | 73 | + #网络请求 |
| 71 | institution.dependency 'CNLiveRequestBastKit' | 74 | institution.dependency 'CNLiveRequestBastKit' |
| 75 | + #环境库 | ||
| 72 | institution.dependency 'CNLiveEnvironment' | 76 | institution.dependency 'CNLiveEnvironment' |
| 77 | + #基础库 | ||
| 73 | institution.dependency 'CNLiveBaseClass' | 78 | institution.dependency 'CNLiveBaseClass' |
| 79 | + #协议库 | ||
| 80 | + institution.dependency 'CNLiveBeeHive' | ||
| 81 | + institution.dependency 'CNLiveBServices' | ||
| 74 | end | 82 | end |
| 83 | +#s.subspec 'CNBPersonCardInfo' do |card| | ||
| 84 | +# card.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/**' | ||
| 85 | +# card.subspec 'Controller' do |controller| | ||
| 86 | +# controller.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Controller/*.{h,m}' | ||
| 87 | +# controller.dependency 'CNLiveBPersonalVerificationModule/CNBPersonCardInfo/View' | ||
| 88 | +# end | ||
| 89 | +# card.subspec 'View' do |view| | ||
| 90 | +# view.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/*.{h,m}' | ||
| 91 | +# view.dependency 'CNLiveBPersonalVerificationModule/CNBPersonCardInfo/Model' | ||
| 92 | +# end | ||
| 93 | +# card.subspec 'Model' do |model| | ||
| 94 | +# model.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Model/*.{h,m}' | ||
| 95 | +# end | ||
| 96 | +# card.ios.vendored_frameworks = 'CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework','CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework','CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework' | ||
| 97 | +# card.resource_bundles = { | ||
| 98 | +# 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle'] | ||
| 99 | +# } | ||
| 100 | +# card.dependency 'CNLiveTripartiteManagement/Masonry' | ||
| 101 | +# card.dependency 'CNLiveTripartiteManagement/QMUIKit' | ||
| 102 | +# card.dependency 'CNLiveTripartiteManagement/MJExtension' | ||
| 103 | +# card.dependency 'CNLiveTripartiteManagement/SDWebImage' | ||
| 104 | +# card.dependency 'CNLiveTripartiteManagement/MJRefresh' | ||
| 105 | +# card.dependency 'CNLiveTripartiteManagement/YYKit' | ||
| 106 | +# card.dependency 'CNLiveTripartiteManagement/AFNetworking' | ||
| 107 | +# #基础库 | ||
| 108 | +# card.dependency 'CNLiveBaseKit' | ||
| 109 | +# #基础类目 | ||
| 110 | +# card.dependency 'CNLiveCommonCategory' | ||
| 111 | +# ##基础UI | ||
| 112 | +# card.dependency 'CNLiveCustomUI' | ||
| 113 | +# ##用户库 | ||
| 114 | +# card.dependency 'CNLiveUserManagement' | ||
| 115 | +# # #网络请求 | ||
| 116 | +# card.dependency 'CNLiveRequestBastKit' | ||
| 117 | +# card.dependency 'CNLiveEnvironment' | ||
| 118 | +# card.dependency 'CNLiveBaseClass' | ||
| 119 | +# card.dependency 'CNLiveBaseTools' | ||
| 120 | +# card.dependency 'CNLiveBusinessTools' | ||
| 121 | +# end | ||
| 75 | 122 | ||
| 76 | 123 | ||
| 77 | -#s.dependency 'CNLiveTripartiteManagement/Masonry' | ||
| 78 | -#s.dependency 'CNLiveTripartiteManagement/QMUIKit' | ||
| 79 | -#s.dependency 'CNLiveTripartiteManagement/MJExtension' | ||
| 80 | -#s.dependency 'CNLiveTripartiteManagement/SDWebImage' | ||
| 81 | -#s.dependency 'CNLiveTripartiteManagement/MJRefresh' | ||
| 82 | -#s.dependency 'CNLiveTripartiteManagement/YYKit' | ||
| 83 | -#s.dependency 'CNLiveTripartiteManagement/AFNetworking' | ||
| 84 | -##基础库 | ||
| 85 | -#s.dependency 'CNLiveBaseKit' | ||
| 86 | -##基础类目 | ||
| 87 | -#s.dependency 'CNLiveCommonCategory' | ||
| 88 | -###基础UI | ||
| 89 | -#s.dependency 'CNLiveCustomUI' | ||
| 90 | -###用户库 | ||
| 91 | -# s.dependency 'CNLiveUserManagement' | ||
| 92 | -## #网络请求 | ||
| 93 | -# s.dependency 'CNLiveRequestBastKit' | ||
| 94 | -# s.dependency 'CNLiveEnvironment' | ||
| 95 | -# s.dependency 'CNLiveBaseClass' | ||
| 96 | -#s.resource_bundles = { | ||
| 97 | -# 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle'] | ||
| 98 | -#} | ||
| 99 | - | ||
| 100 | -# s.frameworks = 'UIKit', 'Foundation' | 124 | + s.frameworks = 'UIKit', 'Foundation' |
| 101 | end | 125 | end |
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/dl_xiangji@2x.png
0 → 100644
4.3 KB
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/dl_xiangji@3x.png
0 → 100644
9.19 KB
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/observer_idcard_back@2x.png
0 → 100644
21.8 KB
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/observer_idcard_back@3x.png
0 → 100644
41.9 KB
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/observer_idcard_examine@2x.png
0 → 100644
22.9 KB
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/observer_idcard_examine@3x.png
0 → 100644
46 KB
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/observer_idcard_front@2x.png
0 → 100644
25.2 KB
CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle/observer_idcard_front@3x.png
0 → 100644
47.5 KB
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerAuthSuccessController.h
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | NS_ASSUME_NONNULL_BEGIN | 10 | NS_ASSUME_NONNULL_BEGIN |
| 11 | 11 | ||
| 12 | @interface CNBPerAuthSuccessController : UIViewController | 12 | @interface CNBPerAuthSuccessController : UIViewController |
| 13 | - | 13 | +- (instancetype)initControllerWithParam:(NSDictionary *)param; |
| 14 | @end | 14 | @end |
| 15 | 15 | ||
| 16 | NS_ASSUME_NONNULL_END | 16 | NS_ASSUME_NONNULL_END |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerAuthSuccessController.m
| @@ -12,6 +12,14 @@ | @@ -12,6 +12,14 @@ | ||
| 12 | #import "CNBPerAuthHeaderView.h" | 12 | #import "CNBPerAuthHeaderView.h" |
| 13 | #import "CNBPerAuthViewModel.h" | 13 | #import "CNBPerAuthViewModel.h" |
| 14 | #import "CNBPerCertificationSuccessModel.h" | 14 | #import "CNBPerCertificationSuccessModel.h" |
| 15 | +#import "CNEmptyView.h" | ||
| 16 | +#import "CNLivePerAuthGetImage.h" | ||
| 17 | +#import "MJExtension.h" | ||
| 18 | +typedef NS_ENUM(NSUInteger,CNBPerAuthErrorType) { | ||
| 19 | + CNBPerAuthErrorTypeNoNet, //没网 | ||
| 20 | + CNBPerAuthErrorTypeFail, //请求失败 | ||
| 21 | + CNBPerAuthErrorTypeNoData //没数据 | ||
| 22 | +}; | ||
| 15 | static NSString *infoIdentifier = @"CNBPersonalInfoCell"; | 23 | static NSString *infoIdentifier = @"CNBPersonalInfoCell"; |
| 16 | static NSString *normalIdentifier = @"CNBInstitutionsInfoCell"; | 24 | static NSString *normalIdentifier = @"CNBInstitutionsInfoCell"; |
| 17 | static NSString *groupIdentifier = @"CNBGroupInfoCell"; | 25 | static NSString *groupIdentifier = @"CNBGroupInfoCell"; |
| @@ -20,15 +28,35 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; | @@ -20,15 +28,35 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; | ||
| 20 | @property (nonatomic, strong) NSMutableArray *institutionArray; | 28 | @property (nonatomic, strong) NSMutableArray *institutionArray; |
| 21 | @property (nonatomic, strong) CNBUserInfoModel *infoModel; | 29 | @property (nonatomic, strong) CNBUserInfoModel *infoModel; |
| 22 | @property (nonatomic, strong) NSMutableArray *circleArray; | 30 | @property (nonatomic, strong) NSMutableArray *circleArray; |
| 31 | +@property (nonatomic, strong) CNEmptyView *emptyView; | ||
| 32 | +@property (nonatomic, strong) NSDictionary *data; //后台返回的数据 | ||
| 23 | @end | 33 | @end |
| 24 | 34 | ||
| 25 | @implementation CNBPerAuthSuccessController | 35 | @implementation CNBPerAuthSuccessController |
| 26 | 36 | ||
| 37 | +- (instancetype)initControllerWithParam:(NSDictionary *)param { | ||
| 38 | + self = [super init]; | ||
| 39 | + if (self) { | ||
| 40 | + _data = param; | ||
| 41 | + } | ||
| 42 | + return self; | ||
| 43 | +} | ||
| 27 | - (void)viewDidLoad { | 44 | - (void)viewDidLoad { |
| 28 | [super viewDidLoad]; | 45 | [super viewDidLoad]; |
| 29 | [self.view addSubview:self.tableView]; | 46 | [self.view addSubview:self.tableView]; |
| 30 | self.title = @"身份校验"; | 47 | self.title = @"身份校验"; |
| 31 | - [self requestPerAuthSuccessData]; | 48 | + if (self.data && [self.data isKindOfClass:[NSDictionary class]]) { |
| 49 | + CNBPerCertificationSuccessModel *successModel = [CNBPerCertificationSuccessModel mj_objectWithKeyValues:self.data]; | ||
| 50 | + self.infoModel = successModel.bUserIdentity; | ||
| 51 | + for (CNBInstitutionModel *model in successModel.institution) { | ||
| 52 | + [self.institutionArray addObject:model]; | ||
| 53 | + } | ||
| 54 | + [self.institutionArray insertObject:successModel.bUserIdentity atIndex:0]; | ||
| 55 | + [self.tableView reloadData]; | ||
| 56 | + | ||
| 57 | + }else { | ||
| 58 | + [self requestPerAuthSuccessData]; | ||
| 59 | + } | ||
| 32 | } | 60 | } |
| 33 | #pragma mark - 请求数据 | 61 | #pragma mark - 请求数据 |
| 34 | - (void)requestPerAuthSuccessData { | 62 | - (void)requestPerAuthSuccessData { |
| @@ -43,13 +71,46 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; | @@ -43,13 +71,46 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; | ||
| 43 | for (CNBInstitutionModel *model in successModel.institution) { | 71 | for (CNBInstitutionModel *model in successModel.institution) { |
| 44 | [strongSelf.institutionArray addObject:model]; | 72 | [strongSelf.institutionArray addObject:model]; |
| 45 | } | 73 | } |
| 74 | + [strongSelf.emptyView removeFromSuperview ]; | ||
| 46 | [strongSelf.institutionArray insertObject:successModel.bUserIdentity atIndex:0]; | 75 | [strongSelf.institutionArray insertObject:successModel.bUserIdentity atIndex:0]; |
| 47 | [strongSelf.tableView reloadData]; | 76 | [strongSelf.tableView reloadData]; |
| 48 | } failureBlock:^(NSError * _Nonnull error) { | 77 | } failureBlock:^(NSError * _Nonnull error) { |
| 49 | - | 78 | + if (error.code == -1009 || error.code == -1001) { |
| 79 | + [weakSelf showEmptyView:CNBPerAuthErrorTypeNoNet]; | ||
| 80 | + }else { | ||
| 81 | + [weakSelf showEmptyView:CNBPerAuthErrorTypeFail]; | ||
| 82 | + } | ||
| 50 | }]; | 83 | }]; |
| 51 | } | 84 | } |
| 52 | -#pragma mark - 点击放大图片 | 85 | +#pragma mark - 重试 |
| 86 | +- (void)retryloadData { | ||
| 87 | + [self requestPerAuthSuccessData]; | ||
| 88 | +} | ||
| 89 | +#pragma mark - 展示空视图 | ||
| 90 | +- (void)showEmptyView:(CNBPerAuthErrorType)errorType { | ||
| 91 | + NSString *titleName = @""; | ||
| 92 | + NSString *imageName = @""; | ||
| 93 | + NSString *retryName = @""; | ||
| 94 | + if (errorType == CNBPerAuthErrorTypeNoNet) { | ||
| 95 | + imageName = @"dd_wlcw"; | ||
| 96 | + titleName = @"网络开小差了,刷新试试"; | ||
| 97 | + retryName = @"刷新"; | ||
| 98 | + }else if (errorType == CNBPerAuthErrorTypeFail) { | ||
| 99 | + imageName = @"wufalianjie"; | ||
| 100 | + titleName = @"接口开小差了,试试重新请求"; | ||
| 101 | + retryName = @"重试"; | ||
| 102 | + } | ||
| 103 | + [self.emptyView showImage:[CNLivePerAuthGetImage cnLivePerAuth_getImageName:imageName bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]] title:titleName detailTitle:@"" retryBtnTitle:retryName]; | ||
| 104 | + self.emptyView.retryBtn.backgroundColor = kWhiteColor; | ||
| 105 | + self.emptyView.retryBtn.layer.masksToBounds = YES; | ||
| 106 | + self.emptyView.retryBtn.layer.cornerRadius = 14; | ||
| 107 | + self.emptyView.retryBtn.layer.borderWidth = 1; | ||
| 108 | + self.emptyView.retryBtn.layer.borderColor = CNLiveColorWithHexString(@"48A7F9").CGColor; | ||
| 109 | + [self.emptyView.retryBtn setTitleColor:CNLiveColorWithHexString(@"48A7F9") forState:UIControlStateNormal]; | ||
| 110 | + [self.emptyView.retryBtn setTitleColor:CNLiveColorWithHexString(@"48A7F9") forState:UIControlStateHighlighted]; | ||
| 111 | + [self.view addSubview:self.emptyView]; | ||
| 112 | + [self.emptyView.retryBtn addTarget:self action:@selector(retryloadData) forControlEvents:UIControlEventTouchUpInside]; | ||
| 113 | +} | ||
| 53 | #pragma mark - tableViewDelegateAndDataSource | 114 | #pragma mark - tableViewDelegateAndDataSource |
| 54 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | 115 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { |
| 55 | return self.institutionArray.count; | 116 | return self.institutionArray.count; |
| @@ -158,4 +219,10 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; | @@ -158,4 +219,10 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; | ||
| 158 | } | 219 | } |
| 159 | return _circleArray; | 220 | return _circleArray; |
| 160 | } | 221 | } |
| 222 | +- (CNEmptyView *)emptyView { | ||
| 223 | + if (!_emptyView) { | ||
| 224 | + _emptyView = [[CNEmptyView alloc]initWithFrame:CGRectMake(0, kNavigationBarHeight, KScreenWidth, KScreenHeight - kNavigationBarHeight) type:1]; | ||
| 225 | + } | ||
| 226 | + return _emptyView; | ||
| 227 | +} | ||
| 161 | @end | 228 | @end |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerCertificationController.h
| @@ -14,7 +14,7 @@ typedef NS_ENUM(NSUInteger,CNBShowCertificatType) { //审核类型 | @@ -14,7 +14,7 @@ typedef NS_ENUM(NSUInteger,CNBShowCertificatType) { //审核类型 | ||
| 14 | NS_ASSUME_NONNULL_BEGIN | 14 | NS_ASSUME_NONNULL_BEGIN |
| 15 | 15 | ||
| 16 | @interface CNBPerCertificationController : UIViewController | 16 | @interface CNBPerCertificationController : UIViewController |
| 17 | -- (instancetype)initControllerWithCertificatType:(CNBShowCertificatType)type; | 17 | +- (instancetype)initControllerWithCertificatType:(NSDictionary *)data; |
| 18 | @end | 18 | @end |
| 19 | 19 | ||
| 20 | NS_ASSUME_NONNULL_END | 20 | NS_ASSUME_NONNULL_END |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerCertificationController.m
| @@ -11,33 +11,36 @@ | @@ -11,33 +11,36 @@ | ||
| 11 | #import "CNLiveBaseKit.h" | 11 | #import "CNLiveBaseKit.h" |
| 12 | #import "UIColor+CNLiveExtension.h" | 12 | #import "UIColor+CNLiveExtension.h" |
| 13 | @interface CNBPerCertificationController () | 13 | @interface CNBPerCertificationController () |
| 14 | -@property (nonatomic, assign) CNBShowCertificatType type; | ||
| 15 | -@property (nonatomic, strong) UIImageView *showImageV; | ||
| 16 | -@property (nonatomic, strong) UILabel *titleLabel; | ||
| 17 | -@property (nonatomic, strong) UIButton *sureBtn; | 14 | +@property (nonatomic, copy) NSString *type; |
| 15 | +@property (nonatomic, strong) UIImageView *showImageV; | ||
| 16 | +@property (nonatomic, strong) UILabel *titleLabel; | ||
| 17 | +@property (nonatomic, strong) UIButton *sureBtn; | ||
| 18 | @end | 18 | @end |
| 19 | 19 | ||
| 20 | @implementation CNBPerCertificationController | 20 | @implementation CNBPerCertificationController |
| 21 | 21 | ||
| 22 | -- (instancetype)initControllerWithCertificatType:(CNBShowCertificatType)type { | 22 | +- (instancetype)initControllerWithCertificatType:(NSDictionary *)data { |
| 23 | if (self = [super init]) { | 23 | if (self = [super init]) { |
| 24 | - _type = type; | 24 | + if (data && [data isKindOfClass:[NSDictionary class]]) { |
| 25 | + self.type = data[@"checkStatus"]; | ||
| 26 | + } | ||
| 25 | } | 27 | } |
| 26 | return self; | 28 | return self; |
| 27 | } | 29 | } |
| 28 | - (void)viewDidLoad { | 30 | - (void)viewDidLoad { |
| 29 | [super viewDidLoad]; | 31 | [super viewDidLoad]; |
| 32 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 30 | NSString *text = @""; | 33 | NSString *text = @""; |
| 31 | NSString *buttonName = @""; | 34 | NSString *buttonName = @""; |
| 32 | - if (self.type == CNBShowCertificatTypeFail){ | 35 | + if ([self.type isEqualToString:@"3"]){ |
| 33 | self.title = @"个人认证"; | 36 | self.title = @"个人认证"; |
| 34 | text = @"您申请的个人认证审核未通过\n原因:您提交的公司信息有误,请重新申请"; | 37 | text = @"您申请的个人认证审核未通过\n原因:您提交的公司信息有误,请重新申请"; |
| 35 | buttonName = @"重新申请"; | 38 | buttonName = @"重新申请"; |
| 36 | - }else if (self.type == CNBShowCertificatTypeAuditing) { | 39 | + }else if ([self.type isEqualToString:@"2"]) { |
| 37 | self.title = @"个人认证"; | 40 | self.title = @"个人认证"; |
| 38 | text = @"请您耐心等待,后台正在提交审核中"; | 41 | text = @"请您耐心等待,后台正在提交审核中"; |
| 39 | buttonName = @"返回"; | 42 | buttonName = @"返回"; |
| 40 | - }else { | 43 | + }else if ([self.type isEqualToString:@"0"]) { |
| 41 | self.title = @"身份校验"; | 44 | self.title = @"身份校验"; |
| 42 | text = @"亲,您未申请个人认证"; | 45 | text = @"亲,您未申请个人认证"; |
| 43 | buttonName = @"去认证"; | 46 | buttonName = @"去认证"; |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPersonalVerificationController.m
| @@ -20,12 +20,14 @@ | @@ -20,12 +20,14 @@ | ||
| 20 | #import "CNBPerAuthSelectTypeModel.h" | 20 | #import "CNBPerAuthSelectTypeModel.h" |
| 21 | #import "CNUserInfoManager.h" | 21 | #import "CNUserInfoManager.h" |
| 22 | #import "CNBPerAuthViewModel.h" | 22 | #import "CNBPerAuthViewModel.h" |
| 23 | +#import "CNBPerCertificationController.h" | ||
| 23 | #define CNBHeaderShowHeight 43 | 24 | #define CNBHeaderShowHeight 43 |
| 24 | #define CNBAffiliationCellIdentifier @"CNBPersonalVerificationCell" | 25 | #define CNBAffiliationCellIdentifier @"CNBPersonalVerificationCell" |
| 25 | #define CNBCircleGroupIdentifier @"CNBCircleGroupCell" | 26 | #define CNBCircleGroupIdentifier @"CNBCircleGroupCell" |
| 26 | #define CNBCircleAddGroupIdentifier @"CNBCircleAddGroupCell" | 27 | #define CNBCircleAddGroupIdentifier @"CNBCircleAddGroupCell" |
| 27 | #define CNBAccountGroupIdentifier @"CNBAccountGroupCell" | 28 | #define CNBAccountGroupIdentifier @"CNBAccountGroupCell" |
| 28 | #define CNBAddAccountGroupIdentifier @"CNBAddAccountGroupCell" | 29 | #define CNBAddAccountGroupIdentifier @"CNBAddAccountGroupCell" |
| 30 | +#define CNBAppKeyWindow ([UIApplication sharedApplication].delegate).window | ||
| 29 | @interface CNBPersonalVerificationController ()<UITableViewDataSource,UITableViewDelegate> | 31 | @interface CNBPersonalVerificationController ()<UITableViewDataSource,UITableViewDelegate> |
| 30 | @property (nonatomic, strong) QMUIButton *promptBtn; //提示View | 32 | @property (nonatomic, strong) QMUIButton *promptBtn; //提示View |
| 31 | @property (nonatomic, strong) UITableView *tableView; | 33 | @property (nonatomic, strong) UITableView *tableView; |
| @@ -48,13 +50,30 @@ | @@ -48,13 +50,30 @@ | ||
| 48 | } | 50 | } |
| 49 | - (void)viewDidLoad { | 51 | - (void)viewDidLoad { |
| 50 | [super viewDidLoad]; | 52 | [super viewDidLoad]; |
| 53 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 51 | self.title = @"填写机构资料"; | 54 | self.title = @"填写机构资料"; |
| 55 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 52 | self.sectionArray = [NSMutableArray array]; | 56 | self.sectionArray = [NSMutableArray array]; |
| 53 | [self addData:@"0" addSection:@"0"]; | 57 | [self addData:@"0" addSection:@"0"]; |
| 54 | [self configUI]; | 58 | [self configUI]; |
| 55 | [self.view addSubview:self.tableView]; | 59 | [self.view addSubview:self.tableView]; |
| 56 | [self.tableView reloadData]; | 60 | [self.tableView reloadData]; |
| 57 | } | 61 | } |
| 62 | +#pragma mark - 移除中间VC | ||
| 63 | +- (void)dismissMiddleVC | ||
| 64 | +{ | ||
| 65 | + if (self.navigationController.viewControllers.count >= 3) { //viewControllers.count大于3 才有中间页面 | ||
| 66 | + NSMutableArray *removeArr = [[NSMutableArray alloc]initWithArray:self.navigationController.viewControllers]; | ||
| 67 | + for (UIViewController *controller in removeArr) { | ||
| 68 | + if ([controller isKindOfClass:[NSClassFromString(@"CNBPerCertificationController") class]] || [controller isKindOfClass:[NSClassFromString(@"CNBPersonalVerificationController") class]]) { | ||
| 69 | + [removeArr removeObject:controller]; | ||
| 70 | + break; | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + self.navigationController.viewControllers = removeArr; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | +} | ||
| 58 | #pragma mark - 开始创建数据 | 77 | #pragma mark - 开始创建数据 |
| 59 | - (void)addData:(NSString *)isDelete addSection:(NSString *)addSection{ | 78 | - (void)addData:(NSString *)isDelete addSection:(NSString *)addSection{ |
| 60 | NSMutableArray *typeArray = [NSMutableArray array]; | 79 | NSMutableArray *typeArray = [NSMutableArray array]; |
| @@ -144,6 +163,7 @@ | @@ -144,6 +163,7 @@ | ||
| 144 | circleCell.typeModel = circleModel; | 163 | circleCell.typeModel = circleModel; |
| 145 | __block NSMutableArray *typeArray = [NSMutableArray arrayWithArray:sectionModel.typeArray]; | 164 | __block NSMutableArray *typeArray = [NSMutableArray arrayWithArray:sectionModel.typeArray]; |
| 146 | circleCell.circleDeleteBlock = ^{ //删除圈子 | 165 | circleCell.circleDeleteBlock = ^{ //删除圈子 |
| 166 | + | ||
| 147 | [typeArray removeObjectAtIndex:indexPath.row]; | 167 | [typeArray removeObjectAtIndex:indexPath.row]; |
| 148 | sectionModel.typeArray = typeArray; | 168 | sectionModel.typeArray = typeArray; |
| 149 | [weakSelf.tableView reloadData]; | 169 | [weakSelf.tableView reloadData]; |
| @@ -221,8 +241,9 @@ | @@ -221,8 +241,9 @@ | ||
| 221 | headerView.backgroundColor = [UIColor whiteColor]; | 241 | headerView.backgroundColor = [UIColor whiteColor]; |
| 222 | __weak typeof(self) weakSelf = self; | 242 | __weak typeof(self) weakSelf = self; |
| 223 | headerView.deleteInstitutionsBlock = ^{ | 243 | headerView.deleteInstitutionsBlock = ^{ |
| 224 | - [weakSelf.sectionArray removeObjectAtIndex:section]; | ||
| 225 | - [weakSelf.tableView reloadData]; | 244 | +// [weakSelf.sectionArray removeObjectAtIndex:section]; |
| 245 | +// [weakSelf.tableView reloadData]; | ||
| 246 | + [weakSelf showDeleteAlertView:NO title:@"确定删除吗" section:section]; | ||
| 226 | }; | 247 | }; |
| 227 | return headerView; | 248 | return headerView; |
| 228 | } | 249 | } |
| @@ -246,13 +267,30 @@ | @@ -246,13 +267,30 @@ | ||
| 246 | return 0.01; | 267 | return 0.01; |
| 247 | } | 268 | } |
| 248 | } | 269 | } |
| 270 | +- (void)showDeleteAlertView:(BOOL)isCircle title:(NSString *)title section:(NSInteger)section { | ||
| 271 | + __weak typeof(self) weakSelf = self; | ||
| 272 | + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert]; | ||
| 273 | + UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { | ||
| 274 | + }]; | ||
| 275 | + UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { | ||
| 276 | + if (!isCircle) { | ||
| 277 | + [weakSelf.sectionArray removeObjectAtIndex:section]; | ||
| 278 | + [weakSelf.tableView reloadData]; | ||
| 279 | + }else { | ||
| 280 | + | ||
| 281 | + } | ||
| 282 | + }]; | ||
| 283 | + [alertController addAction:action1]; | ||
| 284 | + [alertController addAction:action2]; | ||
| 285 | + [self presentViewController:alertController animated:YES completion:nil]; | ||
| 286 | +} | ||
| 249 | #pragma mark -提交数据 | 287 | #pragma mark -提交数据 |
| 250 | - (void)submitData { | 288 | - (void)submitData { |
| 251 | NSMutableDictionary *submitDic = [NSMutableDictionary dictionary]; | 289 | NSMutableDictionary *submitDic = [NSMutableDictionary dictionary]; |
| 252 | NSMutableArray *instritutionArray = [NSMutableArray array]; | 290 | NSMutableArray *instritutionArray = [NSMutableArray array]; |
| 253 | for (CNBAddSectionModel *sectionModel in self.sectionArray) { | 291 | for (CNBAddSectionModel *sectionModel in self.sectionArray) { |
| 254 | if (CNLiveStringIsEmpty(sectionModel.institutionId)) { | 292 | if (CNLiveStringIsEmpty(sectionModel.institutionId)) { |
| 255 | - [QMUITips showWithText:@"请填写机构信息" inView:AppKeyWindow hideAfterDelay:1.5]; | 293 | + [QMUITips showWithText:@"请填写机构信息" inView:CNBAppKeyWindow hideAfterDelay:1.5]; |
| 256 | return ; | 294 | return ; |
| 257 | } | 295 | } |
| 258 | NSMutableDictionary *instritutionDic = [NSMutableDictionary dictionary]; | 296 | NSMutableDictionary *instritutionDic = [NSMutableDictionary dictionary]; |
| @@ -290,11 +328,15 @@ | @@ -290,11 +328,15 @@ | ||
| 290 | 328 | ||
| 291 | NSString *submitStr = [self objectToJson:submitDic]; | 329 | NSString *submitStr = [self objectToJson:submitDic]; |
| 292 | submitStr = [submitStr stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"]; | 330 | submitStr = [submitStr stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"]; |
| 293 | - | 331 | + __weak typeof(self) weakSelf = self; |
| 294 | [CNBPerAuthViewModel submitPerAuthData:submitStr successBlock:^(BOOL isSuccess) { | 332 | [CNBPerAuthViewModel submitPerAuthData:submitStr successBlock:^(BOOL isSuccess) { |
| 295 | NSLog(@"提交数据成功"); | 333 | NSLog(@"提交数据成功"); |
| 296 | - } failureBlock:^(NSError * _Nonnull error) { | 334 | + CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:@{@"checkStatus":@"2"}]; |
| 335 | + [weakSelf.navigationController pushViewController:vc animated:YES]; | ||
| 336 | + [weakSelf dismissMiddleVC]; | ||
| 297 | 337 | ||
| 338 | + } failureBlock:^(NSError * _Nonnull error) { | ||
| 339 | + [QMUITips showWithText:error.localizedDescription inView:CNBAppKeyWindow hideAfterDelay:1.5f]; | ||
| 298 | }]; | 340 | }]; |
| 299 | } | 341 | } |
| 300 | #pragma mark - lazy | 342 | #pragma mark - lazy |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Services/CNBPersonAuthenticationServices.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNBPersonAuthenticationServices.h | ||
| 3 | +// CNLiveBPersonalVerificationModule | ||
| 4 | +// | ||
| 5 | +// Created by 殷巧娟 on 2020/4/18. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <Foundation/Foundation.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNBPersonAuthenticationServices : NSObject | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +NS_ASSUME_NONNULL_END |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Services/CNBPersonAuthenticationServices.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNBPersonAuthenticationServices.m | ||
| 3 | +// CNLiveBPersonalVerificationModule | ||
| 4 | +// | ||
| 5 | +// Created by 殷巧娟 on 2020/4/18. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNBPersonAuthenticationServices.h" | ||
| 9 | +#import <CNLiveBeeHive/BeeHive.h> | ||
| 10 | +#import "CNLiveBPersonAuthentProtocol.h" | ||
| 11 | +#import "CNBPerAuthSuccessController.h" | ||
| 12 | +#import "CNBPerCertificationController.h" | ||
| 13 | +@interface CNBPersonAuthenticationServices ()<CNLiveBPersonAuthentProtocol> | ||
| 14 | + | ||
| 15 | +@end | ||
| 16 | + | ||
| 17 | +@BeeHiveService(CNLiveBPersonAuthentProtocol,CNBPersonAuthenticationServices) | ||
| 18 | +@implementation CNBPersonAuthenticationServices | ||
| 19 | +#pragma mark - 跳到资料认证页面 | ||
| 20 | +- (UIViewController *)pushToPersonalAuthenticationSuccessController:(NSDictionary *)dic { | ||
| 21 | + CNBPerAuthSuccessController *successVc = [[CNBPerAuthSuccessController alloc]initControllerWithParam:dic]; | ||
| 22 | + return successVc; | ||
| 23 | +} | ||
| 24 | +#pragma mark - 跳转到审核中啥的页面 | ||
| 25 | +- (UIViewController *)pushToPersonalCertificationStatusController:(NSDictionary *)dic { | ||
| 26 | + CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:dic]; | ||
| 27 | + return vc; | ||
| 28 | +} | ||
| 29 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthTypeRadioView.m
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | #import "CNBPerAuthManager.h" | 18 | #import "CNBPerAuthManager.h" |
| 19 | #define CNBSelecctIdentifier @"CNBPerAuthTypeRadioCell" | 19 | #define CNBSelecctIdentifier @"CNBPerAuthTypeRadioCell" |
| 20 | #define CNBottomSureBtnHeight 75 | 20 | #define CNBottomSureBtnHeight 75 |
| 21 | +#define CNBAppKeyWindow ([UIApplication sharedApplication].delegate).window | ||
| 21 | @interface CNBPerAuthTypeRadioView ()<UITableViewDelegate,UITableViewDataSource,UIGestureRecognizerDelegate> | 22 | @interface CNBPerAuthTypeRadioView ()<UITableViewDelegate,UITableViewDataSource,UIGestureRecognizerDelegate> |
| 22 | @property (nonatomic, strong) UIView *containerView; | 23 | @property (nonatomic, strong) UIView *containerView; |
| 23 | @property (nonatomic, strong) UIButton *closeBtn; | 24 | @property (nonatomic, strong) UIButton *closeBtn; |
| @@ -177,7 +178,7 @@ | @@ -177,7 +178,7 @@ | ||
| 177 | } | 178 | } |
| 178 | }else { | 179 | }else { |
| 179 | [weakSelf.emptyView removeFromSuperview]; | 180 | [weakSelf.emptyView removeFromSuperview]; |
| 180 | - [QMUITips showWithText:error.localizedDescription inView:AppKeyWindow hideAfterDelay:1.5f]; | 181 | + [QMUITips showWithText:error.localizedDescription inView:CNBAppKeyWindow hideAfterDelay:1.5f]; |
| 181 | } | 182 | } |
| 182 | }]; | 183 | }]; |
| 183 | } | 184 | } |
| @@ -256,11 +257,7 @@ | @@ -256,11 +257,7 @@ | ||
| 256 | - (void)sureBtnAcction { | 257 | - (void)sureBtnAcction { |
| 257 | 258 | ||
| 258 | if (self.sureDataArray.count > 5) { | 259 | if (self.sureDataArray.count > 5) { |
| 259 | - [QMUITips showWithText:@"您最多只能选择5个群组" inView:AppKeyWindow hideAfterDelay:1.5f]; | ||
| 260 | - return; | ||
| 261 | - } | ||
| 262 | - if (self.sureDataArray.count == 0) { | ||
| 263 | - [QMUITips showWithText:@"您还没有选择群组" inView:AppKeyWindow hideAfterDelay:1.5]; | 260 | + [QMUITips showWithText:@"您最多只能选择5个群组" inView:CNBAppKeyWindow hideAfterDelay:1.5f]; |
| 264 | return; | 261 | return; |
| 265 | } | 262 | } |
| 266 | if (self.multiSelectBlock) { | 263 | if (self.multiSelectBlock) { |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPersonalVerificationCell.m
| @@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
| 15 | #import "CNBPerAuthShowView.h" | 15 | #import "CNBPerAuthShowView.h" |
| 16 | #import "CNBPerAuthTypeRadioView.h" | 16 | #import "CNBPerAuthTypeRadioView.h" |
| 17 | #import "CNBPerAuthManager.h" | 17 | #import "CNBPerAuthManager.h" |
| 18 | +#define CNBAppKeyWindow ([UIApplication sharedApplication].delegate).window | ||
| 18 | @interface CNBPersonalVerificationCell ()<UITextFieldDelegate> | 19 | @interface CNBPersonalVerificationCell ()<UITextFieldDelegate> |
| 19 | @property (nonatomic, strong) UIImageView *logoImageV; //是不是必须的标识 | 20 | @property (nonatomic, strong) UIImageView *logoImageV; //是不是必须的标识 |
| 20 | @property (nonatomic, strong) UILabel *titleLabel; //标题 | 21 | @property (nonatomic, strong) UILabel *titleLabel; //标题 |
| @@ -249,7 +250,7 @@ static const NSInteger CNBGroupTag = 202; | @@ -249,7 +250,7 @@ static const NSInteger CNBGroupTag = 202; | ||
| 249 | __weak typeof(self) weakSelf = self; | 250 | __weak typeof(self) weakSelf = self; |
| 250 | if (tap.view.tag == CNBCircleTag) { | 251 | if (tap.view.tag == CNBCircleTag) { |
| 251 | if (CNLiveStringIsEmpty(self.spIdStr)) { | 252 | if (CNLiveStringIsEmpty(self.spIdStr)) { |
| 252 | - [QMUITips showWithText:@"请先选择所属机构" inView:AppKeyWindow hideAfterDelay:1.5]; | 253 | + [QMUITips showWithText:@"请先选择所属机构" inView:CNBAppKeyWindow hideAfterDelay:1.5]; |
| 253 | return; | 254 | return; |
| 254 | } | 255 | } |
| 255 | CNBPerAuthTypeRadioView *circleView = [[CNBPerAuthTypeRadioView alloc]initWithSelectType:CNBPerAuthRadioTypeCircle spId:self.spIdStr type:@"" homepageId:@"" typeModel:self.typeModel]; | 256 | CNBPerAuthTypeRadioView *circleView = [[CNBPerAuthTypeRadioView alloc]initWithSelectType:CNBPerAuthRadioTypeCircle spId:self.spIdStr type:@"" homepageId:@"" typeModel:self.typeModel]; |
| @@ -271,11 +272,11 @@ static const NSInteger CNBGroupTag = 202; | @@ -271,11 +272,11 @@ static const NSInteger CNBGroupTag = 202; | ||
| 271 | 272 | ||
| 272 | }else if (tap.view.tag == CNBGroupTag) { //这里是多选 要弹出多选框 | 273 | }else if (tap.view.tag == CNBGroupTag) { //这里是多选 要弹出多选框 |
| 273 | if (CNLiveStringIsEmpty(self.spIdStr)) { | 274 | if (CNLiveStringIsEmpty(self.spIdStr)) { |
| 274 | - [QMUITips showWithText:@"请先选择所属机构" inView:AppKeyWindow hideAfterDelay:1.5]; | 275 | + [QMUITips showWithText:@"请先选择所属机构" inView:CNBAppKeyWindow hideAfterDelay:1.5]; |
| 275 | return; | 276 | return; |
| 276 | } | 277 | } |
| 277 | if (CNLiveStringIsEmpty(self.typeModel.homePageId)) { | 278 | if (CNLiveStringIsEmpty(self.typeModel.homePageId)) { |
| 278 | - [QMUITips showWithText:@"请先选择您的圈子" inView:AppKeyWindow hideAfterDelay:1.5]; | 279 | + [QMUITips showWithText:@"请先选择您的圈子" inView:CNBAppKeyWindow hideAfterDelay:1.5]; |
| 279 | return; | 280 | return; |
| 280 | } | 281 | } |
| 281 | CNBPerAuthTypeRadioView *groupView = [[CNBPerAuthTypeRadioView alloc]initWithSelectType:CNBperAuthRadioTypeMultiGroup spId:@"" type:@"" homepageId:self.typeModel.homePageId typeModel:self.typeModel]; | 282 | CNBPerAuthTypeRadioView *groupView = [[CNBPerAuthTypeRadioView alloc]initWithSelectType:CNBperAuthRadioTypeMultiGroup spId:@"" type:@"" homepageId:self.typeModel.homePageId typeModel:self.typeModel]; |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNBPerAuthViewModel.m
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
| 12 | #import <QMUIKit/QMUIKit.h> | 12 | #import <QMUIKit/QMUIKit.h> |
| 13 | #import "CNBPerCertificationSuccessModel.h" | 13 | #import "CNBPerCertificationSuccessModel.h" |
| 14 | #import "CNLiveBaseKit.h" | 14 | #import "CNLiveBaseKit.h" |
| 15 | +#define CNBAppKeyWindow ([UIApplication sharedApplication].delegate).window | ||
| 15 | @implementation CNBPerAuthViewModel | 16 | @implementation CNBPerAuthViewModel |
| 16 | #pragma mark - 请求机构等列表 | 17 | #pragma mark - 请求机构等列表 |
| 17 | + (void)getPerAuthTypeListWithSpId:(NSString *)spId type:(NSString *)type homepageId:(NSString *)homepageId page:(NSInteger)page selectType:(CNBPerAuthRadioType)selectType successBlock:(void (^)(NSMutableArray *dataSource,NSString *hasNextPage))successBlock failureBlock:(void (^) (NSError *error))failureBlock { | 18 | + (void)getPerAuthTypeListWithSpId:(NSString *)spId type:(NSString *)type homepageId:(NSString *)homepageId page:(NSInteger)page selectType:(CNBPerAuthRadioType)selectType successBlock:(void (^)(NSMutableArray *dataSource,NSString *hasNextPage))successBlock failureBlock:(void (^) (NSError *error))failureBlock { |
| @@ -46,7 +47,7 @@ | @@ -46,7 +47,7 @@ | ||
| 46 | !successBlock ?: successBlock(listArray, isHaveNext); | 47 | !successBlock ?: successBlock(listArray, isHaveNext); |
| 47 | } | 48 | } |
| 48 | }else { | 49 | }else { |
| 49 | - [QMUITips showWithText:errorMessage inView:AppKeyWindow hideAfterDelay:1.5]; | 50 | + [QMUITips showWithText:errorMessage inView:CNBAppKeyWindow hideAfterDelay:1.5]; |
| 50 | } | 51 | } |
| 51 | }else { | 52 | }else { |
| 52 | !failureBlock ? : failureBlock(error); | 53 | !failureBlock ? : failureBlock(error); |
| @@ -69,7 +70,7 @@ | @@ -69,7 +70,7 @@ | ||
| 69 | if ([errorCode isEqualToString:@"0"]) { | 70 | if ([errorCode isEqualToString:@"0"]) { |
| 70 | !successBlock? : successBlock(YES); | 71 | !successBlock? : successBlock(YES); |
| 71 | }else { | 72 | }else { |
| 72 | - [QMUITips showWithText:errorMessage inView:AppKeyWindow hideAfterDelay:1.5f]; | 73 | + [QMUITips showWithText:errorMessage inView:CNBAppKeyWindow hideAfterDelay:1.5f]; |
| 73 | } | 74 | } |
| 74 | } | 75 | } |
| 75 | }else { | 76 | }else { |
| @@ -99,7 +100,7 @@ | @@ -99,7 +100,7 @@ | ||
| 99 | } | 100 | } |
| 100 | !successBlock ? :successBlock(array); | 101 | !successBlock ? :successBlock(array); |
| 101 | }else { | 102 | }else { |
| 102 | - [QMUITips showWithText:errorMessage inView:AppKeyWindow hideAfterDelay:1.5f]; | 103 | + [QMUITips showWithText:errorMessage inView:CNBAppKeyWindow hideAfterDelay:1.5f]; |
| 103 | } | 104 | } |
| 104 | 105 | ||
| 105 | } | 106 | } |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Controller/ApplyForShootController.h
0 → 100644
| 1 | +// | ||
| 2 | +// ApplyForShootController.h | ||
| 3 | +// ApplyForDaren | ||
| 4 | +// | ||
| 5 | +// Created by cnliveJunBo on 2018/1/27. | ||
| 6 | +// Copyright © 2018年 cnliveJunBo. All rights reserved. | ||
| 7 | +// 目击者申请 | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@protocol ApplyForShootControllerDelegate <NSObject> | ||
| 12 | + | ||
| 13 | +- (void)completeRefresh; | ||
| 14 | + | ||
| 15 | +@end | ||
| 16 | + | ||
| 17 | +@interface ApplyForShootController : UIViewController | ||
| 18 | + | ||
| 19 | +@property (nonatomic, weak) id <ApplyForShootControllerDelegate>delegate; | ||
| 20 | + | ||
| 21 | +- (instancetype)initWithIsMineVC:(BOOL)isMineVC; | ||
| 22 | + | ||
| 23 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Controller/ApplyForShootController.m
0 → 100644
| 1 | +// | ||
| 2 | +// ApplyForShootController.m | ||
| 3 | +// ApplyForDaren | ||
| 4 | +// | ||
| 5 | +// Created by cnliveJunBo on 2018/1/27. | ||
| 6 | +// Copyright © 2018年 cnliveJunBo. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "ApplyForShootController.h" | ||
| 10 | +#import <AipOcrSdk/AipOcrSdk.h> | ||
| 11 | +#import <objc/runtime.h> | ||
| 12 | +#import "AFNetworking.h" | ||
| 13 | +#import "ApplyForShootCell.h" | ||
| 14 | +#import "ApplyForConfirmCell.h" | ||
| 15 | +#import <AVFoundation/AVCaptureDevice.h> | ||
| 16 | +#import <AVFoundation/AVMediaFormat.h> | ||
| 17 | +#import <CNLiveRequestBastKit/CNLiveNetworkSessionManager.h> | ||
| 18 | +#import "UIColor+CNLiveExtension.h" | ||
| 19 | +#import "MJExtension.h" | ||
| 20 | +#import "CNLiveBaseKit.h" | ||
| 21 | +#import <QMUIKit/QMUIKit.h> | ||
| 22 | +#import "CNLiveTimeTools.h" | ||
| 23 | +#import "CNLiveBusinessTools.h" | ||
| 24 | +#import "CNUserInfoManager.h" | ||
| 25 | +#import "CNLiveBusinessTools.h" | ||
| 26 | +#import "CNLiveEnvironment.h" | ||
| 27 | +static NSString *shootCellId = @"shootCellId"; | ||
| 28 | +static NSString *confirmCellId = @"confirmCellId"; | ||
| 29 | + | ||
| 30 | +@interface ApplyForShootController ()<UIAlertViewDelegate,UITableViewDelegate,UITableViewDataSource> | ||
| 31 | + | ||
| 32 | +@property (nonatomic, strong) UITableView *tableView; | ||
| 33 | +@property (nonatomic, strong) NSArray <AgreementModel*>*dataArray; | ||
| 34 | + | ||
| 35 | +@property (nonatomic, strong) UIImage *fontImage; | ||
| 36 | +@property (nonatomic, strong) UIImage *backImage; | ||
| 37 | +@property (nonatomic, strong) NSMutableArray *imageDatas; | ||
| 38 | + | ||
| 39 | +@property (nonatomic, copy) NSString *realName; | ||
| 40 | +@property (nonatomic, copy) NSString *idCardNo; | ||
| 41 | + | ||
| 42 | +@property (nonatomic, assign) BOOL isFont; | ||
| 43 | +@property (nonatomic, assign) BOOL isDataSucc; | ||
| 44 | +@property (nonatomic, assign) BOOL isFontSucc; | ||
| 45 | +@property (nonatomic, assign) BOOL isBackSucc; | ||
| 46 | +@property (nonatomic, assign) BOOL isMineVC; //是否是"我的"页面 | ||
| 47 | +@property (nonatomic, assign) BOOL isHandler;//是否监听识别结果 | ||
| 48 | + | ||
| 49 | +@property (nonatomic, strong) ApplyForConfirmCell *confirmCell; | ||
| 50 | + | ||
| 51 | +@end | ||
| 52 | + | ||
| 53 | +@implementation ApplyForShootController { | ||
| 54 | + // 默认的识别成功的回调 | ||
| 55 | + void (^_successHandler)(id); | ||
| 56 | + // 默认的识别失败的回调 | ||
| 57 | + void (^_failHandler)(NSError *); | ||
| 58 | +} | ||
| 59 | + | ||
| 60 | +- (void)viewWillAppear:(BOOL)animated { | ||
| 61 | + [super viewWillAppear:animated]; | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | +- (instancetype)initWithIsMineVC:(BOOL)isMineVC | ||
| 65 | +{ | ||
| 66 | + self = [super init]; | ||
| 67 | + if (self) { | ||
| 68 | + self.isMineVC = isMineVC; | ||
| 69 | + } | ||
| 70 | + return self; | ||
| 71 | +} | ||
| 72 | + | ||
| 73 | +- (void)viewDidLoad { | ||
| 74 | + [super viewDidLoad]; | ||
| 75 | + self.title = @"资质上传"; | ||
| 76 | + self.view.backgroundColor = [UIColor whiteColor]; | ||
| 77 | + self.imageDatas = [NSMutableArray array]; | ||
| 78 | +#pragma mark -warning 这里注释掉了 | ||
| 79 | + [[AipOcrService shardService] authWithAK:BDAppKey andSK:BDSecret]; | ||
| 80 | + [self loadData]; | ||
| 81 | + [self.view addSubview:self.tableView]; | ||
| 82 | +// if (@available(iOS 11, *)) { | ||
| 83 | +// if (self.isViewLoaded) { | ||
| 84 | +// self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | ||
| 85 | +// } | ||
| 86 | +// } else { | ||
| 87 | +// self.automaticallyAdjustsScrollViewInsets = NO; | ||
| 88 | +// } | ||
| 89 | + [self configCallback]; | ||
| 90 | + | ||
| 91 | +} | ||
| 92 | + | ||
| 93 | +- (void)loadData { | ||
| 94 | + | ||
| 95 | + NSArray *array = @[ | ||
| 96 | + @{ | ||
| 97 | + @"shootTitle":@"第一步", | ||
| 98 | + @"shootImage":@"observer_idcard_front", | ||
| 99 | + @"isFront":@"1" | ||
| 100 | + }, | ||
| 101 | + @{ | ||
| 102 | + @"shootTitle":@"第二步", | ||
| 103 | + @"shootImage":@"observer_idcard_back", | ||
| 104 | + @"isFront":@"0" | ||
| 105 | + } | ||
| 106 | + ]; | ||
| 107 | + NSMutableArray *arrayM = [NSMutableArray array]; | ||
| 108 | + for (NSDictionary *dic in array) { | ||
| 109 | + AgreementModel *model = [AgreementModel mj_objectWithKeyValues:dic]; | ||
| 110 | + [arrayM addObject:model]; | ||
| 111 | + } | ||
| 112 | + self.dataArray = arrayM.copy; | ||
| 113 | + [self.tableView reloadData]; | ||
| 114 | + | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +#pragma mark -百度识别回调!!!!!!!!!!!!!!! | ||
| 118 | +- (void)configCallback { | ||
| 119 | + __weak typeof(self) weakSelf = self; | ||
| 120 | + | ||
| 121 | + // 这是默认的识别成功的回调 | ||
| 122 | + _successHandler = ^(id result){ | ||
| 123 | + if (!weakSelf.isHandler) { | ||
| 124 | + return ; | ||
| 125 | + } | ||
| 126 | + weakSelf.isHandler = NO; | ||
| 127 | + NSLog(@">>>>>>>>>>>>>>>>>>>>>>result: %@", result); | ||
| 128 | + NSString *title = @"识别结果"; | ||
| 129 | + NSMutableString *message = [NSMutableString string]; | ||
| 130 | + | ||
| 131 | + if(result[@"words_result"]){ | ||
| 132 | + if([result[@"words_result"] isKindOfClass:[NSDictionary class]]){ ///// 字典 | ||
| 133 | + NSDictionary *dict = result[@"words_result"]; | ||
| 134 | + if (weakSelf.isFont) { ///////// 前 | ||
| 135 | + if ([dict count] < 6) { | ||
| 136 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 137 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:@"照片不规范,信息不全,请重新拍摄" delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 138 | + [alertView show]; | ||
| 139 | + weakSelf.isFontSucc = NO; | ||
| 140 | + NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; | ||
| 141 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 142 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_front"]; | ||
| 143 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 144 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 145 | + }]; | ||
| 146 | + return ; | ||
| 147 | + } | ||
| 148 | + } else { | ||
| 149 | + if ([dict count] < 3) { | ||
| 150 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 151 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:@"照片不规范,信息不全,请重新拍摄" delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 152 | + [alertView show]; | ||
| 153 | + weakSelf.isBackSucc = NO; | ||
| 154 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 155 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 156 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_back"]; | ||
| 157 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 158 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 159 | + }]; | ||
| 160 | + return ; | ||
| 161 | + } else if ([[CNLiveTimeTools getyyMMddStr] integerValue] > [dict[@"失效日期"][@"words"] integerValue] && ![[NSString stringWithFormat:@"%@",dict[@"失效日期"][@"words"]] isEqualToString:@"长期"]) { | ||
| 162 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 163 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:@"身份证已失效,请重新拍摄" delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 164 | + [alertView show]; | ||
| 165 | + weakSelf.isBackSucc = NO; | ||
| 166 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 167 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 168 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_back"]; | ||
| 169 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 170 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 171 | + }]; | ||
| 172 | + return ; | ||
| 173 | + } | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + //创建一个队列 | ||
| 177 | + NSOperationQueue *queue = [[NSOperationQueue alloc] init]; | ||
| 178 | + //可开辟线程的最大数量 | ||
| 179 | + queue.maxConcurrentOperationCount = 2; | ||
| 180 | + | ||
| 181 | + weakSelf.isDataSucc = YES; | ||
| 182 | + //创建两个任务 | ||
| 183 | + NSBlockOperation *operationA = [NSBlockOperation blockOperationWithBlock:^{ | ||
| 184 | + NSLog(@"A任务当前线程为:%@", [NSThread currentThread]); | ||
| 185 | + [dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { | ||
| 186 | + if([obj isKindOfClass:[NSDictionary class]] && [obj objectForKey:@"words"] && ![[obj objectForKey:@"words"] isEqualToString:@""]){ | ||
| 187 | + [message appendFormat:@"%@: %@\n", key, obj[@"words"]]; | ||
| 188 | + }else{ | ||
| 189 | + [message appendFormat:@"%@: %@\n", key, obj]; | ||
| 190 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 191 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:@"照片不规范,获取信息失败,请重新拍摄" delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 192 | + [alertView show]; | ||
| 193 | + weakSelf.isDataSucc = NO; | ||
| 194 | + if (weakSelf.isFont) { | ||
| 195 | + weakSelf.isFontSucc = NO; | ||
| 196 | + NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; | ||
| 197 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 198 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_front"]; | ||
| 199 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 200 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 201 | + } else { | ||
| 202 | + weakSelf.isBackSucc = NO; | ||
| 203 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 204 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 205 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_back"]; | ||
| 206 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 207 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 208 | + } | ||
| 209 | + }]; | ||
| 210 | + *stop = YES; | ||
| 211 | + } | ||
| 212 | + }]; | ||
| 213 | + }]; | ||
| 214 | + | ||
| 215 | + NSBlockOperation *operationB = [NSBlockOperation blockOperationWithBlock:^{ | ||
| 216 | + NSLog(@"B任务当前线程为:%@", [NSThread currentThread]); | ||
| 217 | + dispatch_async(dispatch_get_main_queue(), ^{ | ||
| 218 | + if (!weakSelf.isDataSucc) { | ||
| 219 | + return ; | ||
| 220 | + } | ||
| 221 | + if (weakSelf.isFont) { | ||
| 222 | + weakSelf.realName = dict[@"姓名"][@"words"]; | ||
| 223 | + weakSelf.idCardNo = dict[@"公民身份号码"][@"words"]; | ||
| 224 | + weakSelf.isFontSucc = YES; | ||
| 225 | + | ||
| 226 | + NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; | ||
| 227 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 228 | + cell.imgV.image = weakSelf.fontImage; | ||
| 229 | + if (weakSelf.isBackSucc) { | ||
| 230 | + weakSelf.confirmCell.confirmButton.backgroundColor = CNLiveColorWithHexString(@"#23D41E"); | ||
| 231 | + [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal]; | ||
| 232 | + } | ||
| 233 | + } else { | ||
| 234 | + weakSelf.isBackSucc = YES; | ||
| 235 | + | ||
| 236 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 237 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 238 | + cell.imgV.image = weakSelf.backImage; | ||
| 239 | + if (weakSelf.isFontSucc) { | ||
| 240 | + weakSelf.confirmCell.confirmButton.backgroundColor = CNLiveColorWithHexString(@"#23D41E"); | ||
| 241 | + [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal]; | ||
| 242 | + } | ||
| 243 | + } | ||
| 244 | + [weakSelf dismissViewControllerAnimated:YES completion:nil]; | ||
| 245 | + }); | ||
| 246 | + }]; | ||
| 247 | + | ||
| 248 | + // operationB 任务依赖于 operationA | ||
| 249 | + [operationB addDependency:operationA]; | ||
| 250 | + | ||
| 251 | + //添加操作到队列中(自动异步执行任务,并发) | ||
| 252 | + [queue addOperation:operationA]; | ||
| 253 | + [queue addOperation:operationB]; | ||
| 254 | + | ||
| 255 | + }else if([result[@"words_result"] isKindOfClass:[NSArray class]]){ //////有可能是 数组 | ||
| 256 | + NSArray *array = result[@"words_result"]; | ||
| 257 | + if (weakSelf.isFont) { | ||
| 258 | + if ([array count] < 6) { | ||
| 259 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 260 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:@"照片不规范,信息不全,请重新拍摄" delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 261 | + [alertView show]; | ||
| 262 | + weakSelf.isFontSucc = NO; | ||
| 263 | + NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; | ||
| 264 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 265 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_front"]; | ||
| 266 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 267 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 268 | + }]; | ||
| 269 | + return ; | ||
| 270 | + } | ||
| 271 | + } else { | ||
| 272 | + if ([array count] < 3) { | ||
| 273 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 274 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:@"照片不规范,信息不全,请重新拍摄" delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 275 | + [alertView show]; | ||
| 276 | + weakSelf.isBackSucc = NO; | ||
| 277 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 278 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 279 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_back"]; | ||
| 280 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 281 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 282 | + }]; | ||
| 283 | + return ; | ||
| 284 | + } | ||
| 285 | + } | ||
| 286 | + weakSelf.isDataSucc = YES; | ||
| 287 | + for(NSDictionary *obj in result[@"words_result"]){ | ||
| 288 | + if([obj isKindOfClass:[NSDictionary class]] && [obj objectForKey:@"words"] && ![[obj objectForKey:@"words"] isEqualToString:@""]){ | ||
| 289 | + [message appendFormat:@"%@\n", obj[@"words"]]; | ||
| 290 | + }else{ | ||
| 291 | + [message appendFormat:@"%@\n", obj]; | ||
| 292 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 293 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:@"照片不规范,信息获取失败,请重新拍摄" delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 294 | + [alertView show]; | ||
| 295 | + weakSelf.isDataSucc = NO; | ||
| 296 | + if (weakSelf.isFont) { | ||
| 297 | + weakSelf.isFontSucc = NO; | ||
| 298 | + NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; | ||
| 299 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 300 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_front"]; | ||
| 301 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 302 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 303 | + } else { | ||
| 304 | + weakSelf.isBackSucc = NO; | ||
| 305 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 306 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 307 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_back"]; | ||
| 308 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 309 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 310 | + } | ||
| 311 | + }]; | ||
| 312 | + return ; | ||
| 313 | + } | ||
| 314 | + } | ||
| 315 | + dispatch_async(dispatch_get_main_queue(), ^{ | ||
| 316 | + if (!weakSelf.isDataSucc) { | ||
| 317 | + return ; | ||
| 318 | + } | ||
| 319 | + if (weakSelf.isFont) { | ||
| 320 | + weakSelf.isFontSucc = YES; | ||
| 321 | + for(NSDictionary *obj in array) { | ||
| 322 | + [obj enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { | ||
| 323 | + if ([key isEqualToString:@"姓名"]) { | ||
| 324 | + weakSelf.realName = obj[@"姓名"][@"words"]; | ||
| 325 | + }else if ([key isEqualToString:@"公民身份号码"]){ | ||
| 326 | + weakSelf.idCardNo = obj[@"公民身份号码"][@"words"]; | ||
| 327 | + } | ||
| 328 | + }]; | ||
| 329 | + } | ||
| 330 | + | ||
| 331 | + NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; | ||
| 332 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 333 | + cell.imgV.image = weakSelf.fontImage; | ||
| 334 | + if (weakSelf.isBackSucc) { | ||
| 335 | + weakSelf.confirmCell.confirmButton.backgroundColor = CNLiveColorWithHexString(@"#23D41E"); | ||
| 336 | + [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal]; | ||
| 337 | + } | ||
| 338 | + } else { | ||
| 339 | + weakSelf.isBackSucc = YES; | ||
| 340 | + | ||
| 341 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 342 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 343 | + cell.imgV.image = weakSelf.backImage; | ||
| 344 | + if (weakSelf.isFontSucc) { | ||
| 345 | + weakSelf.confirmCell.confirmButton.backgroundColor = CNLiveColorWithHexString(@"#23D41E"); | ||
| 346 | + [weakSelf.confirmCell.confirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal]; | ||
| 347 | + } | ||
| 348 | + } | ||
| 349 | + [weakSelf dismissViewControllerAnimated:YES completion:nil]; | ||
| 350 | + }); | ||
| 351 | + | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + }else{ | ||
| 355 | + [message appendFormat:@"%@", result]; | ||
| 356 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 357 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:@"照片识别失败,请重试" delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 358 | + [alertView show]; | ||
| 359 | + if (weakSelf.isFont) { | ||
| 360 | + weakSelf.isFontSucc = NO; | ||
| 361 | + NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; | ||
| 362 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 363 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_front"]; | ||
| 364 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 365 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 366 | + } else { | ||
| 367 | + weakSelf.isBackSucc = NO; | ||
| 368 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 369 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 370 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_back"]; | ||
| 371 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 372 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 373 | + } | ||
| 374 | + }]; | ||
| 375 | + } | ||
| 376 | + }; | ||
| 377 | + | ||
| 378 | + _failHandler = ^(NSError *error){ | ||
| 379 | + if (!weakSelf.isHandler) { | ||
| 380 | + return ; | ||
| 381 | + } | ||
| 382 | + weakSelf.isHandler = NO; | ||
| 383 | + NSString *msg = [NSString stringWithFormat:@"%li:%@", (long)[error code], [error localizedDescription]]; | ||
| 384 | + NSLog(@">>>>>>>>>>>>>>>>>>>>>>error:%@==msg:%@", error,msg); | ||
| 385 | + NSString *errorMsg; | ||
| 386 | + if ((long)[error code]==283504) { | ||
| 387 | + errorMsg = @"网络请求失败,请稍后再试"; | ||
| 388 | + } else { | ||
| 389 | + errorMsg = @"识别失败,请重拍"; | ||
| 390 | + } | ||
| 391 | + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ | ||
| 392 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"识别结果" message:[NSString stringWithFormat:@"%@",errorMsg] delegate:weakSelf cancelButtonTitle:@"确定" otherButtonTitles:nil]; | ||
| 393 | + [alertView show]; | ||
| 394 | + if (weakSelf.isFont) { | ||
| 395 | + weakSelf.isFontSucc = NO; | ||
| 396 | + NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; | ||
| 397 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 398 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_front"]; | ||
| 399 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 400 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 401 | + } else { | ||
| 402 | + weakSelf.isBackSucc = NO; | ||
| 403 | + NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; | ||
| 404 | + ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; | ||
| 405 | + cell.imgV.image = [UIImage imageNamed:@"observer_idcard_back"]; | ||
| 406 | + weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); | ||
| 407 | + [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; | ||
| 408 | + } | ||
| 409 | + }]; | ||
| 410 | + }; | ||
| 411 | +} | ||
| 412 | + | ||
| 413 | +#pragma mark - 调用百度SDK 拍照Action !!!!!!!!!!!!!!!! | ||
| 414 | +- (void)takePhoto:(BOOL)isFront { | ||
| 415 | + | ||
| 416 | + self.isHandler = YES; | ||
| 417 | + AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; | ||
| 418 | + if (authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied) | ||
| 419 | + { | ||
| 420 | + //无权限 | ||
| 421 | + NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; | ||
| 422 | + | ||
| 423 | + NSString *appName = [infoDictionary objectForKey:@"CFBundleDisplayName"]; | ||
| 424 | + if (appName == nil) | ||
| 425 | + { | ||
| 426 | + appName = @"APP"; | ||
| 427 | + } | ||
| 428 | +// NSString *errorStr = @"无相机权限,请在设置中启用"; | ||
| 429 | + NSString *message = [NSString stringWithFormat:@"请在iPhone的“设置-隐私”选项中,允许%@访问你的相机。", appName]; | ||
| 430 | + | ||
| 431 | + UIAlertController *actionAlert = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert]; | ||
| 432 | +// UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"去设置" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { | ||
| 433 | +// // 引导去设置 | ||
| 434 | +// NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; | ||
| 435 | +// if ([[UIApplication sharedApplication]canOpenURL:url]) { | ||
| 436 | +// [[UIApplication sharedApplication]openURL:url]; | ||
| 437 | +// } | ||
| 438 | +// }]; | ||
| 439 | + UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleCancel handler:NULL]; | ||
| 440 | + [actionAlert addAction:action2]; | ||
| 441 | +// [actionAlert addAction:action1]; | ||
| 442 | + [self presentViewController:actionAlert animated:YES completion:nil]; | ||
| 443 | + | ||
| 444 | +// [QMUITips showError:errorStr inView:self.view hideAfterDelay:1.5f]; | ||
| 445 | + return; | ||
| 446 | + } | ||
| 447 | + | ||
| 448 | + if (isFront) { | ||
| 449 | + _isFont = YES; | ||
| 450 | + UIViewController * vc = | ||
| 451 | + [AipCaptureCardVC ViewControllerWithCardType:CardTypeIdCardFont | ||
| 452 | + andImageHandler:^(UIImage *image) { | ||
| 453 | + | ||
| 454 | + self.fontImage = image; | ||
| 455 | + [[AipOcrService shardService] detectIdCardFrontFromImage:image | ||
| 456 | + withOptions:nil | ||
| 457 | + successHandler:_successHandler | ||
| 458 | + failHandler:_failHandler]; | ||
| 459 | + }]; | ||
| 460 | + | ||
| 461 | + [self presentViewController:vc animated:YES completion:nil]; | ||
| 462 | + | ||
| 463 | + } else if (!isFront) { | ||
| 464 | + | ||
| 465 | + _isFont = NO; | ||
| 466 | + UIViewController * vc = | ||
| 467 | + [AipCaptureCardVC ViewControllerWithCardType:CardTypeIdCardBack | ||
| 468 | + andImageHandler:^(UIImage *image) { | ||
| 469 | + | ||
| 470 | + self.backImage = image; | ||
| 471 | + [[AipOcrService shardService] detectIdCardBackFromImage:image | ||
| 472 | + withOptions:nil | ||
| 473 | + successHandler:_successHandler | ||
| 474 | + failHandler:_failHandler]; | ||
| 475 | + }]; | ||
| 476 | + [self presentViewController:vc animated:YES completion:nil]; | ||
| 477 | + } | ||
| 478 | +} | ||
| 479 | + | ||
| 480 | +#pragma mark - 测试版点击图片传假图片 | ||
| 481 | +- (void)takeTestPhoto:(BOOL)isFront { | ||
| 482 | + NSLog(@"测试版点击图片传假图片"); | ||
| 483 | +} | ||
| 484 | + | ||
| 485 | +#pragma mark - | ||
| 486 | +#pragma mark - 提交 Action !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| 487 | +- (void)submit:(UIButton *)sender { | ||
| 488 | + | ||
| 489 | + sender.selected = !sender.selected; | ||
| 490 | + sender.userInteractionEnabled = NO; | ||
| 491 | + | ||
| 492 | + ///////////////////////////////////////////////测试 | ||
| 493 | +// self.realName = @"李五"; | ||
| 494 | +// self.idCardNo = @"370404199205160035"; | ||
| 495 | +// self.isFontSucc = YES; | ||
| 496 | +// self.isBackSucc = YES; | ||
| 497 | +// self.fontImage = [UIImage imageNamed:@"dl_shibai"]; | ||
| 498 | +// self.backImage = [UIImage imageNamed:@"dl_shibai"]; | ||
| 499 | + ///////////////////////////////////////////////测试 | ||
| 500 | + | ||
| 501 | + | ||
| 502 | + if (!self.isFontSucc) { | ||
| 503 | + sender.selected = !sender.selected; | ||
| 504 | + sender.userInteractionEnabled = YES; | ||
| 505 | + [QMUITips showWithText:@"请上传证件照片(前)" inView:self.view hideAfterDelay:1.5]; | ||
| 506 | + return; | ||
| 507 | + } else if (!self.isBackSucc) { | ||
| 508 | + sender.selected = !sender.selected; | ||
| 509 | + sender.userInteractionEnabled = YES; | ||
| 510 | + [QMUITips showWithText:@"请上传证件照片(后)" inView:self.view hideAfterDelay:1.5]; | ||
| 511 | + return; | ||
| 512 | + } | ||
| 513 | + | ||
| 514 | + NSMutableDictionary *idCardObvDic = [NSMutableDictionary dictionaryWithCapacity:2]; | ||
| 515 | + [idCardObvDic setObject:[NSString stringWithFormat:@"%.0f",self.fontImage.size.width] forKey:@"imageWidth"]; | ||
| 516 | + [idCardObvDic setObject:[NSString stringWithFormat:@"%.0f",self.fontImage.size.height] forKey:@"imageHeight"]; | ||
| 517 | + NSString *idCardObvInfo = [self convertToJsonData:idCardObvDic]; | ||
| 518 | + | ||
| 519 | + NSMutableDictionary *idCardRevDic = [NSMutableDictionary dictionaryWithCapacity:2]; | ||
| 520 | + [idCardRevDic setObject:[NSString stringWithFormat:@"%.0f",self.backImage.size.width] forKey:@"imageWidth"]; | ||
| 521 | + [idCardRevDic setObject:[NSString stringWithFormat:@"%.0f",self.backImage.size.height] forKey:@"imageHeight"]; | ||
| 522 | + NSString *idCardRevInfo = [self convertToJsonData:idCardRevDic]; | ||
| 523 | + | ||
| 524 | +// NSLog(@"%@---%@",idCardObvInfo,idCardRevInfo); | ||
| 525 | + | ||
| 526 | + NSMutableDictionary *params = [@{ | ||
| 527 | + @"witSid" : CNUserShareModel.uid, | ||
| 528 | + @"realName" : self.realName, | ||
| 529 | + @"idCardNo" : self.idCardNo, | ||
| 530 | + @"mobile" : CNUserShareModel.mobile, | ||
| 531 | + @"idCardObvInfo" : idCardObvInfo ? idCardObvInfo : @"", | ||
| 532 | + @"idCardRevInfo" : idCardRevInfo ? idCardRevInfo : @"" | ||
| 533 | + } mutableCopy]; | ||
| 534 | + | ||
| 535 | + NSMutableDictionary *para = [CNLiveBusinessTools encryptionSignWithParameter:[NSMutableDictionary dictionaryWithDictionary:params] encryptionKey:APPKey]; | ||
| 536 | + | ||
| 537 | + __weak typeof(self) weakSelf = self; | ||
| 538 | + AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; | ||
| 539 | + [manager POST:CNApplyWitnessUrl parameters:para headers:nil constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) { | ||
| 540 | + | ||
| 541 | + NSData *fontData = [weakSelf imageDatasWithImage:self.fontImage]; | ||
| 542 | + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; | ||
| 543 | + formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss:SSS"; | ||
| 544 | + NSString *fileName = [NSString stringWithFormat:@"%@%@.png",[formatter stringFromDate:[NSDate date]],@(1)]; | ||
| 545 | + if (fontData) { | ||
| 546 | + [formData appendPartWithFileData:fontData name:[NSString stringWithFormat:@"idCardObv"] fileName:fileName mimeType:@"image/png"]; // mimeType: image/jpg,image/png | ||
| 547 | + } | ||
| 548 | + | ||
| 549 | + NSData *backData = [weakSelf imageDatasWithImage:self.backImage]; | ||
| 550 | + NSString *fileName2 = [NSString stringWithFormat:@"%@%@.png",[formatter stringFromDate:[NSDate date]],@(2)]; | ||
| 551 | + if (backData) { | ||
| 552 | + [formData appendPartWithFileData:backData name:[NSString stringWithFormat:@"idCardRev"] fileName:fileName2 mimeType:@"image/png"]; // mimeType: image/jpg,image/png | ||
| 553 | + } | ||
| 554 | + | ||
| 555 | + } progress:^(NSProgress * _Nonnull uploadProgress) { | ||
| 556 | + | ||
| 557 | + } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { | ||
| 558 | + | ||
| 559 | + NSLog(@"%@-提示信息:%@",responseObject,responseObject[@"errorMessage"]); | ||
| 560 | + | ||
| 561 | + if ([[NSString stringWithFormat:@"%@",responseObject[@"errorCode"]] isEqualToString:@"0"]) { | ||
| 562 | + | ||
| 563 | + NSDictionary *data = [NSDictionary dictionaryWithDictionary:responseObject[@"data"]]; | ||
| 564 | + NSString *reviewStatus = [NSString stringWithFormat:@"%@",data[@"reviewStatus"]];//0-申请成功审核中,1-审核失败(可再次申请),2审核成功(已成为目击者) | ||
| 565 | + if ([reviewStatus isEqualToString:@"0"]) { | ||
| 566 | + dispatch_async(dispatch_get_main_queue(), ^{ | ||
| 567 | +// CNApplyStatusController *statusVC = [[CNApplyStatusController alloc] initWithType:AuditStatusTypeAppling]; | ||
| 568 | +// statusVC.applyStatusVCDelegate = weakSelf; | ||
| 569 | +// [[AppDelegate sharedAppDelegate] pushViewController:statusVC withBackTitle:@" "]; | ||
| 570 | + if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(completeRefresh)]) { | ||
| 571 | + [weakSelf.delegate completeRefresh]; | ||
| 572 | + } | ||
| 573 | + [weakSelf backAction]; | ||
| 574 | + }); | ||
| 575 | + } else if ([reviewStatus isEqualToString:@"1"]) { | ||
| 576 | + dispatch_async(dispatch_get_main_queue(), ^{ | ||
| 577 | +// CNApplyStatusController *statusVC = [[CNApplyStatusController alloc] initWithType:AuditStatusTypeApplyFailed]; | ||
| 578 | +// statusVC.applyStatusVCDelegate = weakSelf; | ||
| 579 | +// [[AppDelegate sharedAppDelegate] pushViewController:statusVC withBackTitle:@" "]; | ||
| 580 | + if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(completeRefresh)]) { | ||
| 581 | + [weakSelf.delegate completeRefresh]; | ||
| 582 | + } | ||
| 583 | + [weakSelf backAction]; | ||
| 584 | + }); | ||
| 585 | + } else if ([reviewStatus isEqualToString:@"2"]) { | ||
| 586 | + dispatch_async(dispatch_get_main_queue(), ^{ | ||
| 587 | +// CNApplyStatusController *statusVC = [[CNApplyStatusController alloc] initWithType:AuditStatusTypeAppling]; | ||
| 588 | +// statusVC.applyStatusVCDelegate = weakSelf; | ||
| 589 | +// [[AppDelegate sharedAppDelegate] pushViewController:statusVC withBackTitle:@" "]; | ||
| 590 | + if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(completeRefresh)]) { | ||
| 591 | + [weakSelf.delegate completeRefresh]; | ||
| 592 | + } | ||
| 593 | + [weakSelf backAction]; | ||
| 594 | + }); | ||
| 595 | + } else { | ||
| 596 | + | ||
| 597 | + sender.selected = !sender.selected; | ||
| 598 | + sender.userInteractionEnabled = YES; | ||
| 599 | + [QMUITips showError:responseObject[@"errorMessage"] inView:self.view hideAfterDelay:1.5]; | ||
| 600 | + } | ||
| 601 | + | ||
| 602 | + } else {//接口失败 | ||
| 603 | + | ||
| 604 | + sender.selected = !sender.selected; | ||
| 605 | + sender.userInteractionEnabled = YES; | ||
| 606 | + [QMUITips showError:responseObject[@"errorMessage"] inView:self.view hideAfterDelay:1.5]; | ||
| 607 | + } | ||
| 608 | + | ||
| 609 | + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { | ||
| 610 | + | ||
| 611 | + sender.selected = !sender.selected; | ||
| 612 | + sender.userInteractionEnabled = YES; | ||
| 613 | + [QMUITips showError:error.localizedDescription inView:self.view hideAfterDelay:1.5]; | ||
| 614 | + | ||
| 615 | + }]; | ||
| 616 | +} | ||
| 617 | + | ||
| 618 | +#pragma mark - CNApplyStatusVCDelegate !!!!!!!!!!!! | ||
| 619 | +- (void)statusVCBackRefreshH5WitnessStatus { | ||
| 620 | + if (self.delegate && [self.delegate respondsToSelector:@selector(completeRefresh)]) { | ||
| 621 | + [self.delegate completeRefresh]; | ||
| 622 | + } | ||
| 623 | +} | ||
| 624 | + | ||
| 625 | +#pragma mark - Action !!!!!!!!!!!!!!!!!!! | ||
| 626 | +- (void)backAction | ||
| 627 | +{ | ||
| 628 | +// if (self.delegate && [self.delegate respondsToSelector:@selector(completeRefresh)]) { | ||
| 629 | +// [self.delegate completeRefresh]; | ||
| 630 | +// } | ||
| 631 | +// [[AppDelegate sharedAppDelegate] popToRootViewController]; | ||
| 632 | + [self.navigationController popViewControllerAnimated:YES]; | ||
| 633 | +} | ||
| 634 | + | ||
| 635 | +- (BOOL)shouldPopViewControllerByBackButtonOrPopGesture:(BOOL)byPopGesture { | ||
| 636 | + | ||
| 637 | + [self backAction]; | ||
| 638 | + return NO; | ||
| 639 | +} | ||
| 640 | + | ||
| 641 | +#pragma mark - Image 转 Data !!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| 642 | +- (NSData *)imageDatasWithImage:(UIImage *)image { | ||
| 643 | + | ||
| 644 | + NSData *imageData; | ||
| 645 | + if (UIImagePNGRepresentation(image) != nil) { | ||
| 646 | + imageData = UIImagePNGRepresentation(image); | ||
| 647 | + }else{ | ||
| 648 | + imageData = UIImageJPEGRepresentation(image, 1.0); | ||
| 649 | + } | ||
| 650 | + return imageData; | ||
| 651 | +} | ||
| 652 | + | ||
| 653 | +#pragma mark - UITableViewDataSource | ||
| 654 | +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | ||
| 655 | + return 1; | ||
| 656 | +} | ||
| 657 | + | ||
| 658 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | ||
| 659 | + return 3; | ||
| 660 | +} | ||
| 661 | + | ||
| 662 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
| 663 | + | ||
| 664 | + if (indexPath.row == 0 || indexPath.row == 1) { | ||
| 665 | + AgreementModel *model = self.dataArray[indexPath.row]; | ||
| 666 | + ApplyForShootCell *cell = [tableView dequeueReusableCellWithIdentifier:shootCellId forIndexPath:indexPath]; | ||
| 667 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 668 | + cell.model = model; | ||
| 669 | + __weak __typeof(self)weakSelf = self; | ||
| 670 | + cell.clickShootBtnBlock = ^() { | ||
| 671 | + [weakSelf takePhoto:model.isFront]; | ||
| 672 | + }; | ||
| 673 | + return cell; | ||
| 674 | + | ||
| 675 | + } else { | ||
| 676 | + ApplyForConfirmCell *cell = [tableView dequeueReusableCellWithIdentifier:confirmCellId forIndexPath:indexPath]; | ||
| 677 | + cell.selectionStyle = UITableViewCellSelectionStyleNone; | ||
| 678 | + AgreementModel *model = [[AgreementModel alloc] init]; | ||
| 679 | + model.confirmTitle = @"提交"; | ||
| 680 | + cell.model = model; | ||
| 681 | + __weak __typeof(self)weakSelf = self; | ||
| 682 | + cell.clickBtnBlock = ^(UIButton *btn){ | ||
| 683 | + [weakSelf submit:btn]; | ||
| 684 | + }; | ||
| 685 | + self.confirmCell = cell; | ||
| 686 | + return cell; | ||
| 687 | + } | ||
| 688 | + | ||
| 689 | +} | ||
| 690 | + | ||
| 691 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
| 692 | + if (indexPath.row==0 || indexPath.row==1) { | ||
| 693 | + return 256; | ||
| 694 | + } else { | ||
| 695 | + if (kNavigationBarHeight+256*2+145<KScreenHeight) { | ||
| 696 | + return KScreenHeight-kNavigationBarHeight-256*2; | ||
| 697 | + } else { | ||
| 698 | + return 145; | ||
| 699 | + } | ||
| 700 | + } | ||
| 701 | +} | ||
| 702 | + | ||
| 703 | +#pragma mark UIAlertViewDelegate | ||
| 704 | +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { | ||
| 705 | + [self dismissViewControllerAnimated:YES completion:nil]; | ||
| 706 | +} | ||
| 707 | + | ||
| 708 | + | ||
| 709 | +#pragma mark - RunTime | ||
| 710 | +- (void)mockBundlerIdForTest { | ||
| 711 | +#pragma clang diagnostic push | ||
| 712 | +#pragma clang diagnostic ignored "-Wundeclared-selector" | ||
| 713 | + [self mockClass:[NSBundle class] originalFunction:@selector(bundleIdentifier) swizzledFunction:@selector(sapicamera_bundleIdentifier)]; | ||
| 714 | +#pragma clang diagnostic pop | ||
| 715 | +} | ||
| 716 | + | ||
| 717 | +- (void)mockClass:(Class)class originalFunction:(SEL)originalSelector swizzledFunction:(SEL)swizzledSelector { | ||
| 718 | + | ||
| 719 | + Method originalMethod = class_getInstanceMethod(class, originalSelector); | ||
| 720 | + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); | ||
| 721 | + | ||
| 722 | + BOOL didAddMethod = class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); | ||
| 723 | + | ||
| 724 | + if (didAddMethod) { | ||
| 725 | + class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); | ||
| 726 | + } else { | ||
| 727 | + method_exchangeImplementations(originalMethod, swizzledMethod); | ||
| 728 | + } | ||
| 729 | + | ||
| 730 | +} | ||
| 731 | +#pragma mark - SubViews | ||
| 732 | +-(UITableView *)tableView { | ||
| 733 | + if (!_tableView) { | ||
| 734 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight-(self.isMineVC?kNavigationBarHeight:0)) style:UITableViewStylePlain]; | ||
| 735 | + _tableView.backgroundColor = RGB(242, 242, 242); | ||
| 736 | + [_tableView registerClass:[ApplyForShootCell class] forCellReuseIdentifier:shootCellId]; | ||
| 737 | + [_tableView registerClass:[ApplyForConfirmCell class] forCellReuseIdentifier:confirmCellId]; | ||
| 738 | + _tableView.delegate = self; | ||
| 739 | + _tableView.dataSource = self; | ||
| 740 | + _tableView.separatorStyle = NO; | ||
| 741 | + _tableView.showsVerticalScrollIndicator = NO; | ||
| 742 | + _tableView.showsHorizontalScrollIndicator = NO; | ||
| 743 | + } | ||
| 744 | + return _tableView; | ||
| 745 | +} | ||
| 746 | + | ||
| 747 | +- (void)didReceiveMemoryWarning { | ||
| 748 | + [super didReceiveMemoryWarning]; | ||
| 749 | + // Dispose of any resources that can be recreated. | ||
| 750 | +} | ||
| 751 | + | ||
| 752 | +- (void)dealloc { | ||
| 753 | + NSLog(@"dealloc ==> ApplyForShootController"); | ||
| 754 | +} | ||
| 755 | + | ||
| 756 | +// 字典转json字符串方法 | ||
| 757 | + | ||
| 758 | +- (NSString *)convertToJsonData:(NSDictionary *)dict | ||
| 759 | +{ | ||
| 760 | + NSError *error; | ||
| 761 | + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:&error]; | ||
| 762 | + | ||
| 763 | + NSString *jsonString; | ||
| 764 | + if (!jsonData) { | ||
| 765 | + NSLog(@"%@",error); | ||
| 766 | + }else{ | ||
| 767 | + jsonString = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding]; | ||
| 768 | + } | ||
| 769 | + | ||
| 770 | + NSMutableString *mutStr = [NSMutableString stringWithString:jsonString]; | ||
| 771 | + NSRange range = {0,jsonString.length}; | ||
| 772 | + //去掉字符串中的空格 | ||
| 773 | + [mutStr replaceOccurrencesOfString:@" " withString:@"" options:NSLiteralSearch range:range]; | ||
| 774 | + | ||
| 775 | + NSRange range2 = {0,mutStr.length}; | ||
| 776 | + //去掉字符串中的换行符 | ||
| 777 | + [mutStr replaceOccurrencesOfString:@"\n" withString:@"" options:NSLiteralSearch range:range2]; | ||
| 778 | + return mutStr; | ||
| 779 | + | ||
| 780 | +} | ||
| 781 | + | ||
| 782 | +/* | ||
| 783 | +#pragma mark - Navigation | ||
| 784 | + | ||
| 785 | +// In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 786 | +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
| 787 | + // Get the new view controller using [segue destinationViewController]. | ||
| 788 | + // Pass the selected object to the new view controller. | ||
| 789 | +} | ||
| 790 | +*/ | ||
| 791 | + | ||
| 792 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Model/AgreementModel.h
0 → 100644
| 1 | +// | ||
| 2 | +// AgreementModel.h | ||
| 3 | +// ApplyForDaren | ||
| 4 | +// | ||
| 5 | +// Created by cnliveJunBo on 2018/1/25. | ||
| 6 | +// Copyright © 2018年 cnliveJunBo. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | +@interface AgreementModel : NSObject | ||
| 12 | + | ||
| 13 | +@property (nonatomic, copy) NSString *confirmTitle; | ||
| 14 | +#pragma mark -拍摄 | ||
| 15 | +@property (nonatomic, copy) NSString *shootTitle; | ||
| 16 | +@property (nonatomic, copy) NSString *shootImage; | ||
| 17 | +@property (nonatomic, assign) BOOL isFront; | ||
| 18 | + | ||
| 19 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Model/AgreementModel.m
0 → 100644
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Services/CNBPersonalAuthenticationService.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNBPersonalAuthenticationService.h | ||
| 3 | +// CNLiveBPersonalVerificationModule | ||
| 4 | +// | ||
| 5 | +// Created by 殷巧娟 on 2020/4/17. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <Foundation/Foundation.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNBPersonalAuthenticationService : NSObject | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +NS_ASSUME_NONNULL_END |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Services/CNBPersonalAuthenticationService.m
0 → 100644
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/ApplyForConfirmCell.h
0 → 100644
| 1 | +// | ||
| 2 | +// ApplyForConfirmCell.h | ||
| 3 | +// ApplyForDaren | ||
| 4 | +// | ||
| 5 | +// Created by cnliveJunBo on 2018/1/27. | ||
| 6 | +// Copyright © 2018年 cnliveJunBo. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | +#import "AgreementModel.h" | ||
| 11 | + | ||
| 12 | +@interface ApplyForConfirmCell : UITableViewCell | ||
| 13 | + | ||
| 14 | +@property (nonatomic, strong) AgreementModel *model; | ||
| 15 | + | ||
| 16 | +@property (nonatomic, strong) UIButton *confirmButton; | ||
| 17 | + | ||
| 18 | +@property (nonatomic, copy) void(^clickBtnBlock)(UIButton *btn); | ||
| 19 | + | ||
| 20 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/ApplyForConfirmCell.m
0 → 100644
| 1 | +// | ||
| 2 | +// ApplyForConfirmCell.m | ||
| 3 | +// ApplyForDaren | ||
| 4 | +// | ||
| 5 | +// Created by cnliveJunBo on 2018/1/27. | ||
| 6 | +// Copyright © 2018年 cnliveJunBo. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "ApplyForConfirmCell.h" | ||
| 10 | +#import "UIButton+Create.h" | ||
| 11 | +#import "CNLiveBaseKit.h" | ||
| 12 | +@interface ApplyForConfirmCell() | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +@implementation ApplyForConfirmCell | ||
| 17 | + | ||
| 18 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 19 | +{ | ||
| 20 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 21 | + if (self) { | ||
| 22 | + [self setupUI]; | ||
| 23 | + } | ||
| 24 | + return self; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +- (void)setupUI { | ||
| 28 | + [self.contentView addSubview:self.confirmButton]; | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +- (void)setModel:(AgreementModel *)model { | ||
| 32 | + _model = model; | ||
| 33 | + | ||
| 34 | + [_confirmButton setTitle:model.confirmTitle forState:UIControlStateNormal]; | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +- (void)layoutSubviews { | ||
| 38 | + [super layoutSubviews]; | ||
| 39 | + | ||
| 40 | + _confirmButton.frame = CGRectMake(30, 40, KScreenWidth-60, 45); | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +- (UIButton *)confirmButton { | ||
| 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]; | ||
| 46 | + [_confirmButton addTarget:self action:@selector(agree:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 47 | + } | ||
| 48 | + return _confirmButton; | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +- (void)agree:(UIButton *)sender { | ||
| 52 | + if (self.clickBtnBlock) { | ||
| 53 | + self.clickBtnBlock(sender); | ||
| 54 | + } | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | ||
| 58 | + [super setSelected:selected animated:animated]; | ||
| 59 | + | ||
| 60 | + // Configure the view for the selected state | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/ApplyForShootCell.h
0 → 100644
| 1 | +// | ||
| 2 | +// ApplyForShootCell.h | ||
| 3 | +// com.cnlive.pro.CNLiveNetAdd | ||
| 4 | +// | ||
| 5 | +// Created by cnliveJunBo on 2018/4/12. | ||
| 6 | +// Copyright © 2018年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | +#import "AgreementModel.h" | ||
| 11 | + | ||
| 12 | +@interface ApplyForShootCell : UITableViewCell | ||
| 13 | + | ||
| 14 | +@property (nonatomic, copy) void(^clickShootBtnBlock)(); | ||
| 15 | + | ||
| 16 | +@property (nonatomic, strong) AgreementModel *model; | ||
| 17 | +@property (nonatomic, strong) UIImageView *imgV; | ||
| 18 | + | ||
| 19 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/ApplyForShootCell.m
0 → 100644
| 1 | + | ||
| 2 | +// | ||
| 3 | +// ApplyForShootCell.m | ||
| 4 | +// com.cnlive.pro.CNLiveNetAdd | ||
| 5 | +// | ||
| 6 | +// Created by cnliveJunBo on 2018/4/12. | ||
| 7 | +// Copyright © 2018年 cnlive. All rights reserved. | ||
| 8 | +// | ||
| 9 | + | ||
| 10 | +#import "ApplyForShootCell.h" | ||
| 11 | +#import <Masonry/Masonry.h> | ||
| 12 | +#import "CNLiveBaseKit.h" | ||
| 13 | +#import <QMUIKit/QMUIKit.h> | ||
| 14 | +@interface ApplyForShootCell () | ||
| 15 | + | ||
| 16 | +@property (nonatomic, strong) UILabel *titleLab; | ||
| 17 | +@property (nonatomic, strong) UILabel *subTitleLab; | ||
| 18 | +@property (nonatomic, strong) UIButton *shootBtn; | ||
| 19 | +@property (nonatomic, strong) UIView *lineV; | ||
| 20 | + | ||
| 21 | +@end | ||
| 22 | + | ||
| 23 | +@implementation ApplyForShootCell | ||
| 24 | + | ||
| 25 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
| 26 | +{ | ||
| 27 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| 28 | + if (self) { | ||
| 29 | + [self setupUI]; | ||
| 30 | + } | ||
| 31 | + return self; | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +- (void)setModel:(AgreementModel *)model { | ||
| 35 | + | ||
| 36 | + _titleLab.text = model.shootTitle; | ||
| 37 | + _imgV.image = [UIImage imageNamed:model.shootImage]; | ||
| 38 | + if (model.isFront) { | ||
| 39 | + self.lineV.hidden = NO; | ||
| 40 | + NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"请拍摄本人身份证正面 注意避免证件反光"]; | ||
| 41 | + NSRange range1 = [[str string] rangeOfString:@"请拍摄本人身份证"]; | ||
| 42 | + [str addAttribute:NSForegroundColorAttributeName value:RGBA(156, 156, 156, 1) range:range1]; | ||
| 43 | + NSRange range2 = [[str string] rangeOfString:@"正面"]; | ||
| 44 | + [str addAttribute:NSForegroundColorAttributeName value:RGBA(255, 59, 48, 1) range:range2]; | ||
| 45 | + NSRange range3 = [[str string] rangeOfString:@" 注意避免证件反光"]; | ||
| 46 | + [str addAttribute:NSForegroundColorAttributeName value:RGBA(156, 156, 156, 1) range:range3]; | ||
| 47 | + _subTitleLab.attributedText = str; | ||
| 48 | + } else { | ||
| 49 | + self.lineV.hidden = YES; | ||
| 50 | + NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"请拍摄本人身份证反面 注意避免证件反光"]; | ||
| 51 | + NSRange range1 = [[str string] rangeOfString:@"请拍摄本人身份证"]; | ||
| 52 | + [str addAttribute:NSForegroundColorAttributeName value:RGBA(156, 156, 156, 1) range:range1]; | ||
| 53 | + NSRange range2 = [[str string] rangeOfString:@"反面"]; | ||
| 54 | + [str addAttribute:NSForegroundColorAttributeName value:RGBA(255, 59, 48, 1) range:range2]; | ||
| 55 | + NSRange range3 = [[str string] rangeOfString:@" 注意避免证件反光"]; | ||
| 56 | + [str addAttribute:NSForegroundColorAttributeName value:RGBA(156, 156, 156, 1) range:range3]; | ||
| 57 | + _subTitleLab.attributedText = str; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +- (void)setupUI { | ||
| 63 | + | ||
| 64 | + [self.contentView addSubview:self.lineV]; | ||
| 65 | + [self.contentView addSubview:self.titleLab]; | ||
| 66 | + [self.contentView addSubview:self.subTitleLab]; | ||
| 67 | + [self.contentView addSubview:self.imgV]; | ||
| 68 | +// [self.imgV addSubview:self.shootBtn]; | ||
| 69 | + | ||
| 70 | +} | ||
| 71 | + | ||
| 72 | +- (void)layoutSubviews { | ||
| 73 | + [super layoutSubviews]; | ||
| 74 | + | ||
| 75 | + [self.lineV mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 76 | + make.left.top.right.equalTo(self.contentView); | ||
| 77 | + make.height.mas_equalTo(1); | ||
| 78 | + }]; | ||
| 79 | + [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 80 | + make.left.equalTo(self.contentView).offset(69); | ||
| 81 | + make.top.equalTo(_lineV.mas_bottom).offset(22); | ||
| 82 | + make.width.mas_equalTo(64); | ||
| 83 | + make.height.mas_equalTo(16); | ||
| 84 | + }]; | ||
| 85 | + [self.subTitleLab mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 86 | + make.centerX.equalTo(self.contentView); | ||
| 87 | + make.top.equalTo(self.titleLab.mas_bottom).offset(15); | ||
| 88 | + make.width.mas_equalTo(245); | ||
| 89 | + make.height.mas_equalTo(15); | ||
| 90 | + }]; | ||
| 91 | + CGFloat width = KScreenWidth - 88; | ||
| 92 | + CGFloat height = width*157.0/287.0; | ||
| 93 | + [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 94 | + make.top.equalTo(self.subTitleLab.mas_bottom).offset(10); | ||
| 95 | + make.left.equalTo(self).offset(44); | ||
| 96 | + make.right.equalTo(self).offset(-44); | ||
| 97 | + make.height.mas_equalTo(height); | ||
| 98 | + }]; | ||
| 99 | +// [self.shootBtn mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 100 | +// make.center.equalTo(self.imgV); | ||
| 101 | +// make.width.height.mas_equalTo(60); | ||
| 102 | +// }]; | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +- (void)shootPhotoAction:(UIButton *)sender{ | ||
| 106 | + if (self.clickShootBtnBlock) { | ||
| 107 | + self.clickShootBtnBlock(); | ||
| 108 | + } | ||
| 109 | +} | ||
| 110 | + | ||
| 111 | +- (void)shootPhoto:(UITapGestureRecognizer *)tap { | ||
| 112 | + if (self.clickShootBtnBlock) { | ||
| 113 | + self.clickShootBtnBlock(); | ||
| 114 | + } | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +#pragma mark - SubViews | ||
| 118 | +- (UILabel *)titleLab { | ||
| 119 | + if (!_titleLab) { | ||
| 120 | + _titleLab = [[UILabel alloc] init]; | ||
| 121 | + _titleLab.textColor = RGB(26, 26, 26); | ||
| 122 | + _titleLab.font = [UIFont systemFontOfSize:16]; | ||
| 123 | + } | ||
| 124 | + return _titleLab; | ||
| 125 | +} | ||
| 126 | + | ||
| 127 | +- (UILabel *)subTitleLab { | ||
| 128 | + if (!_subTitleLab) { | ||
| 129 | + _subTitleLab = [[UILabel alloc] init]; | ||
| 130 | + _subTitleLab.textColor = RGB(156, 156, 156); | ||
| 131 | + _subTitleLab.font = [UIFont systemFontOfSize:12]; | ||
| 132 | + } | ||
| 133 | + return _subTitleLab; | ||
| 134 | +} | ||
| 135 | + | ||
| 136 | +- (UIImageView *)imgV { | ||
| 137 | + if (!_imgV) { | ||
| 138 | + _imgV = [[UIImageView alloc] init]; | ||
| 139 | + _imgV.contentMode = UIViewContentModeScaleToFill; | ||
| 140 | + _imgV.userInteractionEnabled = YES; | ||
| 141 | +// _imgV.layer.borderWidth = 1.0f; | ||
| 142 | +// _imgV.layer.borderColor = RGB(232, 232, 232).CGColor; | ||
| 143 | +// _imgV.layer.cornerRadius = 6.0f; | ||
| 144 | +// _imgV.layer.masksToBounds = YES; | ||
| 145 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(shootPhoto:)]; | ||
| 146 | + [_imgV addGestureRecognizer:tap]; | ||
| 147 | + } | ||
| 148 | + return _imgV; | ||
| 149 | +} | ||
| 150 | + | ||
| 151 | +- (UIButton *)shootBtn { | ||
| 152 | + if (!_shootBtn) { | ||
| 153 | + _shootBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 154 | + [_shootBtn setImage:[UIImage imageNamed:@"dl_xiangji"] forState:UIControlStateNormal]; | ||
| 155 | + [_shootBtn addTarget:self action:@selector(shootPhotoAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 156 | + } | ||
| 157 | + return _shootBtn; | ||
| 158 | +} | ||
| 159 | + | ||
| 160 | +- (UIView *)lineV { | ||
| 161 | + if (!_lineV) { | ||
| 162 | + _lineV = [[UIView alloc] init]; | ||
| 163 | + _lineV.backgroundColor = RGB(238, 238, 238); | ||
| 164 | + } | ||
| 165 | + return _lineV; | ||
| 166 | +} | ||
| 167 | + | ||
| 168 | +- (void)awakeFromNib { | ||
| 169 | + [super awakeFromNib]; | ||
| 170 | + // Initialization code | ||
| 171 | +} | ||
| 172 | + | ||
| 173 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | ||
| 174 | + [super setSelected:selected animated:animated]; | ||
| 175 | + | ||
| 176 | + // Configure the view for the selected state | ||
| 177 | +} | ||
| 178 | + | ||
| 179 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/UIButton+Create.h
0 → 100644
| 1 | +// | ||
| 2 | +// UIButton+Create.h | ||
| 3 | +// ireport | ||
| 4 | +// | ||
| 5 | +// Created by cnliveJunBo on 17/9/7. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@interface UIButton (Create) | ||
| 12 | + | ||
| 13 | +- (void)setupGradient; | ||
| 14 | + | ||
| 15 | ++ (instancetype)create_textButton:(NSString *)title fontSize:(CGFloat)fontSize normalColor:(UIColor *)normalColor selectedColor:(UIColor *)selectedColor; | ||
| 16 | + | ||
| 17 | ++ (instancetype)create_textButton:(CGRect)frame backgroundColor:(UIColor *)backgroundColor title:(NSString *)title selectedTitle:(NSString *)selectedTitle fontSize:(CGFloat)fontSize normalColor:(UIColor *)normalColor selectedColor:(UIColor *)selectedColor cornerRadius:(CGFloat)cornerRadius borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor; | ||
| 18 | + | ||
| 19 | ++ (instancetype)create_textButton1:(CGRect)frame backgroundColor:(UIColor *)backgroundColor title:(NSString *)title selectedTitle:(NSString *)selectedTitle fontSize:(CGFloat)fontSize normalColor:(UIColor *)normalColor selectedColor:(UIColor *)selectedColor cornerRadius:(CGFloat)cornerRadius borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor; | ||
| 20 | + | ||
| 21 | ++ (instancetype)create_imageButton:(CGRect)frame normalImage:(UIImage *)normalImage highlightedImg:(UIImage *)highlightedImg; | ||
| 22 | + | ||
| 23 | ++ (instancetype)create_imageButton:(CGRect)frame normalImage:(UIImage *)normalImage selectedImg:(UIImage *)selectedImg; | ||
| 24 | + | ||
| 25 | ++ (instancetype)create_imageButton:(CGRect)frame normalImage:(UIImage *)normalImage highlightedImg:(UIImage *)highlightedImg selectedImg:(UIImage *)selectedImg; | ||
| 26 | + | ||
| 27 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/View/UIButton+Create.m
0 → 100644
| 1 | +// | ||
| 2 | +// UIButton+Create.m | ||
| 3 | +// ireport | ||
| 4 | +// | ||
| 5 | +// Created by cnliveJunBo on 17/9/7. | ||
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "UIButton+Create.h" | ||
| 10 | + | ||
| 11 | +@implementation UIButton (Create) | ||
| 12 | + | ||
| 13 | ++ (instancetype)create_textButton:(NSString *)title fontSize:(CGFloat)fontSize normalColor:(UIColor *)normalColor selectedColor:(UIColor *)selectedColor { | ||
| 14 | + | ||
| 15 | + UIButton *button = [[UIButton alloc] init]; | ||
| 16 | + [button setTitle:title forState:UIControlStateNormal]; | ||
| 17 | + [button setTitleColor:normalColor forState:UIControlStateNormal]; | ||
| 18 | + [button setTitleColor:selectedColor forState:UIControlStateHighlighted]; | ||
| 19 | + button.titleLabel.font = [UIFont systemFontOfSize:fontSize]; | ||
| 20 | + [button sizeToFit]; | ||
| 21 | + | ||
| 22 | + return button; | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | ++ (instancetype)create_textButton:(CGRect)frame backgroundColor:(UIColor *)backgroundColor title:(NSString *)title selectedTitle:(NSString *)selectedTitle fontSize:(CGFloat)fontSize normalColor:(UIColor *)normalColor selectedColor:(UIColor *)selectedColor cornerRadius:(CGFloat)cornerRadius borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor { | ||
| 26 | + | ||
| 27 | + UIButton *button = [[UIButton alloc] initWithFrame:frame]; | ||
| 28 | + button.backgroundColor = backgroundColor; | ||
| 29 | + [button setTitle:title forState:UIControlStateNormal]; | ||
| 30 | + [button setTitle:selectedTitle forState:UIControlStateSelected]; | ||
| 31 | + [button setTitleColor:normalColor forState:UIControlStateNormal]; | ||
| 32 | + [button setTitleColor:selectedColor forState:UIControlStateSelected]; | ||
| 33 | + button.layer.cornerRadius = cornerRadius; | ||
| 34 | + button.clipsToBounds = YES; | ||
| 35 | + button.layer.borderWidth = borderWidth; | ||
| 36 | + button.layer.borderColor = borderColor.CGColor; | ||
| 37 | + button.titleLabel.font = [UIFont systemFontOfSize:fontSize]; | ||
| 38 | + | ||
| 39 | + return button; | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | ++ (instancetype)create_textButton1:(CGRect)frame backgroundColor:(UIColor *)backgroundColor title:(NSString *)title selectedTitle:(NSString *)selectedTitle fontSize:(CGFloat)fontSize normalColor:(UIColor *)normalColor selectedColor:(UIColor *)selectedColor cornerRadius:(CGFloat)cornerRadius borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor { | ||
| 43 | + | ||
| 44 | + UIButton *button = [[UIButton alloc] initWithFrame:frame]; | ||
| 45 | + button.backgroundColor = backgroundColor; | ||
| 46 | + [button setTitle:title forState:UIControlStateNormal]; | ||
| 47 | + [button setTitle:selectedTitle forState:UIControlStateSelected]; | ||
| 48 | + [button setTitleColor:normalColor forState:UIControlStateNormal]; | ||
| 49 | + [button setTitleColor:selectedColor forState:UIControlStateSelected]; | ||
| 50 | + button.layer.cornerRadius = cornerRadius; | ||
| 51 | + button.clipsToBounds = YES; | ||
| 52 | + button.layer.borderWidth = borderWidth; | ||
| 53 | + button.layer.borderColor = borderColor.CGColor; | ||
| 54 | +// button.titleLabel.font = [UIFont systemFontOfSize:fontSize]; | ||
| 55 | + | ||
| 56 | + return button; | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | ++ (instancetype)create_imageButton:(CGRect)frame normalImage:(UIImage *)normalImage highlightedImg:(UIImage *)highlightedImg { | ||
| 60 | + | ||
| 61 | + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 62 | + button.frame = frame; | ||
| 63 | + [button setImage:normalImage forState:UIControlStateNormal]; | ||
| 64 | + [button setImage:highlightedImg forState:UIControlStateHighlighted]; | ||
| 65 | + | ||
| 66 | + return button; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | ++ (instancetype)create_imageButton:(CGRect)frame normalImage:(UIImage *)normalImage selectedImg:(UIImage *)selectedImg { | ||
| 70 | + | ||
| 71 | + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 72 | + button.frame = frame; | ||
| 73 | + [button setImage:normalImage forState:UIControlStateNormal]; | ||
| 74 | + [button setImage:selectedImg forState:UIControlStateSelected]; | ||
| 75 | + | ||
| 76 | + return button; | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | ++ (instancetype)create_imageButton:(CGRect)frame normalImage:(UIImage *)normalImage highlightedImg:(UIImage *)highlightedImg selectedImg:(UIImage *)selectedImg { | ||
| 80 | + | ||
| 81 | + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 82 | + button.frame = frame; | ||
| 83 | + [button setImage:normalImage forState:UIControlStateNormal]; | ||
| 84 | + [button setImage:highlightedImg forState:UIControlStateHighlighted]; | ||
| 85 | + [button setImage:selectedImg forState:UIControlStateSelected]; | ||
| 86 | + | ||
| 87 | + return button; | ||
| 88 | +} | ||
| 89 | + | ||
| 90 | +- (void)setupGradient { | ||
| 91 | + | ||
| 92 | + // self.alpha = 0.65; | ||
| 93 | + CAGradientLayer *gradientLayer0 = [[CAGradientLayer alloc] init]; | ||
| 94 | + gradientLayer0.frame = self.bounds; | ||
| 95 | + gradientLayer0.colors = @[ | ||
| 96 | + (id)[UIColor colorWithRed:33.0f/255.0f green:183.0f/255.0f blue:175.0f/255.0f alpha:1.0f].CGColor, | ||
| 97 | + (id)[UIColor colorWithRed:85.0f/255.0f green:223.0f/255.0f blue:193.0f/255.0f alpha:1.0f].CGColor]; | ||
| 98 | + gradientLayer0.locations = @[@0, @1]; | ||
| 99 | + [gradientLayer0 setStartPoint:CGPointMake(1, 0)]; | ||
| 100 | + [gradientLayer0 setEndPoint:CGPointMake(0, 0)]; | ||
| 101 | + [self.layer insertSublayer:gradientLayer0 atIndex:0]; | ||
| 102 | + | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework/AipBase
0 → 100755
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework/Headers/AipBase.h
0 → 100644
| 1 | +// | ||
| 2 | +// AipBase.h | ||
| 3 | +// AipBase | ||
| 4 | +// | ||
| 5 | +// Created by chenxiaoyu on 2017/11/16. | ||
| 6 | +// Copyright © 2017年 baidu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +//! Project version number for AipBase. | ||
| 12 | +FOUNDATION_EXPORT double AipBaseVersionNumber; | ||
| 13 | + | ||
| 14 | +//! Project version string for AipBase. | ||
| 15 | +FOUNDATION_EXPORT const unsigned char AipBaseVersionString[]; | ||
| 16 | + | ||
| 17 | +// In this header, you should import all the public headers of your framework using statements like #import <AipBase/PublicHeader.h> | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +#import "AipOpenUDID.h" | ||
| 21 | +#import "AipTokenManager.h" | ||
| 22 | +#import "NSErrorHelper.h" | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework/Headers/AipOpenUDID.h
0 → 100644
| 1 | +// | ||
| 2 | +// OpenUDID.h | ||
| 3 | +// openudid | ||
| 4 | +// | ||
| 5 | +// initiated by Yann Lechelle (cofounder @Appsfire) on 8/28/11. | ||
| 6 | +// Copyright 2011 OpenUDID.org | ||
| 7 | +// | ||
| 8 | +// Main branches | ||
| 9 | +// iOS code: https://github.com/ylechelle/OpenUDID | ||
| 10 | +// | ||
| 11 | + | ||
| 12 | +/* | ||
| 13 | + !!! IMPORTANT !!! | ||
| 14 | + | ||
| 15 | + IF YOU ARE GOING TO INTEGRATE OpenUDID INSIDE A (STATIC) LIBRARY, | ||
| 16 | + PLEASE MAKE SURE YOU REFACTOR THE OpenUDID CLASS WITH A PREFIX OF YOUR OWN, | ||
| 17 | + E.G. ACME_OpenUDID. THIS WILL AVOID CONFUSION BY DEVELOPERS WHO ARE ALSO | ||
| 18 | + USING OpenUDID IN THEIR OWN CODE. | ||
| 19 | + | ||
| 20 | + !!! IMPORTANT !!! | ||
| 21 | + | ||
| 22 | +*/ | ||
| 23 | + | ||
| 24 | +/* | ||
| 25 | + http://en.wikipedia.org/wiki/Zlib_License | ||
| 26 | + | ||
| 27 | + This software is provided 'as-is', without any express or implied | ||
| 28 | + warranty. In no event will the authors be held liable for any damages | ||
| 29 | + arising from the use of this software. | ||
| 30 | + | ||
| 31 | + Permission is granted to anyone to use this software for any purpose, | ||
| 32 | + including commercial applications, and to alter it and redistribute it | ||
| 33 | + freely, subject to the following restrictions: | ||
| 34 | + | ||
| 35 | + 1. The origin of this software must not be misrepresented; you must not | ||
| 36 | + claim that you wrote the original software. If you use this software | ||
| 37 | + in a product, an acknowledgment in the product documentation would be | ||
| 38 | + appreciated but is not required. | ||
| 39 | + | ||
| 40 | + 2. Altered source versions must be plainly marked as such, and must not be | ||
| 41 | + misrepresented as being the original software. | ||
| 42 | + | ||
| 43 | + 3. This notice may not be removed or altered from any source | ||
| 44 | + distribution. | ||
| 45 | +*/ | ||
| 46 | + | ||
| 47 | +#import <Foundation/Foundation.h> | ||
| 48 | + | ||
| 49 | +// | ||
| 50 | +// Usage: | ||
| 51 | +// #include "OpenUDID.h" | ||
| 52 | +// NSString* openUDID = [OpenUDID value]; | ||
| 53 | +// | ||
| 54 | + | ||
| 55 | +#define kOpenUDIDErrorNone 0 | ||
| 56 | +#define kOpenUDIDErrorOptedOut 1 | ||
| 57 | +#define kOpenUDIDErrorCompromised 2 | ||
| 58 | + | ||
| 59 | +@interface OpenUDID : NSObject { | ||
| 60 | +} | ||
| 61 | ++ (NSString*) value; | ||
| 62 | ++ (NSString*) valueWithError:(NSError**)error; | ||
| 63 | ++ (void) setOptOut:(BOOL)optOutValue; | ||
| 64 | + | ||
| 65 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework/Headers/AipTokenManager.h
0 → 100644
| 1 | +// | ||
| 2 | +// Created by chenxiaoyu on 17/8/29. | ||
| 3 | +// Copyright (c) 2017 baidu. All rights reserved. | ||
| 4 | +// | ||
| 5 | +// | ||
| 6 | + | ||
| 7 | +#import <Foundation/Foundation.h> | ||
| 8 | +#import <UIKit/UIKit.h> | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +@interface AipTokenManager : NSObject | ||
| 12 | + | ||
| 13 | +- (instancetype) init __attribute__((unavailable( | ||
| 14 | +"Use 'initWithLicenseFileData' or 'initWithAK:andSK' instead"))); | ||
| 15 | + | ||
| 16 | +- (instancetype) initWithLicenseFileData: (NSData *)licenseFileContent; | ||
| 17 | + | ||
| 18 | +- (instancetype) initWithAK: (NSString *)ak andSK: (NSString *)sk; | ||
| 19 | + | ||
| 20 | +//- (instancetype) initWithToken: (NSString *)token; | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * 获取身份证前端检测Token | ||
| 24 | + * @param successHandler 成功回调 | ||
| 25 | + * @param failHandler 失败回调 | ||
| 26 | + */ | ||
| 27 | +- (void)getIdcardTokenWithSuccessHandler:(void (^)(NSString *token))successHandler | ||
| 28 | + failHandler:(void (^)(NSError *error))failHandler; | ||
| 29 | + | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | + * 获取Token。回调可能在mainQueue或其他子线程中 | ||
| 33 | + * @param successHandler 成功回调 | ||
| 34 | + * @param failHandler 失败回调 | ||
| 35 | + */ | ||
| 36 | +- (void)getTokenWithSuccessHandler:(void (^)(NSString *token))successHandler | ||
| 37 | + failHandler:(void (^)(NSError *error))failHandler; | ||
| 38 | + | ||
| 39 | +/** | ||
| 40 | + * 清空cache | ||
| 41 | + */ | ||
| 42 | +- (void) clearCache; | ||
| 43 | + | ||
| 44 | +/** | ||
| 45 | + * 设置验证服务器地址前缀,包含protocol | ||
| 46 | + * 如 https://verify.baidubce.com:80 | ||
| 47 | + * 若设置为http,需设置NSAppTransportSecurity | ||
| 48 | + */ | ||
| 49 | +- (void)setAuthHost:(NSString *)host; | ||
| 50 | + | ||
| 51 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework/Headers/NSErrorHelper.h
0 → 100644
| 1 | +// | ||
| 2 | +// Created by chenxiaoyu on 17/2/16. | ||
| 3 | +// Copyright (c) 2017 baidu. All rights reserved. | ||
| 4 | +// | ||
| 5 | + | ||
| 6 | +#import <Foundation/Foundation.h> | ||
| 7 | + | ||
| 8 | +extern const NSInteger AipErr_SUCCESS; | ||
| 9 | + | ||
| 10 | +@interface NSErrorHelper : NSObject | ||
| 11 | + | ||
| 12 | ++ (NSError *)aipErrorWithCode:(NSInteger)code andMessage:(NSString *)message; | ||
| 13 | + | ||
| 14 | ++ (NSError *)aipError_bundleMismatch; | ||
| 15 | ++ (NSError *)aipError_licenseMismatch; | ||
| 16 | + | ||
| 17 | ++ (NSError *)aipError_serverIllegalResponse; | ||
| 18 | ++ (NSError *)aipError_serverConnectFailWithMessage:(NSString *)message; | ||
| 19 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework/Info.plist
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework/Modules/module.modulemap
0 → 100644
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/AipOcrSdk
0 → 100755
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/AipOcrSdk.storyboardc/ANZ-N0-y67-view-Tv2-ge-o8Q.nib
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/AipOcrSdk.storyboardc/AipCaptureCardVC.nib
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/AipOcrSdk.storyboardc/AipGeneralVC.nib
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/AipOcrSdk.storyboardc/Info.plist
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/AipOcrSdk.storyboardc/qVB-bS-VcD-view-pEK-B6-uAC.nib
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/Headers/AipCaptureCardVC.h
0 → 100644
| 1 | +// | ||
| 2 | +// AipCaptureCardVC.h | ||
| 3 | +// OCRLib | ||
| 4 | +// 卡片识别VewController | ||
| 5 | +// Created by Yan,Xiangda on 16/11/9. | ||
| 6 | +// Copyright © 2016年 Baidu Passport. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +typedef NS_ENUM(NSInteger, CardType) { | ||
| 13 | + | ||
| 14 | + CardTypeIdCardFont = 0, | ||
| 15 | + CardTypeIdCardBack, | ||
| 16 | + CardTypeBankCard, | ||
| 17 | + CardTypeLocalIdCardFont , | ||
| 18 | + CardTypeLocalIdCardBack, | ||
| 19 | + CardTypeLocalBankCard | ||
| 20 | +}; | ||
| 21 | + | ||
| 22 | +@interface AipCaptureCardVC : UIViewController | ||
| 23 | + | ||
| 24 | +@property (nonatomic, assign) CardType cardType; | ||
| 25 | +@property (nonatomic, copy) void (^handler)(UIImage *); | ||
| 26 | + | ||
| 27 | + | ||
| 28 | ++(UIViewController *)ViewControllerWithCardType:(CardType)type andImageHandler:(void (^)(UIImage *image))handler; | ||
| 29 | + | ||
| 30 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/Headers/AipGeneralVC.h
0 → 100644
| 1 | +// | ||
| 2 | +// AipGeneralVC.h | ||
| 3 | +// OCRLib | ||
| 4 | +// | ||
| 5 | +// Created by Yan,Xiangda on 2017/2/16. | ||
| 6 | +// Copyright © 2017年 Baidu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +@interface AipGeneralVC : UIViewController | ||
| 12 | + | ||
| 13 | + | ||
| 14 | +@property (nonatomic, copy) void (^handler)(UIImage *); | ||
| 15 | + | ||
| 16 | ++(UIViewController *)ViewControllerWithHandler:(void (^)(UIImage *image))handler; | ||
| 17 | + | ||
| 18 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/Headers/AipOcrSdk.h
0 → 100644
| 1 | +// | ||
| 2 | +// AipOcrSdk.h | ||
| 3 | +// AipOcrSdk | ||
| 4 | +// | ||
| 5 | +// Created by chenxiaoyu on 17/2/7. | ||
| 6 | +// Copyright © 2017年 baidu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +//! Project version number for AipOcrSdk. | ||
| 12 | +FOUNDATION_EXPORT double AipOcrSdkVersionNumber; | ||
| 13 | + | ||
| 14 | +//! Project version string for AipOcrSdk. | ||
| 15 | +FOUNDATION_EXPORT const unsigned char AipOcrSdkVersionString[]; | ||
| 16 | + | ||
| 17 | +// In this header, you should import all the public headers of your framework using statements like #import <AipOcrSdk/PublicHeader.h> | ||
| 18 | + | ||
| 19 | +#import <AipOcrSdk/AipGeneralVC.h> | ||
| 20 | +#import <AipOcrSdk/AipCaptureCardVC.h> | ||
| 21 | +#import <AipOcrSdk/AipOcrService.h> | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/Headers/AipOcrService.h
0 → 100644
| 1 | +// | ||
| 2 | +// Created by chenxiaoyu on 17/2/21. | ||
| 3 | +// Copyright (c) 2017 baidu. All rights reserved. | ||
| 4 | +// | ||
| 5 | + | ||
| 6 | +#import <Foundation/Foundation.h> | ||
| 7 | +#import <UIKit/UIKit.h> | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +@interface AipOcrService : NSObject | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 使用授权文件授权(推荐) | ||
| 15 | + * @param licenseFileContent 授权文件内容 | ||
| 16 | + */ | ||
| 17 | +- (void) authWithLicenseFileData: (NSData *)licenseFileContent; | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +/** | ||
| 21 | + * 使用Api Key, Secret Key授权 | ||
| 22 | + */ | ||
| 23 | +- (void) authWithAK: (NSString *)ak andSK: (NSString *)sk; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * 获取身份证检测Token | ||
| 27 | + * @param successHandler 成功回调 | ||
| 28 | + * @param failHandler 失败回调 | ||
| 29 | + */ | ||
| 30 | + | ||
| 31 | +- (void )getTokenSuccessHandler:(void (^)(NSString *token))successHandler | ||
| 32 | + failHandler:(void (^)(NSError *error))failHandler; | ||
| 33 | + | ||
| 34 | + | ||
| 35 | +/** | ||
| 36 | + * 通用文字识别(含位置信息) | ||
| 37 | + * @param image 需要识别的图片 | ||
| 38 | + * @param options direction, language ... 详见开发者文档 | ||
| 39 | + * @param successHandler 成功回调 | ||
| 40 | + * @param failHandler 失败回调 | ||
| 41 | + */ | ||
| 42 | +- (void) detectTextFromImage: (UIImage*)image | ||
| 43 | + withOptions: (NSDictionary *)options | ||
| 44 | + successHandler: (void (^)(id result))successHandler | ||
| 45 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 46 | + | ||
| 47 | + | ||
| 48 | +/** | ||
| 49 | + * 通用文字识别(不含位置信息版) | ||
| 50 | + * @param image 需要识别的图片 | ||
| 51 | + * @param options direction, language ... 详见开发者文档 | ||
| 52 | + * @param successHandler 成功回调 | ||
| 53 | + * @param failHandler 失败回调 | ||
| 54 | + */ | ||
| 55 | +- (void) detectTextBasicFromImage: (UIImage*)image | ||
| 56 | + withOptions: (NSDictionary *)options | ||
| 57 | + successHandler: (void (^)(id result))successHandler | ||
| 58 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 59 | + | ||
| 60 | +/** | ||
| 61 | + * 通用文字识别(含生僻字版) | ||
| 62 | + * @param image 需要识别的图片 | ||
| 63 | + * @param options direction, language ... 详见开发者文档 | ||
| 64 | + * @param successHandler 成功回调 | ||
| 65 | + * @param failHandler 失败回调 | ||
| 66 | + */ | ||
| 67 | +- (void) detectTextEnhancedFromImage: (UIImage*)image | ||
| 68 | + withOptions: (NSDictionary *)options | ||
| 69 | + successHandler: (void (^)(id result))successHandler | ||
| 70 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 71 | + | ||
| 72 | + | ||
| 73 | + | ||
| 74 | +/** | ||
| 75 | + * 通用文字识别,高精度,带位置信息 | ||
| 76 | + * @param image 图像 | ||
| 77 | + * @param options 可选参数 | ||
| 78 | + * @param successHandler 成功回调 | ||
| 79 | + * @param failHandler 失败回调 | ||
| 80 | + */ | ||
| 81 | +- (void) detectTextAccurateFromImage: (UIImage*)image | ||
| 82 | + withOptions: (NSDictionary *)options | ||
| 83 | + successHandler: (void (^)(id result))successHandler | ||
| 84 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 85 | + | ||
| 86 | + | ||
| 87 | +/** | ||
| 88 | + * 通用文字识别,高精度,不带位置信息 | ||
| 89 | + * @param image 图像 | ||
| 90 | + * @param options 可选参数 | ||
| 91 | + * @param successHandler 成功回调 | ||
| 92 | + * @param failHandler 失败回调 | ||
| 93 | + */ | ||
| 94 | +- (void)detectTextAccurateBasicFromImage:(UIImage *)image | ||
| 95 | + withOptions:(NSDictionary *)options | ||
| 96 | + successHandler:(void (^)(id result))successHandler | ||
| 97 | + failHandler:(void (^)(NSError *err))failHandler; | ||
| 98 | + | ||
| 99 | +- (void) detectIdCardFromImage: (UIImage*)image | ||
| 100 | + withOptions: (NSDictionary *)options | ||
| 101 | + successHandler: (void (^)(id result))successHandler | ||
| 102 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 103 | + | ||
| 104 | +/** | ||
| 105 | + * 身份证正面识别 | ||
| 106 | + * @param image 需要识别的图片 | ||
| 107 | + * @param options 参数,详见开发者文档 | ||
| 108 | + * @param successHandler 成功回调 | ||
| 109 | + * @param failHandler 失败回调 | ||
| 110 | + */ | ||
| 111 | +- (void)detectIdCardFrontFromImage:(UIImage *)image | ||
| 112 | + withOptions:(NSDictionary *)options | ||
| 113 | + successHandler:(void (^)(id result))successHandler | ||
| 114 | + failHandler:(void (^)(NSError *err))failHandler; | ||
| 115 | + | ||
| 116 | +/** | ||
| 117 | + * 身份证背面识别 | ||
| 118 | + * @param image 需要识别的图片 | ||
| 119 | + * @param options 参数,详见开发者文档 | ||
| 120 | + * @param successHandler 成功回调 | ||
| 121 | + * @param failHandler 失败回调 | ||
| 122 | + */ | ||
| 123 | +- (void)detectIdCardBackFromImage:(UIImage *)image | ||
| 124 | + withOptions:(NSDictionary *)options | ||
| 125 | + successHandler:(void (^)(id result))successHandler | ||
| 126 | + failHandler:(void (^)(NSError *err))failHandler; | ||
| 127 | + | ||
| 128 | +/** | ||
| 129 | + * 银行卡识别 | ||
| 130 | + * @param image 需要识别的图片 | ||
| 131 | + * @param successHandler 成功回调 | ||
| 132 | + * @param failHandler 失败回调 | ||
| 133 | + */ | ||
| 134 | +- (void) detectBankCardFromImage: (UIImage*)image | ||
| 135 | + successHandler: (void (^)(id result))successHandler | ||
| 136 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 137 | + | ||
| 138 | + | ||
| 139 | +/** | ||
| 140 | + * 网图识别 | ||
| 141 | + * @param image 需要识别的图片 | ||
| 142 | + * @param options 额外参数 | ||
| 143 | + * @param successHandler 成功回调 | ||
| 144 | + * @param failHandler 失败回调 | ||
| 145 | + */ | ||
| 146 | +- (void)detectWebImageFromImage:(UIImage *)image | ||
| 147 | + withOptions:(NSDictionary *)options | ||
| 148 | + successHandler:(void (^)(id result))successHandler | ||
| 149 | + failHandler:(void (^)(NSError *err))failHandler; | ||
| 150 | + | ||
| 151 | +/** | ||
| 152 | + * 驾驶证识别 | ||
| 153 | + * @param image 需要识别的图片 | ||
| 154 | + * @param options 额外参数 | ||
| 155 | + * @param successHandler 成功回调 | ||
| 156 | + * @param failHandler 失败回调 | ||
| 157 | + */ | ||
| 158 | +- (void) detectDrivingLicenseFromImage: (UIImage *)image | ||
| 159 | + withOptions: (NSDictionary *)options | ||
| 160 | + successHandler: (void (^)(id result))successHandler | ||
| 161 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 162 | + | ||
| 163 | +/** | ||
| 164 | + * 行驶证证识别 | ||
| 165 | + * @param image 需要识别的图片 | ||
| 166 | + * @param options 额外参数 | ||
| 167 | + * @param successHandler 成功回调 | ||
| 168 | + * @param failHandler 失败回调 | ||
| 169 | + */ | ||
| 170 | +- (void) detectVehicleLicenseFromImage: (UIImage *)image | ||
| 171 | + withOptions: (NSDictionary *)options | ||
| 172 | + successHandler: (void (^)(id result))successHandler | ||
| 173 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 174 | + | ||
| 175 | +/** | ||
| 176 | + * 车牌证识别 | ||
| 177 | + * @param image 需要识别的图片 | ||
| 178 | + * @param options 额外参数 | ||
| 179 | + * @param successHandler 成功回调 | ||
| 180 | + * @param failHandler 失败回调 | ||
| 181 | + */ | ||
| 182 | +- (void)detectPlateNumberFromImage:(UIImage *)image | ||
| 183 | + withOptions:(NSDictionary *)options | ||
| 184 | + successHandler:(void (^)(id result))successHandler | ||
| 185 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 186 | + | ||
| 187 | + | ||
| 188 | + | ||
| 189 | +/** | ||
| 190 | + * 营业执照识别 | ||
| 191 | + * @param image 图像 | ||
| 192 | + * @param options 可选参数 | ||
| 193 | + * @param successHandler 成功回调 | ||
| 194 | + * @param failHandler 失败回调 | ||
| 195 | + */ | ||
| 196 | +- (void) detectBusinessLicenseFromImage: (UIImage *)image | ||
| 197 | + withOptions: (NSDictionary *)options | ||
| 198 | + successHandler: (void (^)(id result))successHandler | ||
| 199 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 200 | + | ||
| 201 | + | ||
| 202 | +/** | ||
| 203 | + * 票据识别 | ||
| 204 | + * @param image 图像 | ||
| 205 | + * @param options 可选参数 | ||
| 206 | + * @param successHandler 成功回调 | ||
| 207 | + * @param failHandler 失败回调 | ||
| 208 | + */ | ||
| 209 | +- (void) detectReceiptFromImage: (UIImage *)image | ||
| 210 | + withOptions: (NSDictionary *)options | ||
| 211 | + successHandler: (void (^)(id result))successHandler | ||
| 212 | + failHandler: (void (^)(NSError* err))failHandler; | ||
| 213 | + | ||
| 214 | + | ||
| 215 | +/** | ||
| 216 | + * 清空验证缓存 | ||
| 217 | + * 出现验证过期等特殊情况调用 | ||
| 218 | + */ | ||
| 219 | +- (void) clearCache; | ||
| 220 | + | ||
| 221 | ++ (NSError *)aipErrorWithCode:(NSInteger)code andMessage:(NSString *)message; | ||
| 222 | + | ||
| 223 | ++ (instancetype)shardService; | ||
| 224 | + | ||
| 225 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/Info.plist
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/Modules/module.modulemap
0 → 100644
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/Page 1@2x.png
0 → 100644
4.35 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/Page 1@3x.png
0 → 100644
6.61 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/dengpao@2x.png
0 → 100644
1.49 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/dengpao@3x.png
0 → 100644
2.33 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/dengpao_dianjihou@2x.png
0 → 100644
1.83 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/dengpao_dianjihou@3x.png
0 → 100644
2.81 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/guan@2x.png
0 → 100644
428 Bytes
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/guan@3x.png
0 → 100644
601 Bytes
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/guanbi@2x.png
0 → 100644
949 Bytes
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/guanbi@3x.png
0 → 100644
1.63 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/paizhaoanniu@2x.png
0 → 100644
5.42 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/paizhaoanniu@3x.png
0 → 100644
8.26 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/paizhaoanniu_dianjihou@2x.png
0 → 100644
5.81 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/paizhaoanniu_dianjihou@3x.png
0 → 100644
8.85 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/queding@2x.png
0 → 100644
814 Bytes
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/queding@3x.png
0 → 100644
1.23 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/tuku@2x.png
0 → 100644
1.23 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/tuku@3x.png
0 → 100644
1.97 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/xuanzhuan@2x.png
0 → 100644
1.84 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/xuanzhuan@3x.png
0 → 100644
2.59 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/xuxian@2x.png
0 → 100644
7.33 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework/xuxian@3x.png
0 → 100644
11.4 KB
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework/Headers/IdcardQuality.h
0 → 100644
| 1 | +// | ||
| 2 | +// IdcardQuality.h | ||
| 3 | +// IdcardQuality | ||
| 4 | +// | ||
| 5 | +// Created by Yan,Xiangda on 2017/4/17. | ||
| 6 | +// Copyright © 2017年 Baidu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +//! Project version number for IdcardQuality. | ||
| 12 | +FOUNDATION_EXPORT double IdcardQualityVersionNumber; | ||
| 13 | + | ||
| 14 | +//! Project version string for IdcardQuality. | ||
| 15 | +FOUNDATION_EXPORT const unsigned char IdcardQualityVersionString[]; | ||
| 16 | + | ||
| 17 | +// In this header, you should import all the public headers of your framework using statements like #import <IdcardQuality/PublicHeader.h> | ||
| 18 | + | ||
| 19 | +#import <IdcardQuality/IdcardQualityAdaptor.h> | ||
| 20 | +#import <IdcardQuality/idcard_quality.h> |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework/Headers/IdcardQualityAdaptor.h
0 → 100644
| 1 | +// | ||
| 2 | +// IdcardQualityAdaptor.h | ||
| 3 | +// IdcardQuality | ||
| 4 | +// | ||
| 5 | +// Created by Yan,Xiangda on 2017/4/17. | ||
| 6 | +// Copyright © 2017年 Baidu. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | +#import <UIKit/UIKit.h> | ||
| 11 | +#include "idcard_quality.h" | ||
| 12 | + | ||
| 13 | +typedef NS_ENUM(NSInteger, IdcardQualityImageStatus) { | ||
| 14 | + | ||
| 15 | + IdcardQualityImageStatusNormal = 0, | ||
| 16 | + IdcardQualityImageStatusWrongLocation, | ||
| 17 | + IdcardQualityImageStatusBlurred, | ||
| 18 | + IdcardQualityImageStatusOverExposure, | ||
| 19 | + IdcardQualityImageStatusReversedSide | ||
| 20 | +}; | ||
| 21 | + | ||
| 22 | +@interface IdcardQualityModel : NSObject | ||
| 23 | + | ||
| 24 | +@property (assign ,nonatomic) idcard_quality::ImageStatusType image_status; | ||
| 25 | +@property (assign ,nonatomic) idcard_quality::IdCardQualityErrorType errorType; | ||
| 26 | +@property (assign ,nonatomic) bool has_warpped_image; | ||
| 27 | +@property (assign ,nonatomic) unsigned char *warpped_image_data; | ||
| 28 | +@property (assign ,nonatomic) int warped_image_width; | ||
| 29 | +@property (assign ,nonatomic) int warped_image_height; | ||
| 30 | +@property (assign ,nonatomic) int warped_image_channel; | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +@end | ||
| 34 | + | ||
| 35 | +@interface IdcardQualityAdaptor : NSObject | ||
| 36 | + | ||
| 37 | +- (void)initWithAPIKey:(NSString *)apiKey andLocalLicenceFile:(NSString *)localLicencePath; | ||
| 38 | + | ||
| 39 | +- (BOOL)initWithToken:(NSString *)token; | ||
| 40 | + | ||
| 41 | +- (BOOL)canWork; | ||
| 42 | + | ||
| 43 | +- (IdcardQualityModel *)process:(UIImage *)image width:(int)width height:(int)height channel:(int)channel cardType:(idcard_quality::IdCardType)type; | ||
| 44 | + | ||
| 45 | +//QA 测试接口 | ||
| 46 | +- (IdcardQualityModel *)processIsMoving:(UIImage *)image width:(int)width height:(int)height channel:(int)channel cardType:(idcard_quality::IdCardType)type; | ||
| 47 | + | ||
| 48 | +- (IdcardQualityModel *)processWithoutIsMoving:(UIImage *)image width:(int)width height:(int)height channel:(int)channel cardType:(idcard_quality::IdCardType)type; | ||
| 49 | + | ||
| 50 | +- (void)releaseIdcardQuality; | ||
| 51 | + | ||
| 52 | +@end |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework/Headers/idcard_quality.h
0 → 100644
| 1 | +/** | ||
| 2 | + * idcard_quality.h | ||
| 3 | + * | ||
| 4 | + * Author: wangjianfeng01(wangjianfeng01@baidu.com) | ||
| 5 | + * Created on: 2017-04-11 | ||
| 6 | + * | ||
| 7 | + * Copyright (c) Baidu.com, Inc. All Rights Reserved | ||
| 8 | + * | ||
| 9 | + */ | ||
| 10 | + | ||
| 11 | +#pragma once | ||
| 12 | + | ||
| 13 | +#include <stdlib.h> | ||
| 14 | +#include <vector> | ||
| 15 | + | ||
| 16 | +#ifdef ANDROID | ||
| 17 | +#include <android/asset_manager.h> | ||
| 18 | + | ||
| 19 | +#define BDIDL_DECL(func, ...) func(AAssetManager *aassetmanager, __VA_ARGS__) | ||
| 20 | +#define BDIDL_CALL(func, ...) func(aassetmanager, __VA_ARGS__) | ||
| 21 | +#else /* !ANDROID */ | ||
| 22 | +#define BDIDL_DECL(func, ...) func(__VA_ARGS__) | ||
| 23 | +#define BDIDL_CALL(func, ...) func(__VA_ARGS__) | ||
| 24 | +#endif /* ANDROID */ | ||
| 25 | + | ||
| 26 | +namespace idcard_quality { | ||
| 27 | + | ||
| 28 | +enum IdCardQualityErrorType { | ||
| 29 | + IDCQ_NO_ERROR = 0, | ||
| 30 | + IDCQ_NO_AUTHORITY = -1, | ||
| 31 | + IDCQ_PATH_ERROR = -2, /* path is null or does not exist */ | ||
| 32 | + IDCQ_FILE_ERROR = -3, /* reading file error */ | ||
| 33 | + IDCQ_MODEL_INIT_ERROR = -4, | ||
| 34 | + IDCQ_MODEL_RUNTIME_ERROR = -5, | ||
| 35 | + IDCQ_IMAGE_ERROR = -6, | ||
| 36 | + IDCQ_MEMORY_ERROR = -7, | ||
| 37 | + IDCQ_NOT_IMPLEMENTED_ERROR = -8, | ||
| 38 | + IDCQ_UNKNOWN_ERROR = -10 | ||
| 39 | +}; | ||
| 40 | + | ||
| 41 | +/* | ||
| 42 | + * IDCARD_INCOMPLETE: incomplete idcard | ||
| 43 | + * IDCARD_TOO_SMALL: idcard for small proportion in pic | ||
| 44 | + * or rotated idcard | ||
| 45 | + * IDCARD_WRONG_LOCATION: way too small, way too large, | ||
| 46 | + * rotated or not an idcard | ||
| 47 | + */ | ||
| 48 | +enum ImageStatusType { | ||
| 49 | + IDCARD_NORMAL = 0, | ||
| 50 | + IDCARD_WRONG_LOCATION = 1, // non_idcard, way_too_small, way_too_large | ||
| 51 | + IDCARD_BLURRED = 2, | ||
| 52 | + IDCARD_OVER_EXPOSURE = 3, | ||
| 53 | + IDCARD_REVERSED_SIDE = 4, | ||
| 54 | + IDCARD_MOVING = 5, | ||
| 55 | + IDCARD_TOO_SMALL = 6, | ||
| 56 | + IDCARD_INCOMPLETE = 7 | ||
| 57 | +}; | ||
| 58 | + | ||
| 59 | +enum IdCardType { | ||
| 60 | + IDCARD_FRONT_SIDE = 1, | ||
| 61 | + IDCARD_BACK_SIDE = 2 | ||
| 62 | +}; | ||
| 63 | + | ||
| 64 | +struct IdCardQualityResult { | ||
| 65 | + ImageStatusType image_status; | ||
| 66 | + bool has_warped_image; | ||
| 67 | + unsigned char* warped_image_data; | ||
| 68 | + int warped_image_width; | ||
| 69 | + int warped_image_height; | ||
| 70 | + int warped_image_channel; | ||
| 71 | + | ||
| 72 | + std::vector<unsigned char*> cropped_image_data; | ||
| 73 | + std::vector<int> cropped_image_width; | ||
| 74 | + std::vector<int> cropped_image_height; | ||
| 75 | + std::vector<int> cropped_image_channel; | ||
| 76 | + | ||
| 77 | + IdCardQualityResult() : image_status(IDCARD_WRONG_LOCATION), | ||
| 78 | + has_warped_image(false), warped_image_data(NULL), | ||
| 79 | + warped_image_width(0), warped_image_height(0), warped_image_channel(0) { | ||
| 80 | + } | ||
| 81 | + ~IdCardQualityResult() { | ||
| 82 | + if (warped_image_data != NULL) { | ||
| 83 | + free(warped_image_data); | ||
| 84 | + warped_image_data = NULL; | ||
| 85 | + } | ||
| 86 | + for (size_t i = 0; i < cropped_image_data.size(); i++) { | ||
| 87 | + if (cropped_image_data[i] != NULL) { | ||
| 88 | + free(cropped_image_data[i]); | ||
| 89 | + cropped_image_data[i] = NULL; | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | +}; | ||
| 94 | + | ||
| 95 | +} // namespace idcard_quality |
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework/IdcardQuality
0 → 100755
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework/Info.plist
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework/Modules/module.modulemap
0 → 100644
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework/integrity_model_secret.bin
0 → 100644
No preview for this file type
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework/quality_model_secret.bin
0 → 100644
No preview for this file type
Example/CNLiveBPersonalVerificationModule.xcodeproj/project.pbxproj
| @@ -8,8 +8,8 @@ | @@ -8,8 +8,8 @@ | ||
| 8 | 8 | ||
| 9 | /* Begin PBXBuildFile section */ | 9 | /* Begin PBXBuildFile section */ |
| 10 | 4E6D90B75C078198775B2788 /* Pods_CNLiveBPersonalVerificationModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7817A8D29BB68F50E5117819 /* Pods_CNLiveBPersonalVerificationModule_Tests.framework */; }; | 10 | 4E6D90B75C078198775B2788 /* Pods_CNLiveBPersonalVerificationModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7817A8D29BB68F50E5117819 /* Pods_CNLiveBPersonalVerificationModule_Tests.framework */; }; |
| 11 | + 4EE7A53224497382008BEE4F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; | ||
| 11 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | 12 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; |
| 12 | - 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; | ||
| 13 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; | 13 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; |
| 14 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; | 14 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; |
| 15 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; | 15 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; |
| @@ -40,6 +40,9 @@ | @@ -40,6 +40,9 @@ | ||
| 40 | 1B6B758677C7BEA3A31C708A /* Pods_CNLiveBPersonalVerificationModule_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveBPersonalVerificationModule_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | 40 | 1B6B758677C7BEA3A31C708A /* Pods_CNLiveBPersonalVerificationModule_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveBPersonalVerificationModule_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 41 | 27702AE45A435A3D3F6D7F80 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; | 41 | 27702AE45A435A3D3F6D7F80 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; |
| 42 | 2EE018FA9C0FF28273EA7BB2 /* Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveBPersonalVerificationModule_Example/Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig"; sourceTree = "<group>"; }; | 42 | 2EE018FA9C0FF28273EA7BB2 /* Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveBPersonalVerificationModule_Example/Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig"; sourceTree = "<group>"; }; |
| 43 | + 4EE7A51B244970B8008BEE4F /* AipBase.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AipBase.framework; path = ../CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework; sourceTree = "<group>"; }; | ||
| 44 | + 4EE7A51F244970C7008BEE4F /* AipOcrSdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AipOcrSdk.framework; path = ../CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework; sourceTree = "<group>"; }; | ||
| 45 | + 4EE7A522244970D6008BEE4F /* IdcardQuality.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IdcardQuality.framework; path = ../CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework; sourceTree = "<group>"; }; | ||
| 43 | 5116195DD3BA1DE9570EE346 /* Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveBPersonalVerificationModule_Tests/Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; | 46 | 5116195DD3BA1DE9570EE346 /* Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveBPersonalVerificationModule_Tests/Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; |
| 44 | 6003F58A195388D20070C39A /* CNLiveBPersonalVerificationModule.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveBPersonalVerificationModule.app; sourceTree = BUILT_PRODUCTS_DIR; }; | 47 | 6003F58A195388D20070C39A /* CNLiveBPersonalVerificationModule.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveBPersonalVerificationModule.app; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 45 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; | 48 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; |
| @@ -74,9 +77,9 @@ | @@ -74,9 +77,9 @@ | ||
| 74 | isa = PBXFrameworksBuildPhase; | 77 | isa = PBXFrameworksBuildPhase; |
| 75 | buildActionMask = 2147483647; | 78 | buildActionMask = 2147483647; |
| 76 | files = ( | 79 | files = ( |
| 77 | - 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, | ||
| 78 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, | 80 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, |
| 79 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, | 81 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, |
| 82 | + 4EE7A53224497382008BEE4F /* CoreGraphics.framework in Frameworks */, | ||
| 80 | B9D618F281EA888D94759421 /* Pods_CNLiveBPersonalVerificationModule_Example.framework in Frameworks */, | 83 | B9D618F281EA888D94759421 /* Pods_CNLiveBPersonalVerificationModule_Example.framework in Frameworks */, |
| 81 | ); | 84 | ); |
| 82 | runOnlyForDeploymentPostprocessing = 0; | 85 | runOnlyForDeploymentPostprocessing = 0; |
| @@ -119,6 +122,9 @@ | @@ -119,6 +122,9 @@ | ||
| 119 | 6003F58C195388D20070C39A /* Frameworks */ = { | 122 | 6003F58C195388D20070C39A /* Frameworks */ = { |
| 120 | isa = PBXGroup; | 123 | isa = PBXGroup; |
| 121 | children = ( | 124 | children = ( |
| 125 | + 4EE7A522244970D6008BEE4F /* IdcardQuality.framework */, | ||
| 126 | + 4EE7A51F244970C7008BEE4F /* AipOcrSdk.framework */, | ||
| 127 | + 4EE7A51B244970B8008BEE4F /* AipBase.framework */, | ||
| 122 | 6003F58D195388D20070C39A /* Foundation.framework */, | 128 | 6003F58D195388D20070C39A /* Foundation.framework */, |
| 123 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, | 129 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, |
| 124 | 6003F591195388D20070C39A /* UIKit.framework */, | 130 | 6003F591195388D20070C39A /* UIKit.framework */, |
| @@ -249,6 +255,7 @@ | @@ -249,6 +255,7 @@ | ||
| 249 | TargetAttributes = { | 255 | TargetAttributes = { |
| 250 | 6003F589195388D20070C39A = { | 256 | 6003F589195388D20070C39A = { |
| 251 | DevelopmentTeam = 94X49GG3ZW; | 257 | DevelopmentTeam = 94X49GG3ZW; |
| 258 | + ProvisioningStyle = Automatic; | ||
| 252 | }; | 259 | }; |
| 253 | 6003F5AD195388D20070C39A = { | 260 | 6003F5AD195388D20070C39A = { |
| 254 | TestTargetID = 6003F589195388D20070C39A; | 261 | TestTargetID = 6003F589195388D20070C39A; |
| @@ -353,6 +360,7 @@ | @@ -353,6 +360,7 @@ | ||
| 353 | "${BUILT_PRODUCTS_DIR}/CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule.framework", | 360 | "${BUILT_PRODUCTS_DIR}/CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule.framework", |
| 354 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseClass/CNLiveBaseClass.framework", | 361 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseClass/CNLiveBaseClass.framework", |
| 355 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", | 362 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", |
| 363 | + "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", | ||
| 356 | "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework", | 364 | "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework", |
| 357 | "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", | 365 | "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", |
| 358 | "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework", | 366 | "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework", |
| @@ -375,6 +383,7 @@ | @@ -375,6 +383,7 @@ | ||
| 375 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBPersonalVerificationModule.framework", | 383 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBPersonalVerificationModule.framework", |
| 376 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseClass.framework", | 384 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseClass.framework", |
| 377 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", | 385 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", |
| 386 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", | ||
| 378 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework", | 387 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework", |
| 379 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", | 388 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", |
| 380 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework", | 389 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework", |
| @@ -533,13 +542,18 @@ | @@ -533,13 +542,18 @@ | ||
| 533 | baseConfigurationReference = 2EE018FA9C0FF28273EA7BB2 /* Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig */; | 542 | baseConfigurationReference = 2EE018FA9C0FF28273EA7BB2 /* Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig */; |
| 534 | buildSettings = { | 543 | buildSettings = { |
| 535 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 544 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 545 | + CODE_SIGN_IDENTITY = "Apple Development"; | ||
| 546 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; | ||
| 547 | + CODE_SIGN_STYLE = Automatic; | ||
| 536 | DEVELOPMENT_TEAM = 94X49GG3ZW; | 548 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 537 | GCC_PRECOMPILE_PREFIX_HEADER = YES; | 549 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 538 | GCC_PREFIX_HEADER = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Prefix.pch"; | 550 | GCC_PREFIX_HEADER = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Prefix.pch"; |
| 539 | INFOPLIST_FILE = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Info.plist"; | 551 | INFOPLIST_FILE = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Info.plist"; |
| 552 | + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
| 540 | MODULE_NAME = ExampleApp; | 553 | MODULE_NAME = ExampleApp; |
| 541 | PRODUCT_BUNDLE_IDENTIFIER = CNLiveBPersonalVerificationModule.debug; | 554 | PRODUCT_BUNDLE_IDENTIFIER = CNLiveBPersonalVerificationModule.debug; |
| 542 | PRODUCT_NAME = CNLiveBPersonalVerificationModule; | 555 | PRODUCT_NAME = CNLiveBPersonalVerificationModule; |
| 556 | + PROVISIONING_PROFILE_SPECIFIER = ""; | ||
| 543 | SWIFT_VERSION = 4.0; | 557 | SWIFT_VERSION = 4.0; |
| 544 | WRAPPER_EXTENSION = app; | 558 | WRAPPER_EXTENSION = app; |
| 545 | }; | 559 | }; |
| @@ -550,13 +564,18 @@ | @@ -550,13 +564,18 @@ | ||
| 550 | baseConfigurationReference = 7FEBB718E90600F2D63EAB08 /* Pods-CNLiveBPersonalVerificationModule_Example.release.xcconfig */; | 564 | baseConfigurationReference = 7FEBB718E90600F2D63EAB08 /* Pods-CNLiveBPersonalVerificationModule_Example.release.xcconfig */; |
| 551 | buildSettings = { | 565 | buildSettings = { |
| 552 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 566 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 567 | + CODE_SIGN_IDENTITY = "Apple Development"; | ||
| 568 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; | ||
| 569 | + CODE_SIGN_STYLE = Automatic; | ||
| 553 | DEVELOPMENT_TEAM = 94X49GG3ZW; | 570 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 554 | GCC_PRECOMPILE_PREFIX_HEADER = YES; | 571 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 555 | GCC_PREFIX_HEADER = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Prefix.pch"; | 572 | GCC_PREFIX_HEADER = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Prefix.pch"; |
| 556 | INFOPLIST_FILE = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Info.plist"; | 573 | INFOPLIST_FILE = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Info.plist"; |
| 574 | + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
| 557 | MODULE_NAME = ExampleApp; | 575 | MODULE_NAME = ExampleApp; |
| 558 | PRODUCT_BUNDLE_IDENTIFIER = CNLiveBPersonalVerificationModule.debug; | 576 | PRODUCT_BUNDLE_IDENTIFIER = CNLiveBPersonalVerificationModule.debug; |
| 559 | PRODUCT_NAME = CNLiveBPersonalVerificationModule; | 577 | PRODUCT_NAME = CNLiveBPersonalVerificationModule; |
| 578 | + PROVISIONING_PROFILE_SPECIFIER = ""; | ||
| 560 | SWIFT_VERSION = 4.0; | 579 | SWIFT_VERSION = 4.0; |
| 561 | WRAPPER_EXTENSION = app; | 580 | WRAPPER_EXTENSION = app; |
| 562 | }; | 581 | }; |
Example/CNLiveBPersonalVerificationModule/CNLIVEViewController.m
| @@ -47,14 +47,15 @@ | @@ -47,14 +47,15 @@ | ||
| 47 | [self.navigationController pushViewController:vc animated:NO]; | 47 | [self.navigationController pushViewController:vc animated:NO]; |
| 48 | } | 48 | } |
| 49 | - (void)buttonClick:(UIButton *)sender { | 49 | - (void)buttonClick:(UIButton *)sender { |
| 50 | + | ||
| 50 | if (sender.tag == 200) { | 51 | if (sender.tag == 200) { |
| 51 | - CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:CNBShowCertificatTypeFail]; | 52 | + CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:@{@"checkStatus":@"3"}]; |
| 52 | [self.navigationController pushViewController:vc animated:NO]; | 53 | [self.navigationController pushViewController:vc animated:NO]; |
| 53 | }else if (sender.tag == 201){ | 54 | }else if (sender.tag == 201){ |
| 54 | - CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:CNBShowCertificatTypeNone]; | 55 | + CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:@{@"checkStatus":@"0"}]; |
| 55 | [self.navigationController pushViewController:vc animated:NO]; | 56 | [self.navigationController pushViewController:vc animated:NO]; |
| 56 | }else { | 57 | }else { |
| 57 | - CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:CNBShowCertificatTypeAuditing]; | 58 | + CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:@{@"checkStatus":@"2"}]; |
| 58 | [self.navigationController pushViewController:vc animated:NO]; | 59 | [self.navigationController pushViewController:vc animated:NO]; |
| 59 | } | 60 | } |
| 60 | } | 61 | } |