Commit 99ded1d671f934955f6535994572f64e7c80c1a8

Authored by 梁星国
1 parent 5bdd3e11

提交

Showing 14 changed files with 734 additions and 65 deletions
CNLiveOrganizationValidationModule.podspec
@@ -55,7 +55,7 @@ Pod::Spec.new do |s| @@ -55,7 +55,7 @@ Pod::Spec.new do |s|
55 #分享工具库 55 #分享工具库
56 s.dependency 'CNLiveShareToolKit' 56 s.dependency 'CNLiveShareToolKit'
57 #基础请求组件库 57 #基础请求组件库
58 - s.dependency 'CNLiveRequestBastKit' 58 + s.dependency 'CNLiveRequestBastKit','0.2.4.2'
59 #基础UI组件库 59 #基础UI组件库
60 s.dependency 'CNLiveCustomUI' 60 s.dependency 'CNLiveCustomUI'
61 #基础组件库 61 #基础组件库
@@ -88,6 +88,7 @@ Pod::Spec.new do |s| @@ -88,6 +88,7 @@ Pod::Spec.new do |s|
88 ### 所有github三方管理库(非频繁更新) 88 ### 所有github三方管理库(非频繁更新)
89 ######################################## 89 ########################################
90 s.dependency 'CNLiveTripartiteManagement' 90 s.dependency 'CNLiveTripartiteManagement'
  91 + s.dependency 'CNLiveTripartiteManagement/AFNetworking','0.1.6'
91 92
92 93
93 94
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Controller/CNLiveBOraganizationDetailController.m
@@ -10,6 +10,17 @@ @@ -10,6 +10,17 @@
10 #import "CNLiveBOraganizationDetailController.h" 10 #import "CNLiveBOraganizationDetailController.h"
11 #import "CNLiveBOrganizationDetailHeaderView.h" 11 #import "CNLiveBOrganizationDetailHeaderView.h"
12 #import "CNLiveBOrganizationDetailCell.h" 12 #import "CNLiveBOrganizationDetailCell.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 "CNLiveOrganizationDetailModel.h"
  19 +#import <MJExtension/MJExtension.h>
  20 +
  21 +
  22 +//体育中国-详情
  23 +#define CNLiveBOrganizationValidattionStatusUrl cn_API_OpenApi2(@"/auser/getAccount.action")
13 24
14 @interface CNLiveBOraganizationDetailController () 25 @interface CNLiveBOraganizationDetailController ()
15 <UITableViewDataSource,UITableViewDelegate> 26 <UITableViewDataSource,UITableViewDelegate>
@@ -193,6 +204,46 @@ @@ -193,6 +204,46 @@
193 204
194 #pragma mark - 205 #pragma mark -
195 #pragma mark - *** 接口 *** 206 #pragma mark - *** 接口 ***
  207 +- (void)loadData {
  208 +
  209 +#pragma mark - TODO: 记得加入验证
  210 + //URL: https://api.cnlive.com/open/api2/auser/getAccount.action?
  211 + NSString *strUrl = CNLiveBOrganizationValidattionStatusUrl;
  212 + NSDictionary *dict = @{
  213 + @"sid": [NSString stringWithFormat:@"%@",CNUserShareModel.uid],
  214 + @"sign":@""
  215 + };
  216 +
  217 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  218 + [CNLiveNetworking setupShowDataResult:NO];
  219 + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  220 +
  221 + NSLog(@"点播详情数据 = %@",responseObject);
  222 +
  223 + NSString *resultCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]];
  224 + NSError *err = nil;
  225 + id data = nil;
  226 + if([resultCode isEqualToString:@"0"]) {
  227 + data = responseObject[@"data"];
  228 + } else {
  229 + @try {
  230 + err = [[NSError alloc] initWithDomain:responseObject[@"errorMessage"] code:[resultCode integerValue] userInfo:nil];
  231 + } @catch (NSException *exception) {
  232 + err = [[NSError alloc] initWithDomain:@"接口异常" code:500 userInfo:nil];
  233 + }
  234 + }
  235 +
  236 + CNLiveOrganizationDetailModel *detailModel = [CNLiveOrganizationDetailModel mj_objectWithKeyValues:data];
  237 +
  238 + [self.tableView reloadData];
  239 +
  240 +
  241 + }];
  242 +
  243 +
  244 +
  245 +}
  246 +
196 247
197 #pragma mark - 248 #pragma mark -
198 #pragma mark - *** 私有属性 *** 249 #pragma mark - *** 私有属性 ***
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Controller/CNLiveBOrganizationValidattionController.m
@@ -19,6 +19,23 @@ @@ -19,6 +19,23 @@
19 #import <QMUIKit/QMUIKit.h> 19 #import <QMUIKit/QMUIKit.h>
20 #import <YYKit/YYKit.h> 20 #import <YYKit/YYKit.h>
21 #import <objc/runtime.h> 21 #import <objc/runtime.h>
  22 +#import <CNLiveEnvironment/CNLiveEnvironment.h>
  23 +#import <CNLiveRequestBastKit/CNLiveNetworkRequest.h>
  24 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
  25 +#import <CNLiveUserManagement/CNUserInfoManager.h>
  26 +#import <CNLiveBeeHive/CNLiveBeeHive.h>
  27 +#import "CNLiveOrganizationDetailModel.h"
  28 +#import <MJExtension/MJExtension.h>
  29 +#import <CNLiveUploadManager/CNLiveUploadManager.h>
  30 +
  31 +
  32 +
  33 +#define CNLiveBOrganizationValidattionStatusUrl cn_API_OpenApi2(@"/auser/getAccount.action")
  34 +#define CNLiveBOrganizationUpImageUrl cn_API_OpenApi2(@"/auser/uploadFile.action")
  35 +#define CNLiveBOrganizationUpLoadUrl cn_API_OpenApi2(@"/auser/updateAccount.action")
  36 +
  37 +
  38 +
