Commit f219a73d4039c4ee7831bf9030242a531c3954ba

Authored by 梁星国
1 parent 99ded1d6

提交UI更改

CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Controller/CNLiveBOraganizationDetailController.h
@@ -6,11 +6,14 @@ @@ -6,11 +6,14 @@
6 // 6 //
7 7
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
  9 +#import "CNLiveOrganizationDetailModel.h"
9 10
10 NS_ASSUME_NONNULL_BEGIN 11 NS_ASSUME_NONNULL_BEGIN
11 12
12 @interface CNLiveBOraganizationDetailController : UIViewController 13 @interface CNLiveBOraganizationDetailController : UIViewController
13 14
  15 +@property (nonatomic, strong) CNLiveOrganizationDetailModel *detailModel;
  16 +
14 @end 17 @end
15 18
16 NS_ASSUME_NONNULL_END 19 NS_ASSUME_NONNULL_END
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Controller/CNLiveBOraganizationDetailController.m
@@ -17,6 +17,9 @@ @@ -17,6 +17,9 @@
17 #import <CNLiveBeeHive/CNLiveBeeHive.h> 17 #import <CNLiveBeeHive/CNLiveBeeHive.h>
18 #import "CNLiveOrganizationDetailModel.h" 18 #import "CNLiveOrganizationDetailModel.h"
19 #import <MJExtension/MJExtension.h> 19 #import <MJExtension/MJExtension.h>
  20 +#import <QMUIKit/QMUIKit.h>
  21 +#import <YYKit/YYKit.h>
  22 +#import <objc/runtime.h>
20 23
21 24
22 //体育中国-详情 25 //体育中国-详情
@@ -46,7 +49,7 @@ @@ -46,7 +49,7 @@
46 { 49 {
47 self = [super init]; 50 self = [super init];
48 if (self) { 51 if (self) {
49 - 52 + self.detailModel = [[CNLiveOrganizationDetailModel alloc]init];
50 } 53 }
51 return self; 54 return self;
52 } 55 }
@@ -84,7 +87,9 @@ @@ -84,7 +87,9 @@
84 [self.view addSubview:self.tableView]; 87 [self.view addSubview:self.tableView];
85 self.tableView.tableHeaderView = self.headerView; 88 self.tableView.tableHeaderView = self.headerView;
86 89
87 -// self.tableView.tableFooterView = self.footerView; 90 + if (!self.detailModel.account) {
  91 + [self loadData];
  92 + }
88 93
89 } 94 }
90 95
@@ -121,13 +126,13 @@ @@ -121,13 +126,13 @@
121 if (indexPath.section == 0) { 126 if (indexPath.section == 0) {
122 if (indexPath.row == 1 || indexPath.row == 12) { 127 if (indexPath.row == 1 || indexPath.row == 12) {
123 CNLiveBOrganizationImageVDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationImageVDetailCell forIndexPath:indexPath]; 128 CNLiveBOrganizationImageVDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationImageVDetailCell forIndexPath:indexPath];
124 - [cell editUIWithIndexPath:indexPath]; 129 + [cell editUIWithIndexPath:indexPath detailModel:self.detailModel];
125 return cell; 130 return cell;
126 131
127 132
128 }else { 133 }else {
129 CNLiveBOrganizationDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationDetailCell forIndexPath:indexPath]; 134 CNLiveBOrganizationDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationDetailCell forIndexPath:indexPath];
130 - [cell editUIWithIndexPath:indexPath]; 135 + [cell editUIWithIndexPath:indexPath detailModel:self.detailModel];
131 return cell; 136 return cell;
132 } 137 }
133 138
@@ -213,10 +218,11 @@ @@ -213,10 +218,11 @@
213 @"sid": [NSString stringWithFormat:@"%@",CNUserShareModel.uid], 218 @"sid": [NSString stringWithFormat:@"%@",CNUserShareModel.uid],
214 @"sign":@"" 219 @"sign":@""
215 }; 220 };
216 - 221 + [QMUITips showLoadingInView:self.view];
217 [CNLiveNetworking setAllowRequestDefaultArgument:YES]; 222 [CNLiveNetworking setAllowRequestDefaultArgument:YES];
218 [CNLiveNetworking setupShowDataResult:NO]; 223 [CNLiveNetworking setupShowDataResult:NO];
219 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { 224 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  225 + [QMUITips hideAllTipsInView:self.view];
220 226
221 NSLog(@"点播详情数据 = %@",responseObject); 227 NSLog(@"点播详情数据 = %@",responseObject);
222 228
@@ -233,10 +239,13 @@ @@ -233,10 +239,13 @@
233 } 239 }
234 } 240 }
235 241
236 - CNLiveOrganizationDetailModel *detailModel = [CNLiveOrganizationDetailModel mj_objectWithKeyValues:data];  
237 -  
238 - [self.tableView reloadData];  
239 - 242 + if (!error) {
  243 + CNLiveOrganizationDetailModel *detailModel = [CNLiveOrganizationDetailModel mj_objectWithKeyValues:data];
  244 + self.detailModel = detailModel;
  245 + [self.tableView reloadData];
  246 +
  247 + }
  248 +#pragma mark - TODO: 报错信息
240 249
241 }]; 250 }];
242 251
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Controller/CNLiveBOrganizationValidattionController.h
@@ -6,11 +6,15 @@ @@ -6,11 +6,15 @@
6 // 6 //
7 7
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
  9 +#import "CNLiveOrganizationDetailModel.h"
9 10
10 NS_ASSUME_NONNULL_BEGIN 11 NS_ASSUME_NONNULL_BEGIN
11 12
12 @interface CNLiveBOrganizationValidattionController : UIViewController 13 @interface CNLiveBOrganizationValidattionController : UIViewController
13 14
  15 +
  16 +@property (nonatomic, strong) CNLiveOrganizationDetailModel *detailModel;
  17 +
14 @end 18 @end
15 19
16 NS_ASSUME_NONNULL_END 20 NS_ASSUME_NONNULL_END
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Controller/CNLiveBOrganizationValidattionController.m
@@ -24,9 +24,9 @@ @@ -24,9 +24,9 @@
24 #import <CNLiveRequestBastKit/CNLiveNetworking.h> 24 #import <CNLiveRequestBastKit/CNLiveNetworking.h>
25 #import <CNLiveUserManagement/CNUserInfoManager.h> 25 #import <CNLiveUserManagement/CNUserInfoManager.h>
26 #import <CNLiveBeeHive/CNLiveBeeHive.h> 26 #import <CNLiveBeeHive/CNLiveBeeHive.h>
27 -#import "CNLiveOrganizationDetailModel.h"  
28 #import <MJExtension/MJExtension.h> 27 #import <MJExtension/MJExtension.h>
29 #import <CNLiveUploadManager/CNLiveUploadManager.h> 28 #import <CNLiveUploadManager/CNLiveUploadManager.h>
  29 +#import <YYKit/YYKit.h>
