Commit 228bb539b54514621c334883b95f77a817b21693
1 parent
e63922c7
0.0.2 修改一些UI问题
Showing
12 changed files
with
54 additions
and
27 deletions
CNLiveBPersonalVerificationModule.podspec
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | Pod::Spec.new do |s| |
| 10 | 10 | s.name = 'CNLiveBPersonalVerificationModule' |
| 11 | - s.version = '0.0.1' | |
| 11 | + s.version = '0.0.2' | |
| 12 | 12 | s.summary = 'B端个人资料认证开发' |
| 13 | 13 | |
| 14 | 14 | # This description is used to generate tags and improve search results. |
| ... | ... | @@ -75,7 +75,7 @@ s.subspec 'CNBInstitutionInfo' do |institution| |
| 75 | 75 | # #协议库 |
| 76 | 76 | institution.dependency 'CNLiveBeeHive' |
| 77 | 77 | institution.dependency 'CNLiveBServices' |
| 78 | -institution.resource_bundles = { | |
| 78 | + institution.resource_bundles = { | |
| 79 | 79 | 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle'] |
| 80 | 80 | } |
| 81 | 81 | |
| ... | ... | @@ -96,7 +96,7 @@ s.subspec 'CNBPersonCardInfo' do |card| |
| 96 | 96 | end |
| 97 | 97 | card.ios.vendored_frameworks = 'CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipOcrSdk.framework','CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/AipBase.framework','CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/baiduSDKs/IdcardQuality.framework' |
| 98 | 98 | card.resource_bundles = { |
| 99 | - 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle'] | |
| 99 | + 'CNBPersonCardInfo' => ['CNLiveBPersonalVerificationModule/Assets/CNBPersonCardInfo/CNBPersonCardInfo.bundle'] | |
| 100 | 100 | } |
| 101 | 101 | card.dependency 'CNLiveTripartiteManagement/Masonry' |
| 102 | 102 | card.dependency 'CNLiveTripartiteManagement/QMUIKit' | ... | ... |
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/delete@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/CNBPerdelete@2x.png
814 Bytes
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/delete@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/CNBPerdelete@3x.png
1.31 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/zhuangtai_kong@2x.png
0 → 100644
20.7 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/zhuangtai_kong@3x.png
0 → 100644
41.3 KB
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerAuthSuccessController.m
| ... | ... | @@ -46,14 +46,22 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; |
| 46 | 46 | [self.view addSubview:self.tableView]; |
| 47 | 47 | self.title = @"身份校验"; |
| 48 | 48 | if (self.data && [self.data isKindOfClass:[NSDictionary class]] && self.data.count > 0) { |
| 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]; | |
| 49 | + if ([[self.data allKeys] containsObject:@"institution"]) { | |
| 50 | + NSArray *array = self.data[@"institution"]; | |
| 51 | + if (array.count > 0) { | |
| 52 | + CNBPerCertificationSuccessModel *successModel = [CNBPerCertificationSuccessModel mj_objectWithKeyValues:self.data]; | |
| 53 | + self.infoModel = successModel.bUserIdentity; | |
| 54 | + for (CNBInstitutionModel *model in successModel.institution) { | |
| 55 | + [self.institutionArray addObject:model]; | |
| 56 | + } | |
| 57 | + [self.institutionArray insertObject:successModel.bUserIdentity atIndex:0]; | |
| 58 | + [self.tableView reloadData]; | |
| 59 | + }else { | |
| 60 | + [self showEmptyView:CNBPerAuthErrorTypeNoData]; | |
| 61 | + } | |
| 62 | + }else { | |
| 63 | + [self showEmptyView:CNBPerAuthErrorTypeNoData]; | |
| 53 | 64 | } |
| 54 | - [self.institutionArray insertObject:successModel.bUserIdentity atIndex:0]; | |
| 55 | - [self.tableView reloadData]; | |
| 56 | - | |
| 57 | 65 | }else { |
| 58 | 66 | [self requestPerAuthSuccessData]; |
| 59 | 67 | } |
| ... | ... | @@ -66,14 +74,25 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; |
| 66 | 74 | if (!strongSelf) { |
| 67 | 75 | return ; |
| 68 | 76 | } |
| 69 | - CNBPerCertificationSuccessModel *successModel = dataArray[0]; | |
| 70 | - strongSelf.infoModel = successModel.bUserIdentity; | |
| 71 | - for (CNBInstitutionModel *model in successModel.institution) { | |
| 72 | - [strongSelf.institutionArray addObject:model]; | |
| 77 | + if (dataArray.count > 0) { | |
| 78 | + CNBPerCertificationSuccessModel *successModel = dataArray[0]; | |
| 79 | + if (successModel.bUserIdentity && successModel.institution.count > 0) { | |
| 80 | + strongSelf.infoModel = successModel.bUserIdentity; | |
| 81 | + for (CNBInstitutionModel *model in successModel.institution) { | |
| 82 | + [strongSelf.institutionArray addObject:model]; | |
| 83 | + } | |
| 84 | + [strongSelf.emptyView removeFromSuperview ]; | |
| 85 | + strongSelf.tableView.tableFooterView = [UIView new]; | |
| 86 | + [strongSelf.institutionArray insertObject:successModel.bUserIdentity atIndex:0]; | |
| 87 | + [strongSelf.tableView reloadData]; | |
| 88 | + }else { | |
| 89 | + [strongSelf showEmptyView:CNBPerAuthErrorTypeNoData]; | |
| 90 | + } | |
| 91 | + | |
| 92 | + }else { | |
| 93 | + [strongSelf showEmptyView:CNBPerAuthErrorTypeNoData]; | |
| 73 | 94 | } |
| 74 | - [strongSelf.emptyView removeFromSuperview ]; | |
| 75 | - [strongSelf.institutionArray insertObject:successModel.bUserIdentity atIndex:0]; | |
| 76 | - [strongSelf.tableView reloadData]; | |
| 95 | + | |
| 77 | 96 | } failureBlock:^(NSError * _Nonnull error) { |
| 78 | 97 | if (error.code == -1009 || error.code == -1001) { |
| 79 | 98 | [weakSelf showEmptyView:CNBPerAuthErrorTypeNoNet]; |
| ... | ... | @@ -99,8 +118,14 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; |
| 99 | 118 | imageName = @"wufalianjie"; |
| 100 | 119 | titleName = @"接口开小差了,试试重新请求"; |
| 101 | 120 | retryName = @"重试"; |
| 121 | + }else if (errorType == CNBPerAuthErrorTypeNoData) { | |
| 122 | + imageName = @"zhuangtai_kong"; | |
| 123 | + titleName = @"暂无您的身份内容"; | |
| 124 | + retryName = @""; | |
| 102 | 125 | } |
| 103 | 126 | [self.emptyView showImage:[CNLivePerAuthGetImage cnLivePerAuth_getImageName:imageName bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]] title:titleName detailTitle:@"" retryBtnTitle:retryName]; |
| 127 | + BOOL isHidden = errorType == CNBPerAuthErrorTypeNoData; | |
| 128 | + self.emptyView.retryBtn.hidden = isHidden; | |
| 104 | 129 | self.emptyView.retryBtn.backgroundColor = kWhiteColor; |
| 105 | 130 | self.emptyView.retryBtn.layer.masksToBounds = YES; |
| 106 | 131 | self.emptyView.retryBtn.layer.cornerRadius = 14; |
| ... | ... | @@ -108,7 +133,7 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; |
| 108 | 133 | self.emptyView.retryBtn.layer.borderColor = CNLiveColorWithHexString(@"48A7F9").CGColor; |
| 109 | 134 | [self.emptyView.retryBtn setTitleColor:CNLiveColorWithHexString(@"48A7F9") forState:UIControlStateNormal]; |
| 110 | 135 | [self.emptyView.retryBtn setTitleColor:CNLiveColorWithHexString(@"48A7F9") forState:UIControlStateHighlighted]; |
| 111 | - [self.view addSubview:self.emptyView]; | |
| 136 | + errorType == CNBPerAuthErrorTypeNoData ? self.tableView.tableFooterView = self.emptyView :[self.view addSubview:self.emptyView]; | |
| 112 | 137 | [self.emptyView.retryBtn addTarget:self action:@selector(retryloadData) forControlEvents:UIControlEventTouchUpInside]; |
| 113 | 138 | } |
| 114 | 139 | #pragma mark - tableViewDelegateAndDataSource |
| ... | ... | @@ -221,7 +246,8 @@ static NSString *groupIdentifier = @"CNBGroupInfoCell"; |
| 221 | 246 | } |
| 222 | 247 | - (CNEmptyView *)emptyView { |
| 223 | 248 | if (!_emptyView) { |
| 224 | - _emptyView = [[CNEmptyView alloc]initWithFrame:CGRectMake(0, kNavigationBarHeight, KScreenWidth, KScreenHeight - kNavigationBarHeight) type:1]; | |
| 249 | + _emptyView = [[CNEmptyView alloc]initWithFrame:CGRectMake(0, kNavigationBarHeight, KScreenWidth, KScreenHeight - kNavigationBarHeight) type:0]; | |
| 250 | + _emptyView.backgroundColor = [UIColor whiteColor]; | |
| 225 | 251 | } |
| 226 | 252 | return _emptyView; |
| 227 | 253 | } | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPersonalVerificationController.m
| ... | ... | @@ -324,8 +324,7 @@ |
| 324 | 324 | [instritutionArray addObject:instritutionDic]; |
| 325 | 325 | } |
| 326 | 326 | [submitDic setObject:instritutionArray forKey:@"Institution"]; |
| 327 | - [submitDic setObject:@"10511059" forKey:@"sid"]; | |
| 328 | - | |
| 327 | + [submitDic setObject:CNUserShareModelUid forKey:@"sid"]; | |
| 329 | 328 | NSString *submitStr = [self objectToJson:submitDic]; |
| 330 | 329 | submitStr = [submitStr stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"]; |
| 331 | 330 | __weak typeof(self) weakSelf = self; | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Services/CNBPersonAuthenticationServices.h
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthHeaderView.m
| ... | ... | @@ -78,7 +78,7 @@ |
| 78 | 78 | - (QMUIButton *)deleteBtn { |
| 79 | 79 | if (!_deleteBtn) { |
| 80 | 80 | _deleteBtn = [[QMUIButton alloc]init]; |
| 81 | - [_deleteBtn setImage:[CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"delete" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]] forState:UIControlStateNormal]; | |
| 81 | + [_deleteBtn setImage:[CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"CNBPerdelete" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]] forState:UIControlStateNormal]; | |
| 82 | 82 | [_deleteBtn addTarget:self action:@selector(deleteBtnAction) forControlEvents:UIControlEventTouchUpInside]; |
| 83 | 83 | _deleteBtn.hidden = YES; |
| 84 | 84 | } | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthTypeRadioView.m
| ... | ... | @@ -468,7 +468,8 @@ |
| 468 | 468 | } |
| 469 | 469 | - (CNEmptyView *)emptyView { |
| 470 | 470 | if (!_emptyView) { |
| 471 | - _emptyView = [[CNEmptyView alloc]initWithFrame:CGRectMake(0, KScreenHeight/4 +kNavigationBarHeight, KScreenWidth, KScreenHeight*3/4 - kNavigationBarHeight - kVerticalBottomSafeHeight) type:1]; | |
| 471 | + _emptyView = [[CNEmptyView alloc]initWithFrame:CGRectMake(0, KScreenHeight/4 +kNavigationBarHeight + 40, KScreenWidth, KScreenHeight*3/4 - kNavigationBarHeight - kVerticalBottomSafeHeight - 40) type:0]; | |
| 472 | + _emptyView.backgroundColor = [UIColor whiteColor]; | |
| 472 | 473 | } |
| 473 | 474 | return _emptyView; |
| 474 | 475 | } | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNBPerAuthViewModel.m
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | #import "CNBPerCertificationSuccessModel.h" |
| 14 | 14 | #import "CNLiveBaseKit.h" |
| 15 | 15 | #import "CNLiveEnvironment.h" |
| 16 | +#import "CNUserInfoManager.h" | |
| 16 | 17 | #define CNBAppKeyWindow ([UIApplication sharedApplication].delegate).window |
| 17 | 18 | @implementation CNBPerAuthViewModel |
| 18 | 19 | #pragma mark - 请求机构等列表 |
| ... | ... | @@ -21,8 +22,8 @@ |
| 21 | 22 | @"spId": CNLiveStringIsEmpty(spId) ? @"": spId, |
| 22 | 23 | @"type" : CNLiveStringIsEmpty(type) ? @"": type, |
| 23 | 24 | @"homepageId":CNLiveStringIsEmpty(homepageId) ? @"": homepageId, |
| 24 | - @"page": [NSString stringWithFormat:@"%ld",page], | |
| 25 | - @"pageSize":[NSString stringWithFormat:@"%d",10], | |
| 25 | + @"page": [NSString stringWithFormat:@"%ld",(long)page], | |
| 26 | + @"pageSize":[NSString stringWithFormat:@"%d",10] | |
| 26 | 27 | }; |
| 27 | 28 | |
| 28 | 29 | [CNLiveNetworking setupShowDataResult:NO]; |
| ... | ... | @@ -83,6 +84,7 @@ |
| 83 | 84 | + (void)getPerAuthSuccessList:(void (^)(NSMutableArray *dataArray))successBlock failureBlock:(void (^)(NSError * error))failureBlock { |
| 84 | 85 | NSDictionary *param = @{ |
| 85 | 86 | @"sid":@"10513196" |
| 87 | +// @"sid":CNUserShareModelUid | |
| 86 | 88 | }; |
| 87 | 89 | [CNLiveNetworking setupShowDataResult:NO]; |
| 88 | 90 | [CNLiveNetworking setAllowRequestDefaultArgument:YES]; |
| ... | ... | @@ -98,7 +100,6 @@ |
| 98 | 100 | if (responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]) { |
| 99 | 101 | CNBPerCertificationSuccessModel *model = [CNBPerCertificationSuccessModel mj_objectWithKeyValues:responseObject[@"data"]]; |
| 100 | 102 | [array addObject:model]; |
| 101 | - | |
| 102 | 103 | } |
| 103 | 104 | !successBlock ? :successBlock(array); |
| 104 | 105 | }else { | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNLivePerAuthGetImage.m