22 39
23 @interface CNLiveBOrganizationValidattionController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,UITextViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,TZImagePickerControllerDelegate, RSKImageCropViewControllerDelegate,RSKImageCropViewControllerDataSource>{ 40 @interface CNLiveBOrganizationValidattionController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,UITextViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,TZImagePickerControllerDelegate, RSKImageCropViewControllerDelegate,RSKImageCropViewControllerDataSource>{
24 CGPoint contentoffset; 41 CGPoint contentoffset;
@@ -40,6 +57,44 @@ @@ -40,6 +57,44 @@
40 57
41 @property (nonatomic, strong) UIImagePickerController *pickerVC; 58 @property (nonatomic, strong) UIImagePickerController *pickerVC;
42 59
  60 +@property (nonatomic, strong) CNLiveOrganizationDetailModel *detailModel;
  61 +
  62 +@property (nonatomic, strong) NSMutableArray *tipArray;
  63 +
  64 +/** 1公司全称*/
  65 +@property (nonatomic, copy) NSString *companyName;
  66 +/** 2企业logo*/
  67 +@property (nonatomic, copy) UIImage *logoImage;
  68 +/** 2企业logo上传路径*/
  69 +@property (nonatomic, copy) NSString *logoUrl;
  70 +/** 3企业简称*/
  71 +@property (nonatomic, copy) NSString *companyShortName;
  72 +/** 4企业代码*/
  73 +@property (nonatomic, copy) NSString *companyId;
  74 +/** 5企业简介*/
  75 +@property (nonatomic, copy) NSString *companyContent;
  76 +/** 6企业地址*/
  77 +@property (nonatomic, copy) NSString *companyAdress;
  78 +/** 7选择企业类型*/
  79 +@property (nonatomic, strong) CNLiveOrganizationTipModel *tipModel;
  80 +/** 8webUrl*/
  81 +@property (nonatomic, copy) NSString *webUrl;
  82 +/** 9法人*/
  83 +@property (nonatomic, copy) NSString *legalPerson;
  84 +/** 10联系人*/
  85 +@property (nonatomic, copy) NSString *contact;
  86 +/** 11合同编号*/
  87 +@property (nonatomic, copy) NSString *contractCount;
  88 +/** 12营业执照编号*/
  89 +@property (nonatomic, copy) NSString *licenseCount;
  90 +/** 13营业执照*/
  91 +@property (nonatomic, copy) UIImage *licenseImage;
  92 +/** 13营业执照*/
  93 +@property (nonatomic, copy) NSString *licenseImageUrl;
  94 +
  95 +/** 标记点击第几个*/
  96 +@property (nonatomic, assign) NSInteger selectRow;
  97 +
43 98
44 @end 99 @end
45 100
@@ -69,7 +124,11 @@ @@ -69,7 +124,11 @@
69 - (void)viewDidLoad { 124 - (void)viewDidLoad {
70 [super viewDidLoad]; 125 [super viewDidLoad];
71 126
  127 + self.tipArray = [NSMutableArray array];
  128 + self.detailModel = [[CNLiveOrganizationDetailModel alloc]init];
  129 +
72 [self editUI]; 130 [self editUI];
  131 + [self loadData];
73 } 132 }
74 133
75 - (void)viewDidAppear:(BOOL)animated { 134 - (void)viewDidAppear:(BOOL)animated {
@@ -142,6 +201,52 @@ @@ -142,6 +201,52 @@
142 201
143 } 202 }
144 203
  204 +- (void)textFieldDidEndEditing:(UITextField *)textField {
  205 +
  206 + if (!textField) {
  207 + return;
  208 + }
  209 + CNLiveBOrganizationTextField *TF = (CNLiveBOrganizationTextField *)textField;
  210 +
  211 + if (TF.tfIndexPath) {
  212 +
  213 + NSString *content = [NSString stringWithFormat:@"%@",TF.text ? TF.text : @""];
  214 + if (TF.tfIndexPath.row == 0) {
  215 +
  216 + self.companyName = [NSString stringWithFormat:@"%@",content];
  217 + }else if (TF.tfIndexPath.row == 2) {
  218 +
  219 + self.companyShortName = [NSString stringWithFormat:@"%@",content];
  220 + }else if (TF.tfIndexPath.row == 3) {
  221 +
  222 + self.companyId = [NSString stringWithFormat:@"%@",content];
  223 + }else if (TF.tfIndexPath.row == 5) {
  224 +
  225 + self.companyAdress = [NSString stringWithFormat:@"%@",content];
  226 + }else if (TF.tfIndexPath.row == 7) {
  227 +
  228 + self.webUrl = [NSString stringWithFormat:@"%@",content];
  229 + }else if (TF.tfIndexPath.row == 8) {
  230 +
  231 + self.legalPerson = [NSString stringWithFormat:@"%@",content];
  232 + }else if (TF.tfIndexPath.row == 9) {
  233 +
  234 + self.contact = [NSString stringWithFormat:@"%@",content];
  235 + }else if (TF.tfIndexPath.row == 10) {
  236 +
  237 + self.contractCount = [NSString stringWithFormat:@"%@",content];
  238 + }else if (TF.tfIndexPath.row == 11) {
  239 +
  240 + self.licenseCount = [NSString stringWithFormat:@"%@",content];
  241 + }
  242 +
  243 +
  244 + }
  245 +
  246 +
  247 +}
  248 +
  249 +
145 #pragma mark textView delegate 250 #pragma mark textView delegate
146 251
147 -(void)textViewDidBeginEditing:(UITextView *)textView 252 -(void)textViewDidBeginEditing:(UITextView *)textView
@@ -167,6 +272,20 @@ @@ -167,6 +272,20 @@
167 272
168 } 273 }
169 274
  275 +- (void)textViewDidEndEditing:(UITextView *)textView {
  276 + if (!textView) {
  277 + return;
  278 + }
  279 + CNLiveBOrganizationTextView *TV = (CNLiveBOrganizationTextView *)textView;
  280 + if (TV.tvIndexPath) {
  281 + if (TV.tvIndexPath.row == 4) {
  282 + self.companyContent = [NSString stringWithFormat:@"%@",TV.text ? TV.text : @""];
  283 + }
  284 + }
  285 +
  286 +
  287 +}
  288 +
170 289
171 290
172 291
@@ -200,7 +319,7 @@ @@ -200,7 +319,7 @@
200 319
201 }else if (indexPath.row == 6) { 320 }else if (indexPath.row == 6) {
202 CNLiveBOrganizationSelectedCell *selectedCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationSelectedCell forIndexPath:indexPath]; 321 CNLiveBOrganizationSelectedCell *selectedCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationSelectedCell forIndexPath:indexPath];
203 - [selectedCell editUIWithIndexPath:indexPath]; 322 + [selectedCell editUIWithIndexPath:indexPath tipModel:self.tipModel];
204 __weak typeof(self) weakSelf = self; 323 __weak typeof(self) weakSelf = self;
205 selectedCell.clickSelectedCellBlock = ^(CNLiveBOrganizationSelectedCell * _Nonnull selectedCell, CNLiveBOrganizationButton * _Nonnull selectedBtn) { 324 selectedCell.clickSelectedCellBlock = ^(CNLiveBOrganizationSelectedCell * _Nonnull selectedCell, CNLiveBOrganizationButton * _Nonnull selectedBtn) {
206 [weakSelf popView]; 325 [weakSelf popView];
@@ -209,7 +328,13 @@ @@ -209,7 +328,13 @@
209 328
210 }else if (indexPath.row == 1 || indexPath.row == 12) { 329 }else if (indexPath.row == 1 || indexPath.row == 12) {
211 CNLiveBOrganizationImageVSelectedCell *imageVCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationImageVSelectedCell forIndexPath:indexPath]; 330 CNLiveBOrganizationImageVSelectedCell *imageVCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationImageVSelectedCell forIndexPath:indexPath];
212 - [imageVCell editUIWithIndexPath:indexPath]; 331 + if (indexPath.row == 1) {
  332 + [imageVCell editUIWithIndexPath:indexPath image:self.logoImage];
  333 + }else if (indexPath.row == 12){
  334 + [imageVCell editUIWithIndexPath:indexPath image:self.licenseImage];
  335 + }
  336 +
  337 +
