Commit 697128a9f98a2544b555c4004ab1df923321e76d
1 parent
bd81a42b
添加loading,修改偏移,解决释放问题
Showing
1 changed file
with
29 additions
and
22 deletions
CNLiveBPersonalVerificationModule/Classes/CNBPersonCardInfo/Controller/ApplyForShootController.m
| ... | ... | @@ -72,11 +72,11 @@ |
| 72 | 72 | [[AipOcrService shardService] authWithAK:BDAppKey andSK:BDSecret]; |
| 73 | 73 | [self loadData]; |
| 74 | 74 | [self.view addSubview:self.tableView]; |
| 75 | - if (@available(iOS 11.0, *)) { | |
| 76 | - self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | |
| 77 | - }else{ | |
| 78 | - self.automaticallyAdjustsScrollViewInsets = NO; | |
| 79 | - } | |
| 75 | +// if (@available(iOS 11.0, *)) { | |
| 76 | +// self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | |
| 77 | +// }else{ | |
| 78 | +// self.automaticallyAdjustsScrollViewInsets = NO; | |
| 79 | +// } | |
| 80 | 80 | [self configCallback]; |
| 81 | 81 | |
| 82 | 82 | } |
| ... | ... | @@ -137,7 +137,7 @@ |
| 137 | 137 | weakSelf.isFontSucc = NO; |
| 138 | 138 | NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; |
| 139 | 139 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 140 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 140 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 141 | 141 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 142 | 142 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 143 | 143 | }]; |
| ... | ... | @@ -151,7 +151,7 @@ |
| 151 | 151 | weakSelf.isBackSucc = NO; |
| 152 | 152 | NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; |
| 153 | 153 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 154 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 154 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 155 | 155 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 156 | 156 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 157 | 157 | }]; |
| ... | ... | @@ -163,7 +163,7 @@ |
| 163 | 163 | weakSelf.isBackSucc = NO; |
| 164 | 164 | NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; |
| 165 | 165 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 166 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 166 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 167 | 167 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 168 | 168 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 169 | 169 | }]; |
| ... | ... | @@ -193,14 +193,14 @@ |
| 193 | 193 | weakSelf.isFontSucc = NO; |
| 194 | 194 | NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; |
| 195 | 195 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 196 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 196 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 197 | 197 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 198 | 198 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 199 | 199 | } else { |
| 200 | 200 | weakSelf.isBackSucc = NO; |
| 201 | 201 | NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; |
| 202 | 202 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 203 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 203 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 204 | 204 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 205 | 205 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 206 | 206 | } |
| ... | ... | @@ -261,7 +261,7 @@ |
| 261 | 261 | weakSelf.isFontSucc = NO; |
| 262 | 262 | NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; |
| 263 | 263 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 264 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 264 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 265 | 265 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 266 | 266 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 267 | 267 | }]; |
| ... | ... | @@ -275,7 +275,7 @@ |
| 275 | 275 | weakSelf.isBackSucc = NO; |
| 276 | 276 | NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; |
| 277 | 277 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 278 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 278 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 279 | 279 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 280 | 280 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 281 | 281 | }]; |
| ... | ... | @@ -296,14 +296,14 @@ |
| 296 | 296 | weakSelf.isFontSucc = NO; |
| 297 | 297 | NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; |
| 298 | 298 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 299 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 299 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 300 | 300 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 301 | 301 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 302 | 302 | } else { |
| 303 | 303 | weakSelf.isBackSucc = NO; |
| 304 | 304 | NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; |
| 305 | 305 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 306 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 306 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 307 | 307 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 308 | 308 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 309 | 309 | } |
| ... | ... | @@ -361,14 +361,14 @@ |
| 361 | 361 | weakSelf.isFontSucc = NO; |
| 362 | 362 | NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; |
| 363 | 363 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 364 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 364 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 365 | 365 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 366 | 366 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 367 | 367 | } else { |
| 368 | 368 | weakSelf.isBackSucc = NO; |
| 369 | 369 | NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; |
| 370 | 370 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 371 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 371 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 372 | 372 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 373 | 373 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 374 | 374 | } |
| ... | ... | @@ -396,14 +396,14 @@ |
| 396 | 396 | weakSelf.isFontSucc = NO; |
| 397 | 397 | NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; |
| 398 | 398 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 399 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 399 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_front" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 400 | 400 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 401 | 401 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 402 | 402 | } else { |
| 403 | 403 | weakSelf.isBackSucc = NO; |
| 404 | 404 | NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0]; |
| 405 | 405 | ApplyForShootCell *cell = [weakSelf.tableView cellForRowAtIndexPath:index]; |
| 406 | - cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[self class]]; | |
| 406 | + cell.imgV.image = [CNLiveIDCardAuthGetImage cnLiveIDCardAuth_getImageName:@"observer_idcard_back" bundle:@"CNBPersonCardInfo.bundle/CNBPersonCardInfo" targetClass:[ApplyForShootController class]]; | |
| 407 | 407 | weakSelf.confirmCell.confirmButton.backgroundColor = RGB(216, 216, 216); |
| 408 | 408 | [weakSelf.confirmCell.confirmButton setTitleColor:RGB(180, 180, 180) forState:UIControlStateNormal]; |
| 409 | 409 | } |
| ... | ... | @@ -503,7 +503,7 @@ |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | NSMutableDictionary *params = [@{ |
| 506 | - @"sid" : CNUserShareModel.uid?CNUserShareModel.uid:@"", | |
| 506 | + @"sid" : @"10505015",//CNUserShareModel.uid?CNUserShareModel.uid:@"", | |
| 507 | 507 | @"realName" : self.realName?self.realName:@"", |
| 508 | 508 | @"idCardNo" : self.idCardNo?self.idCardNo:@"", |
| 509 | 509 | @"address" : self.address?self.address:@"", |
| ... | ... | @@ -513,6 +513,7 @@ |
| 513 | 513 | |
| 514 | 514 | __weak typeof(self) weakSelf = self; |
| 515 | 515 | AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; |
| 516 | + [QMUITips showLoadingInView:self.view]; | |
| 516 | 517 | [manager POST:@"https://apiwjjtest.cnlive.com/Daren/buser/saveIdentity.action" parameters:para headers:nil constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) { |
| 517 | 518 | |
| 518 | 519 | NSData *fontData = [weakSelf imageDatasWithImage:self.fontImage]; |
| ... | ... | @@ -539,8 +540,13 @@ |
| 539 | 540 | |
| 540 | 541 | } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { |
| 541 | 542 | |
| 542 | - NSLog(@"%@-提示信息:%@",responseObject,responseObject[@"errorMessage"]); | |
| 543 | - | |
| 543 | + [QMUITips hideAllTipsInView:self.view]; | |
| 544 | + if (!responseObject) { | |
| 545 | + sender.selected = !sender.selected; | |
| 546 | + sender.userInteractionEnabled = YES; | |
| 547 | + [QMUITips showError:@"接口错误,请稍后重试!" inView:self.view hideAfterDelay:1.5]; | |
| 548 | + return ; | |
| 549 | + } | |
| 544 | 550 | if ([[NSString stringWithFormat:@"%@",responseObject[@"errorCode"]] isEqualToString:@"0"]) { |
| 545 | 551 | |
| 546 | 552 | //成功 |
| ... | ... | @@ -559,6 +565,7 @@ |
| 559 | 565 | |
| 560 | 566 | } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { |
| 561 | 567 | |
| 568 | + [QMUITips hideAllTipsInView:self.view]; | |
| 562 | 569 | sender.selected = !sender.selected; |
| 563 | 570 | sender.userInteractionEnabled = YES; |
| 564 | 571 | [QMUITips showError:error.localizedDescription inView:self.view hideAfterDelay:1.5]; |
| ... | ... | @@ -859,7 +866,7 @@ |
| 859 | 866 | #pragma mark - SubViews |
| 860 | 867 | -(UITableView *)tableView { |
| 861 | 868 | if (!_tableView) { |
| 862 | - _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight, KScreenWidth, KScreenHeight-kNavigationBarHeight) style:UITableViewStylePlain]; | |
| 869 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight) style:UITableViewStylePlain]; | |
| 863 | 870 | _tableView.backgroundColor = RGB(242, 242, 242); |
| 864 | 871 | _tableView.delegate = self; |
| 865 | 872 | _tableView.dataSource = self; | ... | ... |