30 30
31 31
32 32
@@ -57,8 +57,6 @@ @@ -57,8 +57,6 @@
57 57
58 @property (nonatomic, strong) UIImagePickerController *pickerVC; 58 @property (nonatomic, strong) UIImagePickerController *pickerVC;
59 59
60 -@property (nonatomic, strong) CNLiveOrganizationDetailModel *detailModel;  
61 -  
62 @property (nonatomic, strong) NSMutableArray *tipArray; 60 @property (nonatomic, strong) NSMutableArray *tipArray;
63 61
64 /** 1公司全称*/ 62 /** 1公司全称*/
@@ -95,6 +93,9 @@ @@ -95,6 +93,9 @@
95 /** 标记点击第几个*/ 93 /** 标记点击第几个*/
96 @property (nonatomic, assign) NSInteger selectRow; 94 @property (nonatomic, assign) NSInteger selectRow;
97 95
  96 +@property (nonatomic, strong) UITextField *selectedTF;
  97 +@property (nonatomic, strong) UITextView *selectedTV;
  98 +
98 99
99 @end 100 @end
100 101
@@ -107,7 +108,8 @@ @@ -107,7 +108,8 @@
107 { 108 {
108 self = [super init]; 109 self = [super init];
109 if (self) { 110 if (self) {
110 - 111 + self.tipArray = [NSMutableArray array];
  112 + self.detailModel = [[CNLiveOrganizationDetailModel alloc]init];
111 } 113 }
112 return self; 114 return self;
113 } 115 }
@@ -124,11 +126,10 @@ @@ -124,11 +126,10 @@
124 - (void)viewDidLoad { 126 - (void)viewDidLoad {
125 [super viewDidLoad]; 127 [super viewDidLoad];
126 128
127 - self.tipArray = [NSMutableArray array];  
128 - self.detailModel = [[CNLiveOrganizationDetailModel alloc]init]; 129 +
  130 +
129 131
130 [self editUI]; 132 [self editUI];
131 - [self loadData];  
132 } 133 }
133 134
134 - (void)viewDidAppear:(BOOL)animated { 135 - (void)viewDidAppear:(BOOL)animated {
@@ -180,9 +181,11 @@ @@ -180,9 +181,11 @@
180 181
181 -(void)textFieldDidBeginEditing:(UITextField *)textField 182 -(void)textFieldDidBeginEditing:(UITextField *)textField
182 { 183 {
  184 + self.selectedTF = textField;
183 if (!textField.superview || !textField) { 185 if (!textField.superview || !textField) {
184 return; 186 return;
185 } 187 }
  188 +
186 CNLiveBOrganizationTextField *TF = (CNLiveBOrganizationTextField *)textField; 189 CNLiveBOrganizationTextField *TF = (CNLiveBOrganizationTextField *)textField;
187 if ([TF.superview isKindOfClass:[CNLiveBOrganizationTFCell class]]) { 190 if ([TF.superview isKindOfClass:[CNLiveBOrganizationTFCell class]]) {
188 NSIndexPath *indexpath = [self.tableView indexPathForCell:((CNLiveBOrganizationTFCell *)textField.superview)]; 191 NSIndexPath *indexpath = [self.tableView indexPathForCell:((CNLiveBOrganizationTFCell *)textField.superview)];
@@ -251,6 +254,8 @@ @@ -251,6 +254,8 @@
251 254
252 -(void)textViewDidBeginEditing:(UITextView *)textView 255 -(void)textViewDidBeginEditing:(UITextView *)textView
253 { 256 {
  257 +
  258 + self.selectedTV = textView;
254 if (!textView.superview || !textView) { 259 if (!textView.superview || !textView) {
255 return; 260 return;
256 } 261 }
@@ -322,6 +327,7 @@ @@ -322,6 +327,7 @@
322 [selectedCell editUIWithIndexPath:indexPath tipModel:self.tipModel]; 327 [selectedCell editUIWithIndexPath:indexPath tipModel:self.tipModel];
323 __weak typeof(self) weakSelf = self; 328 __weak typeof(self) weakSelf = self;
324 selectedCell.clickSelectedCellBlock = ^(CNLiveBOrganizationSelectedCell * _Nonnull selectedCell, CNLiveBOrganizationButton * _Nonnull selectedBtn) { 329 selectedCell.clickSelectedCellBlock = ^(CNLiveBOrganizationSelectedCell * _Nonnull selectedCell, CNLiveBOrganizationButton * _Nonnull selectedBtn) {
  330 +
325 [weakSelf popView]; 331 [weakSelf popView];
326 }; 332 };
327 return selectedCell; 333 return selectedCell;
@@ -419,8 +425,22 @@ @@ -419,8 +425,22 @@
419 /** 点击cell实现 */ 425 /** 点击cell实现 */
420 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 426 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
421 427
  428 + if (self.selectedTF) {
  429 + if ([self.selectedTF isFirstResponder]) {
  430 + [self.selectedTF resignFirstResponder];
  431 + }
  432 + }
  433 +
  434 + if (self.selectedTV) {
  435 + if ([self.selectedTV isFirstResponder]) {
  436 + [self.selectedTV resignFirstResponder];
  437 + }
  438 + }
  439 +
  440 +
422 if (indexPath.section == 0) { 441 if (indexPath.section == 0) {
423 if (indexPath.row == 1) { 442 if (indexPath.row == 1) {
  443 +
424 [self.photoSelecctedView popViewForView:self.view]; 444 [self.photoSelecctedView popViewForView:self.view];
425 __weak typeof(self) weakSelf = self; 445 __weak typeof(self) weakSelf = self;
426 self.photoSelecctedView.clickViewBlock = ^(CNLiveBOrganizationPhotoSelectedView * _Nonnull view, NSInteger indexCount) { 446 self.photoSelecctedView.clickViewBlock = ^(CNLiveBOrganizationPhotoSelectedView * _Nonnull view, NSInteger indexCount) {
@@ -663,101 +683,124 @@ @@ -663,101 +683,124 @@
663 683
664 684
665 NSLog(@"公司全称 = %@,企业logo上传路径 = %@,企业简称 = %@,企业代码 = %@,企业简介 = %@,企业地址 = %@,选择企业类型 = %@,webUrl = %@,法人 = %@,联系人* = %@,合同编号 = %@,营业执照编号 = %@,营业执照 = %@",self.companyName,self.logoUrl,self.companyShortName,self.companyId,self.companyContent,self.companyAdress,self.tipModel.name,self.webUrl,self.legalPerson,self.contact,self.contractCount,self.licenseCount,self.licenseImageUrl); 685 NSLog(@"公司全称 = %@,企业logo上传路径 = %@,企业简称 = %@,企业代码 = %@,企业简介 = %@,企业地址 = %@,选择企业类型 = %@,webUrl = %@,法人 = %@,联系人* = %@,合同编号 = %@,营业执照编号 = %@,营业执照 = %@",self.companyName,self.logoUrl,self.companyShortName,self.companyId,self.companyContent,self.companyAdress,self.tipModel.name,self.webUrl,self.legalPerson,self.contact,self.contractCount,self.licenseCount,self.licenseImageUrl);
666 - // self.footerView.agreementBtn  
667 -  
668 -  
669 686
670 // CNLiveBAgreementCommitFinishController *commitVC = [[CNLiveBAgreementCommitFinishController alloc]init]; 687 // CNLiveBAgreementCommitFinishController *commitVC = [[CNLiveBAgreementCommitFinishController alloc]init];
671 // [self.navigationController pushViewController:commitVC animated:YES]; 688 // [self.navigationController pushViewController:commitVC animated:YES];
672 689
673 -// if (!self.footerView.agreementBtn.isSelected) {  
674 -// [QMUITips showWithText:@"请同意安全协议" inView:AppKeyWindow hideAfterDelay:0.5];  
675 -// return;  
676 -// }  
677 -//  
678 -// if (!self.companyName || self.companyName.length == 0) {  
679 -// [QMUITips showWithText:@"请输入公司全称" inView:AppKeyWindow hideAfterDelay:0.5];  
680 -// return;  
681 -// }  
682 -//  
683 -// if (!self.logoImage) {  
684 -// [QMUITips showWithText:@"请选择企业logo" inView:AppKeyWindow hideAfterDelay:0.5];  
685 -// return;  
686 -// }  
687 -//  
688 -// if (!self.companyShortName || self.companyShortName.length == 0) {  
689 -// [QMUITips showWithText:@"请输入企业简称" inView:AppKeyWindow hideAfterDelay:0.5];  
690 -// return;  
691 -// }  
692 -//  
693 -// if (!self.tipModel) {  
694 -// [QMUITips showWithText:@"请选择企业类型" inView:AppKeyWindow hideAfterDelay:0.5];  
695 -// return;  
696 -// }  
697 -//  
698 -// if (!self.webUrl || self.webUrl.length == 0) {  
699 -// [QMUITips showWithText:@"请输入企业网站访问链接" inView:AppKeyWindow hideAfterDelay:0.5];  
700 -// return;  
701 -// }  
702 -//  
703 -// if (!self.legalPerson || self.legalPerson.length == 0) {  
704 -// [QMUITips showWithText:@"请输入企业法人姓名" inView:AppKeyWindow hideAfterDelay:0.5];  
705 -// return;  
706 -// }  
707 -//  
708 -// if (!self.contact || self.contact.length == 0) {  
709 -// [QMUITips showWithText:@"请输入企业联系人姓名" inView:AppKeyWindow hideAfterDelay:0.5];  
710 -// return;  
711 -// }  
712 -//  
713 -// if (!self.licenseCount || self.licenseCount.length == 0) {  
714 -// [QMUITips showWithText:@"请输入营业执照号" inView:AppKeyWindow hideAfterDelay:0.5];  
715 -// return;  
716 -// }  
717 -//  
718 -// if (!self.licenseImage) {  
719 -// [QMUITips showWithText:@"请选择营业执照" inView:AppKeyWindow hideAfterDelay:0.5];  
720 -// return;  
721 -// }  
722 -//  
723 -// NSDictionary *dic = @{  
724 -// @"d":@"1"  
725 -// };  
726 -//  
727 -// NSString *url = [NSString stringWithFormat:@"%@",CNLiveBOrganizationUpImageUrl];  
728 -//  
729 -// [CNLiveUploadManager uploadRequestType:CNLiveUploadTypeThird url:url dic:dic image:self.logoImage isOriginal:YES limitType:AppPhototLimitTypeFriendsCircle progress:^(float progress) {  
730 -//  
731 -// } success:^(CNLiveUploadModel *uploadModel) {  
732 -//  
733 -//  
734 -// NSLog(@"成功----------");  
735 -// NSDictionary *dic = @{  
736 -// @"d":@"0"  
737 -// };  
738 -// [CNLiveUploadManager uploadRequestType:CNLiveUploadTypeThird url:url dic:dic image:self.licenseImage isOriginal:YES limitType:AppPhototLimitTypeFriendsCircle progress:^(float progress) {  
739 -//  
740 -// } success:^(CNLiveUploadModel *uploadModel) {  
741 -// 690 + if (!self.footerView.agreementBtn.isSelected) {
  691 + [QMUITips showWithText:@"请同意安全协议" inView:AppKeyWindow hideAfterDelay:0.5];
  692 + return;
  693 + }
  694 +
  695 + if (!self.companyName || self.companyName.length == 0) {
  696 + [QMUITips showWithText:@"请输入公司全称" inView:AppKeyWindow hideAfterDelay:0.5];
  697 + return;
  698 + }
  699 +
  700 + if (!self.logoImage) {
  701 + [QMUITips showWithText:@"请选择企业logo" inView:AppKeyWindow hideAfterDelay:0.5];
  702 + return;
  703 + }
  704 +
  705 + if (!self.companyShortName || self.companyShortName.length == 0) {
  706 + [QMUITips showWithText:@"请输入企业简称" inView:AppKeyWindow hideAfterDelay:0.5];
  707 + return;
  708 + }
  709 +
  710 + if (!self.tipModel) {
  711 + [QMUITips showWithText:@"请选择企业类型" inView:AppKeyWindow hideAfterDelay:0.5];
  712 + return;
  713 + }
  714 +
  715 + if (!self.webUrl || self.webUrl.length == 0) {
  716 + [QMUITips showWithText:@"请输入企业网站访问链接" inView:AppKeyWindow hideAfterDelay:0.5];
  717 + return;
  718 + }
  719 +
  720 + if (!self.legalPerson || self.legalPerson.length == 0) {
  721 + [QMUITips showWithText:@"请输入企业法人姓名" inView:AppKeyWindow hideAfterDelay:0.5];
  722 + return;
  723 + }
  724 +
  725 + if (!self.contact || self.contact.length == 0) {
  726 + [QMUITips showWithText:@"请输入企业联系人姓名" inView:AppKeyWindow hideAfterDelay:0.5];
  727 + return;
  728 + }
  729 +
  730 + if (!self.licenseCount || self.licenseCount.length == 0) {
  731 + [QMUITips showWithText:@"请输入营业执照号" inView:AppKeyWindow hideAfterDelay:0.5];
  732 + return;
  733 + }
  734 +
  735 + if (!self.licenseImage) {
  736 + [QMUITips showWithText:@"请选择营业执照" inView:AppKeyWindow hideAfterDelay:0.5];
  737 + return;
  738 + }
  739 +
  740 + [QMUITips showLoadingInView:self.view];
  741 +
  742 + NSDictionary *dic = @{
  743 + @"d":@"1"
  744 + };
  745 + NSString *url = [NSString stringWithFormat:@"%@",CNLiveBOrganizationUpImageUrl];
  746 + [CNLiveUploadManager uploadRequestType:CNLiveUploadTypeThird url:url dic:dic image:self.logoImage isOriginal:YES limitType:AppPhototLimitTypeFriendsCircle progress:^(float progress) {
  747 +
  748 + } success:^(CNLiveUploadModel *uploadModel) {
  749 +
  750 + [QMUITips hideAllTipsInView:self.view];
  751 + NSLog(@"成功----------");
  752 + NSDictionary *responseObjectDic = uploadModel.responseObject;
  753 + if ([responseObjectDic containsObjectForKey:@"errorCode"]) {
  754 + if ([[NSString stringWithFormat:@"%@",[responseObjectDic objectForKey:@"errorCode"]] isEqualToString:@"0"] && [responseObjectDic containsObjectForKey:@"data"]) {
  755 + NSDictionary *dataDic = [dic objectForKey:@"data"];
  756 + if ([dataDic containsObjectForKey:@"url"]) {
  757 + self.logoUrl = [NSString stringWithFormat:@"%@",[dataDic objectForKey:@"url"] ? [dataDic objectForKey:@"url"]:@""];
  758 + }
  759 +
  760 +
  761 + }
  762 + }
  763 +
  764 +
  765 + [QMUITips showLoadingInView:self.view];
  766 + NSDictionary *dic = @{
  767 + @"d":@"0"
  768 + };
  769 + [CNLiveUploadManager uploadRequestType:CNLiveUploadTypeThird url:url dic:dic image:self.licenseImage isOriginal:YES limitType:AppPhototLimitTypeFriendsCircle progress:^(float progress) {
  770 +
  771 + } success:^(CNLiveUploadModel *uploadModel) {
  772 + [QMUITips hideAllTipsInView:self.view];
  773 +
742 NSLog(@"所有成功----------"); 774 NSLog(@"所有成功----------");
  775 + NSDictionary *responseObjectNextDic = uploadModel.responseObject;
  776 + if ([responseObjectNextDic containsObjectForKey:@"errorCode"]) {
  777 + if ([[NSString stringWithFormat:@"%@",[responseObjectNextDic objectForKey:@"errorCode"]] isEqualToString:@"0"] && [responseObjectNextDic containsObjectForKey:@"data"]) {
  778 + NSDictionary *dataNextDic = [responseObjectNextDic objectForKey:@"data"];
  779 + if ([dataNextDic containsObjectForKey:@"url"]) {
  780 + self.licenseImageUrl = [NSString stringWithFormat:@"%@",[dataNextDic objectForKey:@"url"] ? [dataNextDic objectForKey:@"url"]:@""];
  781 + }
  782 +
  783 +
  784 + }
  785 + }
743 [self uploadMessage]; 786 [self uploadMessage];
744 787
745 -// }failure:^(CNLiveUploadModel *uploadModel, NSError *error) {  
746 -//  
747 -// NSLog(@"失败----------");  
748 -//  
749 -//  
750 -//  
751 -// }];  
752 -//  
753 -//  
754 -// } failure:^(CNLiveUploadModel *uploadModel, NSError *error) {  
755 -//  
756 -// NSLog(@"失败----------");  
757 -//  
758 -//  
759 -//  
760 -// }]; 788 + }failure:^(CNLiveUploadModel *uploadModel, NSError *error) {
  789 +
  790 + NSLog(@"失败----------");
  791 + [QMUITips hideAllTipsInView:self.view];
  792 +
  793 +
  794 + }];
  795 +
  796 +
  797 + } failure:^(CNLiveUploadModel *uploadModel, NSError *error) {
  798 +
  799 + NSLog(@"失败----------");
  800 + [QMUITips hideAllTipsInView:self.view];
  801 +
  802 +
  803 + }];
761 804
762 } 805 }
763 806
@@ -770,6 +813,17 @@ @@ -770,6 +813,17 @@
770 813
771 814
772 - (void)popView { 815 - (void)popView {
  816 + if (self.selectedTF) {
  817 + if ([self.selectedTF isFirstResponder]) {
  818 + [self.selectedTF resignFirstResponder];
  819 + }
  820 + }
  821 +
  822 + if (self.selectedTV) {
  823 + if ([self.selectedTV isFirstResponder]) {
  824 + [self.selectedTV resignFirstResponder];
  825 + }
  826 + }
773 827
774 if (!self.detailModel || !self.detailModel.comTypList || self.detailModel.comTypList.count == 0) { 828 if (!self.detailModel || !self.detailModel.comTypList || self.detailModel.comTypList.count == 0) {
775 return; 829 return;
@@ -794,76 +848,43 @@ @@ -794,76 +848,43 @@
794 848
795 #pragma mark - 849 #pragma mark -
796 #pragma mark - *** 接口 *** 850 #pragma mark - *** 接口 ***
797 -- (void)loadData {  
798 -  
799 -#pragma mark - TODO: 记得加入验证  
800 - //URL: https://api.cnlive.com/open/api2/auser/getAccount.action?  
801 - NSString *strUrl = CNLiveBOrganizationValidattionStatusUrl;  
802 - NSDictionary *dict = @{  
803 - @"sid": [NSString stringWithFormat:@"%@",CNUserShareModel.uid],  
804 - @"sign":@""  
805 - };  
806 -  
807 - [CNLiveNetworking setAllowRequestDefaultArgument:YES];  
808 - [CNLiveNetworking setupShowDataResult:NO];  
809 - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {  
810 -  
811 - NSLog(@"点播详情数据 = %@",responseObject);  
812 -  
813 - NSString *resultCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]];  
814 - NSError *err = nil;  
815 - id data = nil;  
816 - if([resultCode isEqualToString:@"0"]) {  
817 - data = responseObject[@"data"];  
818 - } else {  
819 - @try {  
820 - err = [[NSError alloc] initWithDomain:responseObject[@"errorMessage"] code:[resultCode integerValue] userInfo:nil];  
821 - } @catch (NSException *exception) {  
822 - err = [[NSError alloc] initWithDomain:@"接口异常" code:500 userInfo:nil];  
823 - }  
824 - }  
825 -  
826 - CNLiveOrganizationDetailModel *detailModel = [CNLiveOrganizationDetailModel mj_objectWithKeyValues:data];  
827 - self.detailModel = detailModel;  
828 - [self.tableView reloadData];  
829 -  
830 -  
831 - }];  
832 -  
833 -  
834 -  
835 -}  
836 -  
837 - (void)uploadMessage{ 851 - (void)uploadMessage{
838 852
839 853
840 NSString *strUrl = CNLiveBOrganizationUpLoadUrl; 854 NSString *strUrl = CNLiveBOrganizationUpLoadUrl;
841 - NSDictionary *dict = @{  
842 - @"sid": @"10514333",  
843 - @"mobile": @"13011158888",  
844 - @"userLogo": @"/open/image/userlogo/20200331/6911edce-b9a9-4309-ac36-2dd3015d1efa.png",  
845 - @"company": @"aaabbb",  
846 - @"logo": @"/open/image/userlogo/20190305/c4b8c7cb-1bb3-4f4f-bba6-483050af331e.png",  
847 - @"sname": @"aaa",  
848 - @"sp_code": @"aaa",  
849 - @"jianjie": @"测试",  
850 - @"address": @"北京",  
851 - @"com_type_id": @"2",  
852 - @"siteDomain": @"www.cnlive.com",  
853 - @"qiyefaren": @"ll",  
854 - @"contacts": @"ll",  
855 - @"idCard": @"12345678912",  
856 - @"idCardPic": @"/open/image/idcard/20190305/6b6893f3-3cdf-45bd-8c17-684c12128274.png"  
857 - };  
858 - NSDictionary *dicCotent = @{  
859 - @"account":[dict mj_JSONString]  
860 - };  
861 - 855 + NSMutableDictionary *dict = @{
  856 + @"sid": @"10514575",
  857 + @"mobile": @"15027621766",
  858 + @"userLogo": @"http://yweb0.cnliveimg.com/images/headImg/2019/1211/1576034177571_small.jpg",
  859 + @"company": @"123",//企业全称
  860 +// @"logo": self.logoUrl,//logo
  861 + @"sname": @"123",//企业简称
  862 + @"sp_code": @"123",//企业代码
  863 + @"jianjie": @"123",//企业简介
  864 + @"address": @"123",//地址
  865 + @"com_type_id": @"2",//企业类型
  866 + @"siteDomain": @"www.cnlive.com",//网站
  867 + @"qiyefaren": @"l23",//企业法人
  868 + @"contacts": @"l23",//联系人
  869 + @"idCard": @"12345678912",//营业执照号
  870 +// @"idCardPic": self.licenseImageUrl,//营业执照
  871 + @"htno":@""
  872 + }.mutableCopy;
  873 + [dict setValue:self.logoUrl forKey:@"logo"];
  874 + [dict setValue:self.licenseImageUrl forKey:@"idCardPic"];
  875 +
  876 + NSString *contentDic = [self objectToJson:dict];
  877 + contentDic = [contentDic stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"];
  878 + NSMutableDictionary *dicCotent = [NSMutableDictionary dictionary];
  879 + [dicCotent setValue:contentDic forKey:@"account"];
  880 +
  881 + [QMUITips showLoadingInView:self.view];
862 [CNLiveNetworking setAllowRequestDefaultArgument:NO]; 882 [CNLiveNetworking setAllowRequestDefaultArgument:NO];
863 [CNLiveNetworking setupShowDataResult:NO]; 883 [CNLiveNetworking setupShowDataResult:NO];
864 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dicCotent CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { 884 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dicCotent CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
865 885
866 - NSLog(@"点播详情数据 = %@",responseObject); 886 + [QMUITips hideAllTipsInView:self.view];
  887 + NSLog(@"上传数据 = %@",responseObject);
867 888
868 NSString *resultCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]]; 889 NSString *resultCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]];
869 NSError *err = nil; 890 NSError *err = nil;
@@ -878,9 +899,6 @@ @@ -878,9 +899,6 @@
878 } 899 }
879 } 900 }
880 901
881 - CNLiveOrganizationDetailModel *detailModel = [CNLiveOrganizationDetailModel mj_objectWithKeyValues:data];  
882 - self.detailModel = detailModel;  
883 - [self.tableView reloadData];  
884 902
885 903
886 }]; 904 }];
@@ -891,6 +909,22 @@ @@ -891,6 +909,22 @@
891 909
892 } 910 }
893 911
  912 +- (NSString *)objectToJson:(id)obj{
  913 + if (obj == nil) {
  914 + return nil;
  915 + }
  916 + NSError *error = nil;
  917 + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:obj
  918 + options:0
  919 + error:&error];
  920 +
  921 + if ([jsonData length] && error == nil){
  922 + return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
  923 + }else{
  924 + return nil;
  925 + }
  926 +}
  927 +
894 928
895 929
896 #pragma mark - 930 #pragma mark -
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Model/CNLiveOrganizationDetailModel.h
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 NS_ASSUME_NONNULL_BEGIN 12 NS_ASSUME_NONNULL_BEGIN
13 13
14 @interface CNLiveOrganizationDetailModel : NSObject 14 @interface CNLiveOrganizationDetailModel : NSObject
15 -/** 机构认证状态*/ 15 +/** 机构认证状态 0未认证 1已认证 2待审核*/
16 @property (nonatomic, copy) NSString *isCertification; 16 @property (nonatomic, copy) NSString *isCertification;
17 /** 标签数组*/ 17 /** 标签数组*/
18 @property (nonatomic, strong) NSMutableArray<CNLiveOrganizationTipModel *> *comTypList; 18 @property (nonatomic, strong) NSMutableArray<CNLiveOrganizationTipModel *> *comTypList;
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Service/CNLiveBOrganizationValidattionService.m
@@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
10 #import "CNLiveBAgreementCommitFinishController.h" 10 #import "CNLiveBAgreementCommitFinishController.h"
11 #import "CNLiveBAgreementContentController.h" 11 #import "CNLiveBAgreementContentController.h"
12 #import "CNLiveBOrganizationValidattionController.h" 12 #import "CNLiveBOrganizationValidattionController.h"
  13 +#import "CNLiveBOraganizationDetailController.h"
  14 +#import <MJExtension/MJExtension.h>
13 15
14 @interface CNLiveBOrganizationValidattionService()<CNLiveBOrganizationValidationProtocol> 16 @interface CNLiveBOrganizationValidattionService()<CNLiveBOrganizationValidationProtocol>
15 17
@@ -24,6 +26,21 @@ @@ -24,6 +26,21 @@
24 - (UIViewController *)getOrganizationValidationController:(NSDictionary *)params { 26 - (UIViewController *)getOrganizationValidationController:(NSDictionary *)params {
25 27
26 CNLiveBOrganizationValidattionController *VC = [[CNLiveBOrganizationValidattionController alloc]init]; 28 CNLiveBOrganizationValidattionController *VC = [[CNLiveBOrganizationValidattionController alloc]init];
  29 + if (params) {
  30 + if (params.count > 0) {
  31 + VC.detailModel = [CNLiveOrganizationDetailModel mj_objectWithKeyValues:params];
  32 + }
  33 + }
  34 + return VC;
  35 +}
  36 +
  37 +- (UIViewController *)getOrganizationDetailController:(NSDictionary *)params{
  38 + CNLiveBOraganizationDetailController *VC = [[CNLiveBOraganizationDetailController alloc]init];
  39 + if (params) {
  40 + if (params.count > 0) {
  41 + VC.detailModel = [CNLiveOrganizationDetailModel mj_objectWithKeyValues:params];
  42 + }
  43 + }
27 return VC; 44 return VC;
28 } 45 }
29 46
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/View/CNLiveBOrganizationDetailCell.h
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 // 6 //
7 7
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
  9 +#import "CNLiveOrganizationDetailModel.h"
9 10
10 11
11 #define kCNLiveBOrganizationDetailCell @"CNLiveBOrganizationDetailCell" 12 #define kCNLiveBOrganizationDetailCell @"CNLiveBOrganizationDetailCell"
@@ -16,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -16,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
16 17
17 @property (strong, nonatomic) NSIndexPath *indexPath; 18 @property (strong, nonatomic) NSIndexPath *indexPath;
18 19
19 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath; 20 +- (void)editUIWithIndexPath:(NSIndexPath *)indexPath detailModel:(CNLiveOrganizationDetailModel *)detailModel;
20 21
21 @end 22 @end
22 23
@@ -30,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -30,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
30 31
31 @property (strong, nonatomic) NSIndexPath *indexPath; 32 @property (strong, nonatomic) NSIndexPath *indexPath;
32 33
33 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath; 34 +- (void)editUIWithIndexPath:(NSIndexPath *)indexPath detailModel:(CNLiveOrganizationDetailModel *)detailModel;
34 35
35 @end 36 @end
36 37
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/View/CNLiveBOrganizationDetailCell.m
@@ -75,77 +75,149 @@ @@ -75,77 +75,149 @@
75 #pragma mark - ***监听实现*** 75 #pragma mark - ***监听实现***
76 76
77 #pragma mark - ***editUI** 77 #pragma mark - ***editUI**
78 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath { 78 +- (void)editUIWithIndexPath:(NSIndexPath *)indexPath detailModel:(CNLiveOrganizationDetailModel *)detailModel {
79 79
80 80
81 if (!indexPath) { 81 if (!indexPath) {
82 return; 82 return;
83 } 83 }
84 84
  85 + BOOL isDetail = NO;
  86 + if (detailModel) {
  87 + if (detailModel.account) {
  88 + isDetail = YES;
  89 + }
  90 + }
  91 +
  92 +// @"sid": @"10514575",
  93 +// @"mobile": @"15027621766",
  94 +// @"userLogo": @"http://yweb0.cnliveimg.com/images/headImg/2019/1211/1576034177571_small.jpg",
  95 +// @"company": @"123",//企业全称
  96 +// // @"logo": self.logoUrl,//logo
  97 +// @"sname": @"123",//企业简称
  98 +// @"sp_code": @"123",//企业代码
  99 +// @"jianjie": @"123",//企业简介
  100 +// @"address": @"123",//地址
  101 +// @"com_type_id": @"2",//企业类型
  102 +// @"siteDomain": @"www.cnlive.com",//网站
  103 +// @"qiyefaren": @"l23",//企业法人
  104 +// @"contacts": @"l23",//联系人
  105 +// @"idCard": @"12345678912",//营业执照号
  106 +// // @"idCardPic": self.licenseImageUrl,//营业执照
  107 +// @"htno":@""
  108 +//
  109 +
  110 +
  111 +
85 self.indexPath = indexPath; 112 self.indexPath = indexPath;
86 113
87 if (indexPath.section == 0) { 114 if (indexPath.section == 0) {
88 if (indexPath.row == 0) { 115 if (indexPath.row == 0) {
89 NSString *titleStr = @"公司全称:"; 116 NSString *titleStr = @"公司全称:";
90 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 117 +
  118 + NSString *content = @"";
  119 + if (isDetail) {
  120 + content = [NSString stringWithFormat:@"%@",detailModel.account.company?detailModel.account.company:@""];
  121 + }
  122 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
91 self.contentL.attributedText = str; 123 self.contentL.attributedText = str;
92 124
93 125
94 }else if (indexPath.row == 2) { 126 }else if (indexPath.row == 2) {
95 127
96 NSString *titleStr = @"企业简称:"; 128 NSString *titleStr = @"企业简称:";
97 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测发达发大水范德萨范德萨范德萨范德萨范德萨范德萨范德萨发"]; 129 + NSString *content = @"";
  130 + if (isDetail) {
  131 + content = [NSString stringWithFormat:@"%@",detailModel.account.sname?detailModel.account.sname:@""];
  132 + }
  133 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
98 self.contentL.attributedText = str; 134 self.contentL.attributedText = str;
99 135
100 136
101 }else if (indexPath.row == 3) { 137 }else if (indexPath.row == 3) {
102 138
103 NSString *titleStr = @"企业代码:"; 139 NSString *titleStr = @"企业代码:";
104 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测范德萨范德萨发大水发大厦范德萨发大水发大水"]; 140 + NSString *content = @"";
  141 + if (isDetail) {
  142 + content = [NSString stringWithFormat:@"%@",detailModel.account.sp_code?detailModel.account.sp_code:@""];
  143 + }
  144 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
105 self.contentL.attributedText = str; 145 self.contentL.attributedText = str;
106 146
107 }else if (indexPath.row == 4) { 147 }else if (indexPath.row == 4) {
108 148
109 NSString *titleStr = @"企业简介:"; 149 NSString *titleStr = @"企业简介:";
110 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 150 + NSString *content = @"";
  151 + if (isDetail) {
  152 + content = [NSString stringWithFormat:@"%@",detailModel.account.jianjie?detailModel.account.jianjie:@""];
  153 + }
  154 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
111 self.contentL.attributedText = str; 155 self.contentL.attributedText = str;
112 156
113 }else if (indexPath.row == 5) { 157 }else if (indexPath.row == 5) {
114 158
115 - NSString *titleStr = @"企业类型:";  
116 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 159 + NSString *titleStr = @"企业地址:";
  160 + NSString *content = @"";
  161 + if (isDetail) {
  162 + content = [NSString stringWithFormat:@"%@",detailModel.account.address?detailModel.account.address:@""];
  163 + }
  164 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
117 self.contentL.attributedText = str; 165 self.contentL.attributedText = str;
118 166
119 }else if (indexPath.row == 6) { 167 }else if (indexPath.row == 6) {
120 168
121 - NSString *titleStr = @"网站:";  
122 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 169 + NSString *titleStr = @"企业类型:";
  170 + NSString *content = @"";
  171 + if (isDetail) {
  172 + content = [NSString stringWithFormat:@"%@",detailModel.account.com_type_id?detailModel.account.com_type_id:@""];
  173 + }
  174 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
123 self.contentL.attributedText = str; 175 self.contentL.attributedText = str;
124 176
125 }else if (indexPath.row == 7) { 177 }else if (indexPath.row == 7) {
126 178
127 NSString *titleStr = @"网站:"; 179 NSString *titleStr = @"网站:";
128 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 180 + NSString *content = @"";
  181 + if (isDetail) {
  182 + content = [NSString stringWithFormat:@"%@",detailModel.account.siteDomain?detailModel.account.siteDomain:@""];
  183 + }
  184 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
129 self.contentL.attributedText = str; 185 self.contentL.attributedText = str;
130 186
131 }else if (indexPath.row == 8) { 187 }else if (indexPath.row == 8) {
132 NSString *titleStr = @"企业法人:"; 188 NSString *titleStr = @"企业法人:";
133 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 189 + NSString *content = @"";
  190 + if (isDetail) {
  191 + content = [NSString stringWithFormat:@"%@",detailModel.account.qiyefaren?detailModel.account.qiyefaren:@""];
  192 + }
  193 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
134 self.contentL.attributedText = str; 194 self.contentL.attributedText = str;
135 195
136 }else if (indexPath.row == 9) { 196 }else if (indexPath.row == 9) {
137 NSString *titleStr = @"联系人:"; 197 NSString *titleStr = @"联系人:";
138 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 198 + NSString *content = @"";
  199 + if (isDetail) {
  200 + content = [NSString stringWithFormat:@"%@",detailModel.account.contacts?detailModel.account.contacts:@""];
  201 + }
  202 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
139 self.contentL.attributedText = str; 203 self.contentL.attributedText = str;
140 204
141 }else if (indexPath.row == 10) { 205 }else if (indexPath.row == 10) {
142 NSString *titleStr = @"合同编号:"; 206 NSString *titleStr = @"合同编号:";
143 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 207 + NSString *content = @"";
  208 + if (isDetail) {
  209 + content = [NSString stringWithFormat:@"%@",detailModel.account.htno?detailModel.account.htno:@""];
  210 + }
  211 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
144 self.contentL.attributedText = str; 212 self.contentL.attributedText = str;
145 213
146 }else if (indexPath.row == 11) { 214 }else if (indexPath.row == 11) {
147 NSString *titleStr = @"营业执照号:"; 215 NSString *titleStr = @"营业执照号:";
148 - NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:@"测试测试测测"]; 216 + NSString *content = @"";
  217 + if (isDetail) {
  218 + content = [NSString stringWithFormat:@"%@",detailModel.account.idCard?detailModel.account.idCard:@""];
  219 + }
  220 + NSMutableAttributedString *str = [self returnAllContentWithTitle:titleStr content:content];
149 self.contentL.attributedText = str; 221 self.contentL.attributedText = str;
150 222
151 }else { 223 }else {
@@ -252,14 +324,10 @@ @@ -252,14 +324,10 @@
252 make.width.mas_equalTo(72); 324 make.width.mas_equalTo(72);
253 make.height.mas_equalTo(12); 325 make.height.mas_equalTo(12);
254 }]; 326 }];
255 -  
256 -  
257 -  
258 - [self.contentImageV setBackgroundColor:[UIColor yellowColor]];  
259 } 327 }
260 328
261 #pragma mark - ***editUI*** 329 #pragma mark - ***editUI***
262 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath { 330 +- (void)editUIWithIndexPath:(NSIndexPath *)indexPath detailModel:(CNLiveOrganizationDetailModel *)detailModel {
263 331
264 if (!indexPath) { 332 if (!indexPath) {
265 return; 333 return;
@@ -273,19 +341,36 @@ @@ -273,19 +341,36 @@
273 341
274 self.indexPath = indexPath; 342 self.indexPath = indexPath;
275 343
  344 + BOOL isDetail = NO;
  345 + if (detailModel) {
  346 + if (detailModel.account) {
  347 + isDetail = YES;
  348 + }
  349 + }
  350 +
276 if (indexPath.section == 0) { 351 if (indexPath.section == 0) {
277 if (indexPath.row == 1) { 352 if (indexPath.row == 1) {
278 NSString *titleStr = @"企业logo:"; 353 NSString *titleStr = @"企业logo:";
279 self.titleL.text = titleStr; 354 self.titleL.text = titleStr;
280 - [self.contentImageV sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamedFromOrganization:@""]]; 355 + NSString *url = @"";
  356 + if (isDetail) {
  357 + url = [NSString stringWithFormat:@"%@",detailModel.account.userLogo?detailModel.account.userLogo:@""];
  358 + }
281 self.contentImageV.frame = CGRectMake(95, 10, 60, 60); 359 self.contentImageV.frame = CGRectMake(95, 10, 60, 60);
  360 + [self.contentImageV sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamedFromOrganization:@""]];
  361 +
282 362
283 }else if (indexPath.row == 12) { 363 }else if (indexPath.row == 12) {
284 364
285 NSString *titleStr = @"营业执照:"; 365 NSString *titleStr = @"营业执照:";
286 self.titleL.text = titleStr; 366 self.titleL.text = titleStr;
287 - [self.contentImageV sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamedFromOrganization:@""]]; 367 + NSString *url = @"";
  368 + if (isDetail) {
  369 + url = [NSString stringWithFormat:@"%@",detailModel.account.idCardPic?detailModel.account.idCardPic:@""];
  370 + }
288 self.contentImageV.frame = CGRectMake(95, 10, 101, 151); 371 self.contentImageV.frame = CGRectMake(95, 10, 101, 151);
  372 + [self.contentImageV sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamedFromOrganization:@""]];
  373 +
289 374
290 }else { 375 }else {
291 self.titleL.text = @""; 376 self.titleL.text = @"";
Example/CNLiveOrganizationValidationModule/CNLIVEBAppDelegate.m
@@ -7,12 +7,20 @@ @@ -7,12 +7,20 @@
7 // 7 //
8 8
9 #import "CNLIVEBAppDelegate.h" 9 #import "CNLIVEBAppDelegate.h"
  10 +#import <CNLiveRequestBastKit/CNLiveNetworkRequest.h>
  11 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
  12 +#import <CNLiveUserManagement/CNUserInfoManager.h>
  13 +#import <CNLiveEnvironment/CNLiveEnvironment.h>
10 14
  15 +
  16 +static NSString * uuid;
11 @implementation CNLIVEBAppDelegate 17 @implementation CNLIVEBAppDelegate
12 18
13 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 19 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 { 20 {
15 // Override point for customization after application launch. 21 // Override point for customization after application launch.
  22 + [self networkParamAction];
  23 + [self appUUIDString];
16 return YES; 24 return YES;
17 } 25 }
18 26
@@ -43,4 +51,29 @@ @@ -43,4 +51,29 @@
43 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 } 52 }
45 53
  54 +- (void)networkParamAction {
  55 + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init];
  56 + [mDict setValue:@"10514575" forKey:@"loginSid"];
  57 + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"] forKey:@"platform_id"];
  58 + [mDict setValue:[self appUUIDString] forKey:@"uuid"];
  59 + [mDict setValue:@"i" forKey:@"plat"];
  60 + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"];
  61 + [mDict setObject:AppId forKey:@"appId"];
  62 + [CNLiveNetworking setupDefaultParam:mDict];
  63 + [CNLiveNetworking setupShowResult:NO];
  64 + [CNLiveNetworking setupSignKey:APPKey];
  65 + NSLog(@"打印appkey%@",APPKey);
  66 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  67 + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON];
  68 +
  69 +}
  70 +- (NSString *)appUUIDString
  71 + {
  72 + static dispatch_once_t onceToken;
  73 + dispatch_once(&onceToken, ^{
  74 + uuid = [[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""];
  75 + });
  76 + return uuid;
  77 + }
  78 +
46 @end 79 @end
Example/CNLiveOrganizationValidationModule/CNLIVEBViewController.m
@@ -10,6 +10,17 @@ @@ -10,6 +10,17 @@
10 #import "UIColor+MLPFlatColors.h" 10 #import "UIColor+MLPFlatColors.h"
11 #import "CNLiveBOrganizationValidattionController.h" 11 #import "CNLiveBOrganizationValidattionController.h"
12 #import "CNLiveBOraganizationDetailController.h" 12 #import "CNLiveBOraganizationDetailController.h"
  13 +#import <CNLiveEnvironment/CNLiveEnvironment.h>
  14 +#import <CNLiveRequestBastKit/CNLiveNetworkRequest.h>
  15 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
  16 +#import <CNLiveUserManagement/CNUserInfoManager.h>
  17 +#import <CNLiveBeeHive/CNLiveBeeHive.h>
  18 +#import "CNLiveBOrganizationValidationProtocol.h"
  19 +#import <YYKit/YYKit.h>
  20 +
  21 +
  22 +
  23 +#define CNLiveBOrganizationValidattionStatusUrl cn_API_OpenApi2(@"/auser/getAccount.action")
13 24
14 @interface CNLIVEBViewController () 25 @interface CNLIVEBViewController ()
15 26
@@ -45,8 +56,76 @@ @@ -45,8 +56,76 @@
45 } 56 }
46 57
47 - (void)button1Action:(UIButton *)button { 58 - (void)button1Action:(UIButton *)button {
48 - CNLiveBOraganizationDetailController *vc = [[CNLiveBOraganizationDetailController alloc]init];  
49 - [self.navigationController pushViewController:vc animated:YES]; 59 + //URL: https://api.cnlive.com/open/api2/auser/getAccount.action?
  60 + NSString *strUrl = CNLiveBOrganizationValidattionStatusUrl;
  61 + NSDictionary *dict = @{
  62 + @"sid": [NSString stringWithFormat:@"%@",@"10514575"],
  63 + @"sign":@""
  64 + };
  65 +
  66 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  67 + [CNLiveNetworking setupShowDataResult:NO];
  68 + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  69 +
  70 + NSLog(@"点播详情数据 = %@",responseObject);
  71 +
  72 + NSString *resultCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]];
  73 + NSError *err = nil;
  74 + id data = nil;
  75 + if([resultCode isEqualToString:@"0"]) {
  76 + data = responseObject[@"data"];
  77 + } else {
  78 + @try {
  79 + err = [[NSError alloc] initWithDomain:responseObject[@"errorMessage"] code:[resultCode integerValue] userInfo:nil];
  80 + } @catch (NSException *exception) {
  81 + err = [[NSError alloc] initWithDomain:@"接口异常" code:500 userInfo:nil];
  82 + }
  83 + }
  84 +
  85 + if (!error) {
  86 + BOOL isEnter = NO;
  87 + NSDictionary *dicContent = (NSDictionary *)data;
  88 + if (dicContent) {
  89 + if ([dicContent containsObjectForKey:@"isCertification"]) {
  90 + NSString *isCertificationStr = [NSString stringWithFormat:@"%@",[dicContent objectForKey:@"isCertification"]];
  91 + if ([isCertificationStr isEqualToString:@"0"]) {
  92 + /// 填表页
  93 + id<CNLiveBOrganizationValidationProtocol> organizationValidationProtocol = [[BeeHive shareInstance] createService:@protocol(CNLiveBOrganizationValidationProtocol)];
  94 + UIViewController *vc = [organizationValidationProtocol getOrganizationValidationController:dicContent];
  95 + [self.navigationController pushViewController:vc animated:YES];
  96 +
  97 + isEnter = YES;
  98 + }else if ([isCertificationStr isEqualToString:@"1"]) {
  99 + /// 详情页
  100 + id<CNLiveBOrganizationValidationProtocol> organizationValidationProtocol = [[BeeHive shareInstance] createService:@protocol(CNLiveBOrganizationValidationProtocol)];
  101 + UIViewController *vc = [organizationValidationProtocol getOrganizationDetailController:dicContent];
  102 + [self.navigationController pushViewController:vc animated:YES];
  103 +
  104 + isEnter = YES;
  105 + }else if ([isCertificationStr isEqualToString:@"2"]) {
  106 +
  107 + /// 详情页
  108 + id<CNLiveBOrganizationValidationProtocol> organizationValidationProtocol = [[BeeHive shareInstance] createService:@protocol(CNLiveBOrganizationValidationProtocol)];
  109 + UIViewController *vc = [organizationValidationProtocol getOrganizationDetailController:dicContent];
  110 + [self.navigationController pushViewController:vc animated:YES];
  111 +
  112 + isEnter = YES;
  113 +
  114 + isEnter = YES;
  115 + }
  116 + }
  117 + }
  118 +
  119 + if (!isEnter) {
  120 + #pragma mark - TODO:弹框
  121 + ///弹框
  122 + }
  123 +
  124 + }else {
  125 +
  126 + }
  127 +
  128 + }];
50 129
51 } 130 }
52 131
Example/CNLiveOrganizationValidationModule/CNLiveOrganizationValidationModule-Info.plist
@@ -2,6 +2,13 @@ @@ -2,6 +2,13 @@
2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 <plist version="1.0"> 3 <plist version="1.0">
4 <dict> 4 <dict>
  5 + <key>NSAppTransportSecurity</key>
  6 + <dict>
  7 + <key>NSAllowsArbitraryLoads</key>
  8 + <true/>
  9 + </dict>
  10 + <key>LSApplicationCategoryType</key>
  11 + <string></string>
5 <key>NSContactsUsageDescription</key> 12 <key>NSContactsUsageDescription</key>
6 <string>请求访问通讯录</string> 13 <string>请求访问通讯录</string>
7 <key>NSCameraUsageDescription</key> 14 <key>NSCameraUsageDescription</key>