213 return imageVCell; 338 return imageVCell;
214 }else { 339 }else {
215 CNLiveBOrganizationTFCell *tfCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationTFCell forIndexPath:indexPath]; 340 CNLiveBOrganizationTFCell *tfCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationTFCell forIndexPath:indexPath];
@@ -299,7 +424,7 @@ @@ -299,7 +424,7 @@
299 [self.photoSelecctedView popViewForView:self.view]; 424 [self.photoSelecctedView popViewForView:self.view];
300 __weak typeof(self) weakSelf = self; 425 __weak typeof(self) weakSelf = self;
301 self.photoSelecctedView.clickViewBlock = ^(CNLiveBOrganizationPhotoSelectedView * _Nonnull view, NSInteger indexCount) { 426 self.photoSelecctedView.clickViewBlock = ^(CNLiveBOrganizationPhotoSelectedView * _Nonnull view, NSInteger indexCount) {
302 - 427 + weakSelf.selectRow = 1;
303 [weakSelf checkPermissionsWithCount:indexCount type:0]; 428 [weakSelf checkPermissionsWithCount:indexCount type:0];
304 429
305 }; 430 };
@@ -310,6 +435,7 @@ @@ -310,6 +435,7 @@
310 [self.photoSelecctedView popViewForView:self.view]; 435 [self.photoSelecctedView popViewForView:self.view];
311 __weak typeof(self) weakSelf = self; 436 __weak typeof(self) weakSelf = self;
312 self.photoSelecctedView.clickViewBlock = ^(CNLiveBOrganizationPhotoSelectedView * _Nonnull view, NSInteger indexCount) { 437 self.photoSelecctedView.clickViewBlock = ^(CNLiveBOrganizationPhotoSelectedView * _Nonnull view, NSInteger indexCount) {
  438 + weakSelf.selectRow = 12;
313 [weakSelf checkPermissionsWithCount:indexCount type:1]; 439 [weakSelf checkPermissionsWithCount:indexCount type:1];
314 440
315 }; 441 };
@@ -324,6 +450,11 @@ @@ -324,6 +450,11 @@
324 #pragma mark - RSKImageCropViewControllerDelegate 450 #pragma mark - RSKImageCropViewControllerDelegate
325 - (void)imageCropViewController:(RSKImageCropViewController *)controller didCropImage:(UIImage *)croppedImage usingCropRect:(CGRect)cropRect rotationAngle:(CGFloat)rotationAngle { 451 - (void)imageCropViewController:(RSKImageCropViewController *)controller didCropImage:(UIImage *)croppedImage usingCropRect:(CGRect)cropRect rotationAngle:(CGFloat)rotationAngle {
326 NSLog(@"%@",croppedImage); 452 NSLog(@"%@",croppedImage);
  453 + if (croppedImage) {
  454 + self.logoImage = croppedImage;
  455 + [self.tableView reloadData];
  456 + }
  457 +
327 458
328 #pragma mark - TODO: 获取图片 459 #pragma mark - TODO: 获取图片
329 if (self.navigationController) { 460 if (self.navigationController) {
@@ -336,7 +467,7 @@ @@ -336,7 +467,7 @@
336 if (self.navigationController) { 467 if (self.navigationController) {
337 [self.navigationController popViewControllerAnimated:YES]; 468 [self.navigationController popViewControllerAnimated:YES];
338 } 469 }
339 - 470 +
340 } 471 }
341 472
342 #pragma mark - RSKImageCropViewControllerDataSource 473 #pragma mark - RSKImageCropViewControllerDataSource
@@ -358,7 +489,7 @@ @@ -358,7 +489,7 @@
358 489
359 #pragma mark - UIImagePickerControllerDelegate 490 #pragma mark - UIImagePickerControllerDelegate
360 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { 491 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
361 - 492 +
362 NSString *type = [info objectForKey:UIImagePickerControllerMediaType]; 493 NSString *type = [info objectForKey:UIImagePickerControllerMediaType];
363 494
364 //当选择的类型是图片 495 //当选择的类型是图片
@@ -374,7 +505,16 @@ @@ -374,7 +505,16 @@
374 } 505 }
375 //获取图片 506 //获取图片
376 UIImage *image = [info objectForKey:key]; 507 UIImage *image = [info objectForKey:key];
377 -#pragma mark - TODO:获取图片 508 + if (image) {
  509 + if (self.selectRow == 1) {
  510 + self.logoImage = image;
  511 + }else if (self.selectRow == 12) {
  512 + self.licenseImage = image;
  513 + }
  514 + [self.tableView reloadData];
  515 + }
  516 +
  517 +
378 //关闭相册界面 518 //关闭相册界面
379 [picker dismissViewControllerAnimated:YES completion:^{ 519 [picker dismissViewControllerAnimated:YES completion:^{
380 520
@@ -460,13 +600,16 @@ @@ -460,13 +600,16 @@
460 600
461 [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { 601 [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
462 UIImage *image = photos.firstObject; 602 UIImage *image = photos.firstObject;
463 - // weakSelf.prepareImage = image;  
464 - RSKImageCropViewController *imageCropVC = [[RSKImageCropViewController alloc] initWithImage:image cropMode:RSKImageCropModeCustom];//传入图片与裁剪框的类型 RSKImageCropModeCustom RSKImageCropModeSquare  
465 - imageCropVC.delegate = self;  
466 - imageCropVC.dataSource = self;  
467 - imageCropVC.maskLayerStrokeColor = kWhiteColor;  
468 - imageCropVC.avoidEmptySpaceAroundImage = YES;  
469 - [self.navigationController pushViewController:imageCropVC animated:YES]; 603 + if (image) {
  604 + RSKImageCropViewController *imageCropVC = [[RSKImageCropViewController alloc] initWithImage:image cropMode:RSKImageCropModeCustom];//传入图片与裁剪框的类型 RSKImageCropModeCustom RSKImageCropModeSquare
  605 + imageCropVC.delegate = self;
  606 + imageCropVC.dataSource = self;
  607 + imageCropVC.maskLayerStrokeColor = kWhiteColor;
  608 + imageCropVC.avoidEmptySpaceAroundImage = YES;
  609 + [self.navigationController pushViewController:imageCropVC animated:YES];
  610 + }
  611 +
  612 +
470 }]; 613 }];
471 [self presentViewController:imagePickerVc animated:YES completion:nil]; 614 [self presentViewController:imagePickerVc animated:YES completion:nil];
472 return; 615 return;
@@ -474,31 +617,35 @@ @@ -474,31 +617,35 @@
474 } 617 }
475 }else { 618 }else {
476 if (indexCount == 0) { 619 if (indexCount == 0) {
477 - if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {  
478 - self.pickerVC.sourceType = UIImagePickerControllerSourceTypeCamera;  
479 - //设置拍照后的图片可被编辑  
480 - self.pickerVC.modalPresentationStyle = UIModalPresentationFullScreen;  
481 - self.pickerVC.allowsEditing = NO;  
482 - [self presentViewController:self.pickerVC animated:YES completion:nil];  
483 -  
484 - }  
485 -  
486 - } else if (indexCount == 1) {  
487 - TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:self];  
488 - imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;  
489 - imagePickerVc.allowTakePicture = NO; // 在内部显示拍照按钮  
490 - imagePickerVc.allowPreview = NO;  
491 - imagePickerVc.allowPickingOriginalPhoto = NO;  
492 - imagePickerVc.allowPickingVideo = NO;  
493 -  
494 - [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {  
495 - UIImage *image = photos.firstObject;  
496 -  
497 - }];  
498 - [self presentViewController:imagePickerVc animated:YES completion:nil];  
499 - return;  
500 -  
501 - } 620 + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
  621 + self.pickerVC.sourceType = UIImagePickerControllerSourceTypeCamera;
  622 + //设置拍照后的图片可被编辑
  623 + self.pickerVC.modalPresentationStyle = UIModalPresentationFullScreen;
  624 + self.pickerVC.allowsEditing = NO;
  625 + [self presentViewController:self.pickerVC animated:YES completion:nil];
  626 +
  627 + }
  628 +
  629 + } else if (indexCount == 1) {
  630 + TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:self];
  631 + imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
  632 + imagePickerVc.allowTakePicture = NO; // 在内部显示拍照按钮
  633 + imagePickerVc.allowPreview = NO;
  634 + imagePickerVc.allowPickingOriginalPhoto = NO;
  635 + imagePickerVc.allowPickingVideo = NO;
  636 + __weak typeof(self) weakSelf = self;
  637 + [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
  638 + UIImage *image = photos.firstObject;
  639 + if (image) {
  640 + weakSelf.licenseImage = image;
  641 + [weakSelf.tableView reloadData];
  642 + }
  643 +
  644 + }];
  645 + [self presentViewController:imagePickerVc animated:YES completion:nil];
  646 + return;
  647 +
  648 + }
502 649
503 } 650 }
504 651
@@ -513,10 +660,109 @@ @@ -513,10 +660,109 @@
513 #pragma mark - *** 事件实现 *** 660 #pragma mark - *** 事件实现 ***
514 661
515 - (void)jumpCommitVC { 662 - (void)jumpCommitVC {
516 - CNLiveBAgreementCommitFinishController *commitVC = [[CNLiveBAgreementCommitFinishController alloc]init];  
517 - [self.navigationController pushViewController:commitVC animated:YES]; 663 +
  664 +
  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);
  666 + // self.footerView.agreementBtn
  667 +
  668 +
  669 +
  670 + // CNLiveBAgreementCommitFinishController *commitVC = [[CNLiveBAgreementCommitFinishController alloc]init];
  671 + // [self.navigationController pushViewController:commitVC animated:YES];
  672 +
  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 +//
  742 + NSLog(@"所有成功----------");
  743 + [self uploadMessage];
  744 +
  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 +// }];
  761 +
518 } 762 }
519 763
  764 +
  765 +
520 - (void)jumpContentVC { 766 - (void)jumpContentVC {
521 CNLiveBAgreementContentController *contentVC = [[CNLiveBAgreementContentController alloc] init]; 767 CNLiveBAgreementContentController *contentVC = [[CNLiveBAgreementContentController alloc] init];
522 [self.navigationController pushViewController:contentVC animated:YES]; 768 [self.navigationController pushViewController:contentVC animated:YES];
@@ -525,10 +771,19 @@ @@ -525,10 +771,19 @@
525 771
526 - (void)popView { 772 - (void)popView {
527 773
  774 + if (!self.detailModel || !self.detailModel.comTypList || self.detailModel.comTypList.count == 0) {
  775 + return;
  776 + }
  777 +
528 [self.popSelectedView popViewForView:self.view]; 778 [self.popSelectedView popViewForView:self.view];
529 - self.popSelectedView.clickCellBlock = ^(CNLiveBOrganizationPopSelectedView * _Nonnull view, NSString * _Nonnull text) {  
530 - NSLog(@"选择结束返回");  
531 - 779 + self.popSelectedView.dataSourceArr = self.detailModel.comTypList;
  780 + self.popSelectedView.tipSelectModel = self.tipModel;
  781 + __weak typeof(self) weakSelf = self;
  782 + self.popSelectedView.clickCellBlock = ^(CNLiveBOrganizationPopSelectedView * _Nonnull view, CNLiveOrganizationTipModel * _Nonnull tipSelectModel) {
  783 + weakSelf.tipModel = tipSelectModel;
  784 + if (weakSelf.tipModel) {
  785 + [weakSelf.tableView reloadData];
  786 + }
532 787
533 }; 788 };
534 789
@@ -539,6 +794,104 @@ @@ -539,6 +794,104 @@
539 794
540 #pragma mark - 795 #pragma mark -
541 #pragma mark - *** 接口 *** 796 #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{
  838 +
  839 +
  840 + 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 +
  862 + [CNLiveNetworking setAllowRequestDefaultArgument:NO];
  863 + [CNLiveNetworking setupShowDataResult:NO];
  864 + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:strUrl Param:dicCotent CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  865 +
  866 + NSLog(@"点播详情数据 = %@",responseObject);
  867 +
  868 + NSString *resultCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]];
  869 + NSError *err = nil;
  870 + id data = nil;
  871 + if([resultCode isEqualToString:@"0"]) {
  872 + data = responseObject[@"data"];
  873 + } else {
  874 + @try {
  875 + err = [[NSError alloc] initWithDomain:responseObject[@"errorMessage"] code:[resultCode integerValue] userInfo:nil];
  876 + } @catch (NSException *exception) {
  877 + err = [[NSError alloc] initWithDomain:@"接口异常" code:500 userInfo:nil];
  878 + }
  879 + }
  880 +
  881 + CNLiveOrganizationDetailModel *detailModel = [CNLiveOrganizationDetailModel mj_objectWithKeyValues:data];
  882 + self.detailModel = detailModel;
  883 + [self.tableView reloadData];
  884 +
  885 +
  886 + }];
  887 +
  888 +
  889 +
  890 +
  891 +
  892 +}
  893 +
  894 +
542 895
543 #pragma mark - 896 #pragma mark -
544 #pragma mark - *** 私有属性 *** 897 #pragma mark - *** 私有属性 ***
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Model/CNLiveOrganizationDetailModel.h 0 → 100644
  1 +//
  2 +// CNLiveOrganizationDetailModel.h
  3 +// CNLiveOrganizationValidationModule
  4 +//
  5 +// Created by 梁星国 on 2020/4/15.
  6 +//
  7 +
  8 +#import <Foundation/Foundation.h>
  9 +@class CNLiveOrganizationTipModel;
  10 +@class CNLiveOrganizationDetailContentModel;
  11 +
  12 +NS_ASSUME_NONNULL_BEGIN
  13 +
  14 +@interface CNLiveOrganizationDetailModel : NSObject
  15 +/** 机构认证状态*/
  16 +@property (nonatomic, copy) NSString *isCertification;
  17 +/** 标签数组*/
  18 +@property (nonatomic, strong) NSMutableArray<CNLiveOrganizationTipModel *> *comTypList;
  19 +/** 认证成功用户信息*/
  20 +@property (nonatomic, strong) CNLiveOrganizationDetailContentModel *account;
  21 +
  22 +
  23 +@end
  24 +
  25 +NS_ASSUME_NONNULL_END
  26 +
  27 +NS_ASSUME_NONNULL_BEGIN
  28 +
  29 +
  30 +@interface CNLiveOrganizationTipModel : NSObject
  31 +/** ID*/
  32 +@property (nonatomic, copy) NSString *ID;
  33 +/** 标签名字*/
  34 +@property (nonatomic, copy) NSString *name;
  35 +/** 选中*/
  36 +@property (nonatomic, copy) NSString *ordernum;
  37 +
  38 +
  39 +@end
  40 +
  41 +NS_ASSUME_NONNULL_END
  42 +
  43 +
  44 +NS_ASSUME_NONNULL_BEGIN
  45 +
  46 +
  47 +@interface CNLiveOrganizationDetailContentModel : NSObject
  48 +/** 地址*/
  49 +@property (nonatomic, copy) NSString *address;
  50 +/** */
  51 +@property (nonatomic, copy) NSString *app_count;
  52 +/** 选中*/
  53 +@property (nonatomic, copy) NSString *autoid;
  54 +/** 选中*/
  55 +@property (nonatomic, copy) NSString *ordernum;
  56 +/** 选中*/
  57 +@property (nonatomic, copy) NSString *com_type_id;
  58 +/** 选中*/
  59 +@property (nonatomic, copy) NSString *company;
  60 +/** 选中*/
  61 +@property (nonatomic, copy) NSString *contacts;
  62 +/** 选中*/
  63 +@property (nonatomic, copy) NSString *created;
  64 +/** 选中*/
  65 +@property (nonatomic, copy) NSString *dev_id;
  66 +
  67 +/** 选中*/
  68 +@property (nonatomic, copy) NSString *email;
  69 +/** 选中*/
  70 +@property (nonatomic, copy) NSString *htno;
  71 +/** 选中*/
  72 +@property (nonatomic, copy) NSString *idCard;
  73 +/** 选中*/
  74 +@property (nonatomic, copy) NSString *idCardPic;
  75 +/** 选中*/
  76 +@property (nonatomic, copy) NSString *institution_id;
  77 +/** 选中*/
  78 +@property (nonatomic, copy) NSString *isCertification;
  79 +/** 选中*/
  80 +@property (nonatomic, copy) NSString *jianjie;
  81 +/** 选中*/
  82 +@property (nonatomic, copy) NSString *logo;
  83 +/** 选中*/
  84 +@property (nonatomic, copy) NSString *mobile;
  85 +/** 选中*/
  86 +@property (nonatomic, copy) NSString *perm;
  87 +
  88 +/** 选中*/
  89 +@property (nonatomic, copy) NSString *qiyefaren;
  90 +
  91 +/** 选中*/
  92 +@property (nonatomic, copy) NSString *role;
  93 +
  94 +/** 选中*/
  95 +@property (nonatomic, copy) NSString *sequence;
  96 +
  97 +/** 选中*/
  98 +@property (nonatomic, copy) NSString *shzluTime;
  99 +
  100 +/** 选中*/
  101 +@property (nonatomic, copy) NSString *sid;
  102 +
  103 +/** 选中*/
  104 +@property (nonatomic, copy) NSString *siteDomain;
  105 +
  106 +/** 选中*/
  107 +@property (nonatomic, copy) NSString *sname;
  108 +
  109 +/** 选中*/
  110 +@property (nonatomic, copy) NSString *sp_code;
  111 +
  112 +/** 选中*/
  113 +@property (nonatomic, copy) NSString *sp_id;
  114 +
  115 +/** 选中*/
  116 +@property (nonatomic, copy) NSString *status;
  117 +/** 选中*/
  118 +@property (nonatomic, copy) NSString *temp_code;
  119 +/** 选中*/
  120 +@property (nonatomic, copy) NSString *tjsh_time;
  121 +/** 选中*/
  122 +@property (nonatomic, copy) NSString *tm;
  123 +/** 选中*/
  124 +@property (nonatomic, copy) NSString *userLogo;
  125 +
  126 +/** 选中*/
  127 +@property (nonatomic, copy) NSString *userType;
  128 +
  129 +/** 选中*/
  130 +@property (nonatomic, copy) NSString *username;
  131 +
  132 +
  133 +
  134 +@end
  135 +
  136 +NS_ASSUME_NONNULL_END
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Model/CNLiveOrganizationDetailModel.m 0 → 100644
  1 +//
  2 +// CNLiveOrganizationDetailModel.m
  3 +// CNLiveOrganizationValidationModule
  4 +//
  5 +// Created by 梁星国 on 2020/4/15.
  6 +//
  7 +
  8 +#import "CNLiveOrganizationDetailModel.h"
  9 +
  10 +@implementation CNLiveOrganizationDetailModel
  11 +
  12 ++ (NSDictionary *)mj_objectClassInArray{
  13 + return @{
  14 + @"comTypList" : [CNLiveOrganizationTipModel class]
  15 + };//前边,是属性数组的名字,后边就是类名
  16 +}
  17 +
  18 +@end
  19 +
  20 +@implementation CNLiveOrganizationTipModel
  21 +
  22 ++(NSDictionary *)mj_replacedKeyFromPropertyName
  23 +{
  24 + return @{@"ID":@"id"};
  25 +}
  26 +
  27 +
  28 +@end
  29 +
  30 +@implementation CNLiveOrganizationDetailContentModel
  31 +
  32 +
  33 +
  34 +
  35 +@end
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Other/CNLiveBOrganizationPopCell.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 ///选着类型cell 12 ///选着类型cell
@@ -15,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN @@ -15,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN
15 16
16 @interface CNLiveBOrganizationPopCell : UITableViewCell 17 @interface CNLiveBOrganizationPopCell : UITableViewCell
17 18
  19 +@property (strong, nonatomic) CNLiveOrganizationTipModel * model;
  20 +- (void)eidtUIWithModel:(CNLiveOrganizationTipModel *)model selectModel:(CNLiveOrganizationTipModel *)selecteModel;
  21 +
18 @end 22 @end
19 23
20 NS_ASSUME_NONNULL_END 24 NS_ASSUME_NONNULL_END
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Other/CNLiveBOrganizationPopCell.m
@@ -66,9 +66,24 @@ @@ -66,9 +66,24 @@
66 66
67 #pragma mark - editUI 67 #pragma mark - editUI
68 68
69 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath { 69 +- (void)eidtUIWithModel:(CNLiveOrganizationTipModel *)model selectModel:(CNLiveOrganizationTipModel *)selecteModel{
70 70
71 - 71 + if (!model) {
  72 + return;
  73 + }
  74 +
  75 +
  76 + self.titleL.text = [NSString stringWithFormat:@"%@",model.name];
  77 +
  78 + if (selecteModel) {
  79 + if ([[NSString stringWithFormat:@"%@",selecteModel.ID] isEqualToString:[NSString stringWithFormat:@"%@",model.ID]]) {
  80 + self.tipImageV.hidden = NO;
  81 + }else {
  82 + self.tipImageV.hidden = YES;
  83 + }
  84 + }else {
  85 + self.tipImageV.hidden = YES;
  86 + }
72 87
73 } 88 }
74 89
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Other/CNLiveBOrganizationPopSelectedView.h
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 // 7 //
8 8
9 #import <UIKit/UIKit.h> 9 #import <UIKit/UIKit.h>
  10 +#import "CNLiveOrganizationDetailModel.h"
10 11
11 NS_ASSUME_NONNULL_BEGIN 12 NS_ASSUME_NONNULL_BEGIN
12 13
@@ -15,9 +16,11 @@ NS_ASSUME_NONNULL_BEGIN @@ -15,9 +16,11 @@ NS_ASSUME_NONNULL_BEGIN
15 /** 数据数组 */ 16 /** 数据数组 */
16 @property (strong , nonatomic) NSMutableArray *dataSourceArr; 17 @property (strong , nonatomic) NSMutableArray *dataSourceArr;
17 18
  19 +@property (strong , nonatomic) CNLiveOrganizationTipModel *tipSelectModel;
  20 +
18 21
19 /** 点击Cell回调 */ 22 /** 点击Cell回调 */
20 -@property (nonatomic, copy) void(^clickCellBlock)(CNLiveBOrganizationPopSelectedView *view,NSString *text); 23 +@property (nonatomic, copy) void(^clickCellBlock)(CNLiveBOrganizationPopSelectedView *view,CNLiveOrganizationTipModel *tipSelectModel);
21 24
22 -(void)popViewForView:(UIView *)view; 25 -(void)popViewForView:(UIView *)view;
23 26
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Other/CNLiveBOrganizationPopSelectedView.m
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 #import <CNLiveBaseKit/CNLiveBaseKit.h> 12 #import <CNLiveBaseKit/CNLiveBaseKit.h>
13 #import "CNLiveBOrganizationPopCell.h" 13 #import "CNLiveBOrganizationPopCell.h"
14 14
15 -@interface CNLiveBOrganizationPopSelectedView ()<UITableViewDelegate,UITableViewDataSource> 15 +@interface CNLiveBOrganizationPopSelectedView ()<UIGestureRecognizerDelegate,UITableViewDelegate,UITableViewDataSource>
16 { 16 {
17 17
18 } 18 }
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 { 32 {
33 self = [super initWithFrame:frame]; 33 self = [super initWithFrame:frame];
34 if (self) { 34 if (self) {
35 - 35 + self.dataSourceArr = [NSMutableArray array];
36 [self setupUI]; 36 [self setupUI];
37 [self editUI]; 37 [self editUI];
38 38
@@ -53,6 +53,19 @@ @@ -53,6 +53,19 @@
53 } 53 }
54 54
55 #pragma mark - getter,setter 55 #pragma mark - getter,setter
  56 +- (void)setDataSourceArr:(NSMutableArray *)dataSourceArr {
  57 + _dataSourceArr = dataSourceArr;
  58 + if (dataSourceArr.count > 0) {
  59 + [self.tableView reloadData];
  60 + }
  61 +}
  62 +
  63 +- (void)setTipSelectModel:(CNLiveOrganizationTipModel *)tipSelectModel {
  64 + _tipSelectModel = tipSelectModel;
  65 + if (tipSelectModel) {
  66 + [self.tableView reloadData];
  67 + }
  68 +}
56 69
57 70
58 #pragma mark - setupUI 71 #pragma mark - setupUI
@@ -82,6 +95,7 @@ @@ -82,6 +95,7 @@
82 [self.tableView registerClass:[UITableViewHeaderFooterView class] forHeaderFooterViewReuseIdentifier:@"HeaderFooter"]; 95 [self.tableView registerClass:[UITableViewHeaderFooterView class] forHeaderFooterViewReuseIdentifier:@"HeaderFooter"];
83 96
84 UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(viewTapAction:)]; 97 UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(viewTapAction:)];
  98 + tap.delegate = self;
85 [self addGestureRecognizer:tap]; 99 [self addGestureRecognizer:tap];
86 100
87 } 101 }
@@ -100,13 +114,32 @@ @@ -100,13 +114,32 @@
100 114
101 115
102 #pragma mark - delegate 116 #pragma mark - delegate
  117 +
  118 +#pragma mark - UIGestureRecognizer delegate -
  119 +/*- 解决左划手势和确认按钮冲突bug -*/
  120 +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
  121 + // 若为UIButton
  122 + if ([[touch.view class] isKindOfClass:[UITableViewCell class]] || [[touch.view class] isMemberOfClass:[UITableViewCell class]] || [[touch.view class] isKindOfClass:[UITableView class]] || [[touch.view class] isMemberOfClass:[UITableView class]] ||[NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"] ) {
  123 + // UIButton 不需要响应 父视图的手势,保证出发方法 可以正常
  124 + return NO;
  125 + }
  126 + //默认都需要响应
  127 + return YES;
  128 +}
  129 +
  130 +
103 #pragma mark - <UITableViewDelegate,UITableViewDataSource> 131 #pragma mark - <UITableViewDelegate,UITableViewDataSource>
104 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 132 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
105 - return 13; 133 + return self.dataSourceArr.count;
106 } 134 }
107 135
108 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 136 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
109 CNLiveBOrganizationPopCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationPopCell forIndexPath:indexPath]; 137 CNLiveBOrganizationPopCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBOrganizationPopCell forIndexPath:indexPath];
  138 + if (indexPath.row < self.dataSourceArr.count) {
  139 + CNLiveOrganizationTipModel *model = [self.dataSourceArr objectAtIndex:indexPath.row];
  140 + [cell eidtUIWithModel:model selectModel:self.tipSelectModel];
  141 + }
  142 +
110 143
111 return cell; 144 return cell;
112 } 145 }
@@ -137,13 +170,19 @@ @@ -137,13 +170,19 @@
137 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 170 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
138 171
139 if (self.clickCellBlock) { 172 if (self.clickCellBlock) {
140 - self.clickCellBlock(self, @"影视");  
141 - __weak typeof(self) weakSelf = self;  
142 - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{  
143 - if (weakSelf) {  
144 - [weakSelf dismissView];  
145 - }  
146 - }); 173 + if (indexPath.row < self.dataSourceArr.count) {
  174 + CNLiveOrganizationTipModel *model = [self.dataSourceArr objectAtIndex:indexPath.row];
  175 + self.clickCellBlock(self, model);
  176 +
  177 + __weak typeof(self) weakSelf = self;
  178 + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  179 + if (weakSelf) {
  180 + [weakSelf dismissView];
  181 + }
  182 + });
  183 + }
  184 +
  185 +
147 } 186 }
148 187
149 } 188 }
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Other/CNLiveBOrganizationTextView.h
@@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN @@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN
36 */ 36 */
37 @property (nonatomic, assign) NSInteger contentLengthMax; 37 @property (nonatomic, assign) NSInteger contentLengthMax;
38 38
  39 +@property (nonatomic, strong) NSIndexPath *tvIndexPath;
  40 +
39 41
40 @end 42 @end
41 43
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/Service/CNLiveBOrganizationValidattionService.m
@@ -17,6 +17,8 @@ @@ -17,6 +17,8 @@
17 17
18 @end 18 @end
19 19
  20 +@BeeHiveService(CNLiveBOrganizationValidationProtocol, CNLiveBOrganizationValidattionService)
  21 +
20 @implementation CNLiveBOrganizationValidattionService 22 @implementation CNLiveBOrganizationValidattionService
21 23
22 - (UIViewController *)getOrganizationValidationController:(NSDictionary *)params { 24 - (UIViewController *)getOrganizationValidationController:(NSDictionary *)params {
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/View/CNLiveBOrganizationContentCell.h
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 #import "CNLiveBOrganizationTextField.h" 9 #import "CNLiveBOrganizationTextField.h"
10 #import "CNLiveBOrganizationTextView.h" 10 #import "CNLiveBOrganizationTextView.h"
11 #import "CNLiveBOrganizationButton.h" 11 #import "CNLiveBOrganizationButton.h"
  12 +#import "CNLiveOrganizationDetailModel.h"
12 13
13 ///UITextField 类型 14 ///UITextField 类型
14 #define kCNLiveBOrganizationTFCell @"CNLiveBOrganizationTFCell" 15 #define kCNLiveBOrganizationTFCell @"CNLiveBOrganizationTFCell"
@@ -64,8 +65,9 @@ NS_ASSUME_NONNULL_BEGIN @@ -64,8 +65,9 @@ NS_ASSUME_NONNULL_BEGIN
64 @property (nonatomic, copy) void(^clickSelectedCellBlock)(CNLiveBOrganizationSelectedCell *selectedCell, CNLiveBOrganizationButton *selectedBtn); 65 @property (nonatomic, copy) void(^clickSelectedCellBlock)(CNLiveBOrganizationSelectedCell *selectedCell, CNLiveBOrganizationButton *selectedBtn);
65 66
66 @property (strong, nonatomic) NSIndexPath *indexPath; 67 @property (strong, nonatomic) NSIndexPath *indexPath;
  68 +@property (strong, nonatomic) CNLiveOrganizationTipModel *tipModel;
67 69
68 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath; 70 +- (void)editUIWithIndexPath:(NSIndexPath *)indexPath tipModel:(CNLiveOrganizationTipModel *)tipModel;
69 71
70 @end 72 @end
71 73
@@ -81,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -81,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN
81 83
82 @property (strong, nonatomic) NSIndexPath *indexPath; 84 @property (strong, nonatomic) NSIndexPath *indexPath;
83 85
84 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath; 86 +- (void)editUIWithIndexPath:(NSIndexPath *)indexPath image:(UIImage *)image;
85 87
86 @end 88 @end
87 89
CNLiveOrganizationValidationModule/Classes/CNLiveOrganizationValidationModule/View/CNLiveBOrganizationContentCell.m
@@ -59,6 +59,7 @@ @@ -59,6 +59,7 @@
59 [self addSubview:self.contentTF]; 59 [self addSubview:self.contentTF];
60 [self addSubview:self.titleL]; 60 [self addSubview:self.titleL];
61 [self addSubview:self.contentL]; 61 [self addSubview:self.contentL];
  62 + self.selectionStyle = UITableViewCellSelectionStyleNone;
62 63
63 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textFieldTextChange:) name:UITextFieldTextDidChangeNotification object:nil]; 64 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textFieldTextChange:) name:UITextFieldTextDidChangeNotification object:nil];
64 65
@@ -321,6 +322,7 @@ @@ -321,6 +322,7 @@
321 [self addSubview:self.contentTV]; 322 [self addSubview:self.contentTV];
322 [self addSubview:self.titleL]; 323 [self addSubview:self.titleL];
323 [self addSubview:self.tipImageV]; 324 [self addSubview:self.tipImageV];
  325 + self.selectionStyle = UITableViewCellSelectionStyleNone;
324 326
325 self.tipImageV.frame = CGRectMake(10, 18 , 7, 8); 327 self.tipImageV.frame = CGRectMake(10, 18 , 7, 8);
326 self.titleL.frame = CGRectMake(21.5, 16, 72, 12); 328 self.titleL.frame = CGRectMake(21.5, 16, 72, 12);
@@ -353,6 +355,7 @@ @@ -353,6 +355,7 @@
353 self.contentTV.placeholder = @"请输入企业简介(400字以内)"; 355 self.contentTV.placeholder = @"请输入企业简介(400字以内)";
354 self.contentTV.placeholderFont = [UIFont systemFontOfSize:12]; 356 self.contentTV.placeholderFont = [UIFont systemFontOfSize:12];
355 self.contentTV.placeholderColor = RGBOF(0xB9B9B9); 357 self.contentTV.placeholderColor = RGBOF(0xB9B9B9);
  358 + self.contentTV.tvIndexPath = indexPath;
356 }else { 359 }else {
357 return; 360 return;
358 } 361 }
@@ -477,7 +480,7 @@ @@ -477,7 +480,7 @@
477 [self addSubview:self.titleL]; 480 [self addSubview:self.titleL];
478 [self addSubview:self.selectedBtn]; 481 [self addSubview:self.selectedBtn];
479 [self addSubview:self.tipImageV]; 482 [self addSubview:self.tipImageV];
480 - 483 + self.selectionStyle = UITableViewCellSelectionStyleNone;
481 484
482 self.tipImageV.frame = CGRectMake(10, 18, 7, 8); 485 self.tipImageV.frame = CGRectMake(10, 18, 7, 8);
483 self.titleL.frame = CGRectMake(21.5, 16, 72, 12); 486 self.titleL.frame = CGRectMake(21.5, 16, 72, 12);
@@ -496,7 +499,7 @@ @@ -496,7 +499,7 @@
496 } 499 }
497 500
498 #pragma mark - editUI 501 #pragma mark - editUI
499 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath { 502 +- (void)editUIWithIndexPath:(NSIndexPath *)indexPath tipModel:(nonnull CNLiveOrganizationTipModel *)tipModel {
500 503
501 if (!indexPath) { 504 if (!indexPath) {
502 return; 505 return;
@@ -507,6 +510,15 @@ @@ -507,6 +510,15 @@
507 if (indexPath.section == 0) { 510 if (indexPath.section == 0) {
508 if (indexPath.row == 6) { 511 if (indexPath.row == 6) {
509 self.titleL.text = @"企业类型"; 512 self.titleL.text = @"企业类型";
  513 + if (tipModel) {
  514 + self.selectedBtn.isSelectedStatus = YES;
  515 + self.selectedBtn.textL.text = [NSString stringWithFormat:@"%@",tipModel.name];
  516 +
  517 + }else{
  518 + self.selectedBtn.isSelectedStatus = NO;
  519 + self.selectedBtn.textL.text = @"请选择企业类型";
  520 +
  521 + }
510 522
511 }else { 523 }else {
512 return; 524 return;
@@ -555,7 +567,7 @@ @@ -555,7 +567,7 @@
555 } 567 }
556 568
557 /*** 内容 ***/ 569 /*** 内容 ***/
558 -- (UIButton *)selectedBtn { 570 +- (CNLiveBOrganizationButton *)selectedBtn {
559 571
560 if (!_selectedBtn) { 572 if (!_selectedBtn) {
561 _selectedBtn = [[CNLiveBOrganizationButton alloc]initWithFrame:CGRectMake(104.5, 10, KScreenWidth - 104.5 - 30.5, 28)]; 573 _selectedBtn = [[CNLiveBOrganizationButton alloc]initWithFrame:CGRectMake(104.5, 10, KScreenWidth - 104.5 - 30.5, 28)];
@@ -629,6 +641,7 @@ @@ -629,6 +641,7 @@
629 [self addSubview:self.titleL]; 641 [self addSubview:self.titleL];
630 [self addSubview:self.contentL]; 642 [self addSubview:self.contentL];
631 [self addSubview:self.tipImageV]; 643 [self addSubview:self.tipImageV];
  644 + self.selectionStyle = UITableViewCellSelectionStyleNone;
632 645
633 self.tipImageV.frame = CGRectMake(10, 18 , 7, 8); 646 self.tipImageV.frame = CGRectMake(10, 18 , 7, 8);
634 self.tipImageV.image = [UIImage imageNamedFromOrganization:@"organization_must"]; 647 self.tipImageV.image = [UIImage imageNamedFromOrganization:@"organization_must"];
@@ -649,7 +662,7 @@ @@ -649,7 +662,7 @@
649 } 662 }
650 663
651 #pragma mark - editUI 664 #pragma mark - editUI
652 -- (void)editUIWithIndexPath:(NSIndexPath *)indexPath { 665 +- (void)editUIWithIndexPath:(NSIndexPath *)indexPath image:(UIImage *)image {
653 666
654 self.indexPath = indexPath; 667 self.indexPath = indexPath;
655 668
@@ -669,6 +682,14 @@ @@ -669,6 +682,14 @@
669 self.contentL.frame = CGRectMake(104.5, self.contentImageView.bottom + 6, KScreenWidth - 104.5 - 30.5, 30); 682 self.contentL.frame = CGRectMake(104.5, self.contentImageView.bottom + 6, KScreenWidth - 104.5 - 30.5, 30);
670 self.contentImageView.image = [UIImage imageNamedFromOrganization:@"organization_selectedImageS"]; 683 self.contentImageView.image = [UIImage imageNamedFromOrganization:@"organization_selectedImageS"];
671 self.contentImageView.tipLabel.frame = CGRectMake(0, 60 - 19, 60, 19); 684 self.contentImageView.tipLabel.frame = CGRectMake(0, 60 - 19, 60, 19);
  685 +
  686 + if (image) {
  687 + self.contentImageView.tipLabel.hidden = NO;
  688 + self.contentImageView.image = image;
  689 + }else {
  690 + self.contentImageView.tipLabel.hidden = YES;
  691 + }
  692 +
672 #pragma mark - TODO:判断是否有图 693 #pragma mark - TODO:判断是否有图
673 694
674 }else if (indexPath.row == 12){ 695 }else if (indexPath.row == 12){
@@ -684,7 +705,12 @@ @@ -684,7 +705,12 @@
684 self.contentL.frame = CGRectMake(104.5, self.contentImageView.bottom + 6, KScreenWidth - 104.5 - 30.5, 30); 705 self.contentL.frame = CGRectMake(104.5, self.contentImageView.bottom + 6, KScreenWidth - 104.5 - 30.5, 30);
685 self.contentImageView.image = [UIImage imageNamedFromOrganization:@"organization_selectedImageL"]; 706 self.contentImageView.image = [UIImage imageNamedFromOrganization:@"organization_selectedImageL"];
686 self.contentImageView.tipLabel.frame = CGRectMake(0, 137 - 19, 100, 19); 707 self.contentImageView.tipLabel.frame = CGRectMake(0, 137 - 19, 100, 19);
687 -#pragma mark - TODO:判断是否有图 708 + if (image) {
  709 + self.contentImageView.tipLabel.hidden = NO;
  710 + self.contentImageView.image = image;
  711 + }else {
  712 + self.contentImageView.tipLabel.hidden = YES;
  713 + }
688 714
689 }else { 715 }else {
690 return; 716 return;
Example/CNLiveOrganizationValidationModule.xcodeproj/project.pbxproj
@@ -452,7 +452,7 @@ @@ -452,7 +452,7 @@
452 "${PODS_ROOT}/Target Support Files/Pods-CNLiveOrganizationValidationModule_Example/Pods-CNLiveOrganizationValidationModule_Example-resources.sh", 452 "${PODS_ROOT}/Target Support Files/Pods-CNLiveOrganizationValidationModule_Example/Pods-CNLiveOrganizationValidationModule_Example-resources.sh",
453 "${PODS_ROOT}/BaiduMapKit/BaiduMapKit/BaiduMapAPI_Map.framework/mapapi.bundle", 453 "${PODS_ROOT}/BaiduMapKit/BaiduMapKit/BaiduMapAPI_Map.framework/mapapi.bundle",
454 "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveShareToolKit/CNLiveShareToolKit.bundle", 454 "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveShareToolKit/CNLiveShareToolKit.bundle",
455 - "${PODS_ROOT}/WeiboSDK/libWeiboSDK/WeiboSDK.bundle", 455 + "${PODS_ROOT}/Weibo_SDK/libWeiboSDK/WeiboSDK.bundle",
456 ); 456 );
457 name = "[CP] Copy Pods Resources"; 457 name = "[CP] Copy Pods Resources";
458 outputPaths = ( 458 outputPaths = (