Commit 5e80a8de14f7bffa8451dfdfecbf402bef02bac0
1 parent
a1f1ca91
个人资料认证分组
Showing
75 changed files
with
2332 additions
and
202 deletions
CNLiveBPersonalVerificationModule.podspec
| ... | ... | @@ -31,43 +31,71 @@ TODO: Add long description of the pod here. |
| 31 | 31 | s.ios.deployment_target = '9.0' |
| 32 | 32 | |
| 33 | 33 | # s.source_files = 'CNLiveBPersonalVerificationModule/Classes/**/*' |
| 34 | -s.subspec 'Controller' do |controller| | |
| 35 | - controller.source_files = 'CNLiveBPersonalVerificationModule/Classes/Controller/*.{h,m}' | |
| 36 | -# controller.dependency 'CNLiveBPersonalVerificationModule/ViewModel' | |
| 37 | -# controller.dependency 'CNLiveBPersonalVerificationModule/Model' | |
| 38 | - controller.dependency 'CNLiveBPersonalVerificationModule/View' | |
| 39 | -end | |
| 40 | -s.subspec 'View' do |view| | |
| 41 | - view.source_files = 'CNLiveBPersonalVerificationModule/Classes/View/*.{h,m}' | |
| 42 | - view.dependency 'CNLiveBPersonalVerificationModule/ViewModel' | |
| 43 | - view.dependency 'CNLiveBPersonalVerificationModule/Model' | |
| 44 | -end | |
| 45 | -s.subspec 'Model' do |model| | |
| 46 | - model.source_files = 'CNLiveBPersonalVerificationModule/Classes/Model/*.{h,m}' | |
| 47 | -end | |
| 48 | -s.subspec 'ViewModel' do |viewModel| | |
| 49 | - viewModel.source_files = 'CNLiveBPersonalVerificationModule/Classes/ViewModel/*.{h,m}' | |
| 50 | -end | |
| 51 | -s.dependency 'CNLiveTripartiteManagement/Masonry' | |
| 52 | -s.dependency 'CNLiveTripartiteManagement/QMUIKit' | |
| 53 | -s.dependency 'CNLiveTripartiteManagement/MJExtension' | |
| 54 | -s.dependency 'CNLiveTripartiteManagement/SDWebImage' | |
| 55 | -s.dependency 'CNLiveTripartiteManagement/MJRefresh' | |
| 56 | -#基础库 | |
| 57 | -s.dependency 'CNLiveBaseKit' | |
| 58 | -#基础类目 | |
| 59 | -s.dependency 'CNLiveCommonCategory' | |
| 60 | -#基础UI | |
| 61 | -s.dependency 'CNLiveCustomUI' | |
| 62 | -#用户库 | |
| 63 | - s.dependency 'CNLiveUserManagement' | |
| 64 | - #网络请求 | |
| 65 | - s.dependency 'CNLiveRequestBastKit' | |
| 66 | -s.resource_bundles = { | |
| 67 | - 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle'] | |
| 68 | -} | |
| 34 | +s.subspec 'CNBInstitutionInfo' do |institution| | |
| 35 | + institution.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/**' | |
| 36 | + institution.subspec 'Controller' do |controller| | |
| 37 | + controller.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/*.{h,m}' | |
| 38 | + controller.dependency 'CNLiveBPersonalVerificationModule/CNBInstitutionInfo/View' | |
| 39 | + end | |
| 40 | + institution.subspec 'View' do |view| | |
| 41 | + view.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/*.{h,m}' | |
| 42 | + view.dependency 'CNLiveBPersonalVerificationModule/CNBInstitutionInfo/ViewModel' | |
| 43 | + view.dependency 'CNLiveBPersonalVerificationModule/CNBInstitutionInfo/Model' | |
| 44 | + end | |
| 45 | + institution.subspec 'Model' do |model| | |
| 46 | + model.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Model/*.{h,m}' | |
| 47 | + end | |
| 48 | + institution.subspec 'ViewModel' do |viewModel| | |
| 49 | + viewModel.source_files = 'CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/*.{h,m}' | |
| 50 | + viewModel.dependency 'CNLiveBPersonalVerificationModule/CNBInstitutionInfo/Model' | |
| 51 | + end | |
| 52 | + institution.resource_bundles = { | |
| 53 | + 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle'] | |
| 54 | + } | |
| 55 | + institution.dependency 'CNLiveTripartiteManagement/Masonry' | |
| 56 | + institution.dependency 'CNLiveTripartiteManagement/QMUIKit' | |
| 57 | + institution.dependency 'CNLiveTripartiteManagement/MJExtension' | |
| 58 | + institution.dependency 'CNLiveTripartiteManagement/SDWebImage' | |
| 59 | + institution.dependency 'CNLiveTripartiteManagement/MJRefresh' | |
| 60 | + institution.dependency 'CNLiveTripartiteManagement/YYKit' | |
| 61 | + institution.dependency 'CNLiveTripartiteManagement/AFNetworking' | |
| 62 | + #基础库 | |
| 63 | + institution.dependency 'CNLiveBaseKit' | |
| 64 | + #基础类目 | |
| 65 | + institution.dependency 'CNLiveCommonCategory' | |
| 66 | + ##基础UI | |
| 67 | + institution.dependency 'CNLiveCustomUI' | |
| 68 | + ##用户库 | |
| 69 | + institution.dependency 'CNLiveUserManagement' | |
| 70 | + # #网络请求 | |
| 71 | + institution.dependency 'CNLiveRequestBastKit' | |
| 72 | + institution.dependency 'CNLiveEnvironment' | |
| 73 | + institution.dependency 'CNLiveBaseClass' | |
| 74 | + end | |
| 75 | + | |
| 76 | + | |
| 77 | +#s.dependency 'CNLiveTripartiteManagement/Masonry' | |
| 78 | +#s.dependency 'CNLiveTripartiteManagement/QMUIKit' | |
| 79 | +#s.dependency 'CNLiveTripartiteManagement/MJExtension' | |
| 80 | +#s.dependency 'CNLiveTripartiteManagement/SDWebImage' | |
| 81 | +#s.dependency 'CNLiveTripartiteManagement/MJRefresh' | |
| 82 | +#s.dependency 'CNLiveTripartiteManagement/YYKit' | |
| 83 | +#s.dependency 'CNLiveTripartiteManagement/AFNetworking' | |
| 84 | +##基础库 | |
| 85 | +#s.dependency 'CNLiveBaseKit' | |
| 86 | +##基础类目 | |
| 87 | +#s.dependency 'CNLiveCommonCategory' | |
| 88 | +###基础UI | |
| 89 | +#s.dependency 'CNLiveCustomUI' | |
| 90 | +###用户库 | |
| 91 | +# s.dependency 'CNLiveUserManagement' | |
| 92 | +## #网络请求 | |
| 93 | +# s.dependency 'CNLiveRequestBastKit' | |
| 94 | +# s.dependency 'CNLiveEnvironment' | |
| 95 | +# s.dependency 'CNLiveBaseClass' | |
| 96 | +#s.resource_bundles = { | |
| 97 | +# 'CNLiveBPersonalVerificationModule' => ['CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle'] | |
| 98 | +#} | |
| 69 | 99 | |
| 70 | - # s.public_header_files = 'Pod/Classes/**/*.h' | |
| 71 | - s.frameworks = 'UIKit', 'Foundation' | |
| 72 | - # s.dependency 'AFNetworking', '~> 2.3' | |
| 100 | +# s.frameworks = 'UIKit', 'Foundation' | |
| 73 | 101 | end | ... | ... |
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/add@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/add@2x.png
476 Bytes
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/add@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/add@3x.png
722 Bytes
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/add_jigou@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/add_jigou@2x.png
418 Bytes
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/add_jigou@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/add_jigou@3x.png
771 Bytes
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/authSuccess@2x.png
0 → 100644
27.6 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/authSuccess@3x.png
0 → 100644
61.6 KB
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/bitian@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/bitian@2x.png
672 Bytes
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/bitian@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/bitian@3x.png
1.11 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/dd_wlcw@2x.png
0 → 100644
54.8 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/dd_wlcw@3x.png
0 → 100644
123 KB
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/delete-icon@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/delete-icon@2x.png
1.89 KB
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/delete-icon@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/delete-icon@3x.png
4.04 KB
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/delete@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/delete@2x.png
814 Bytes
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/delete@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/delete@3x.png
1.31 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/dl_xuanzhong@2x.png
0 → 100644
1.34 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/dl_xuanzhong@3x.png
0 → 100644
2.8 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/gz_faqiqunliao_wxz@2x.png
0 → 100644
1.11 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/gz_faqiqunliao_wxz@3x.png
0 → 100644
2.01 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/perAuth_Sure@2x.png
0 → 100644
903 Bytes
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/perAuth_Sure@3x.png
0 → 100644
1.61 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/perAuth_cancel@2x.png
0 → 100644
986 Bytes
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/perAuth_cancel@3x.png
0 → 100644
2.05 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/typeicon@2x.png
0 → 100644
20.4 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/typeicon@3x.png
0 → 100644
39.8 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/wufalianjie@2x.png
0 → 100644
51.4 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/wufalianjie@3x.png
0 → 100644
116 KB
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/xinxi@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/xinxi@2x.png
909 Bytes
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/xinxi@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/xinxi@3x.png
1.54 KB
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/xuanze@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/xuanze@2x.png
563 Bytes
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/xuanze@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/xuanze@3x.png
914 Bytes
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/xzjg@2x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/xzjg@2x.png
1.16 KB
CNLiveBPersonalVerificationModule/Assets/CNLiveBPersonalVerificationModule.bundle/xzjg@3x.png renamed to CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/xzjg@3x.png
2.27 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/yixuan@2x.png
0 → 100644
933 Bytes
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/yixuan@3x.png
0 → 100644
1.72 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/zanwuquanzi@2x.png
0 → 100644
22 KB
CNLiveBPersonalVerificationModule/Assets/CNBInstitutionInfo/CNLiveBPersonalVerificationModule.bundle/zanwuquanzi@3x.png
0 → 100644
40.8 KB
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerAuthSuccessController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthSuccessController.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNBPerAuthSuccessController : UIViewController | |
| 13 | + | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerAuthSuccessController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthSuccessController.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPerAuthSuccessController.h" | |
| 9 | +#import "CNBPersonalInfoCell.h" | |
| 10 | +#import "UIColor+CNLiveExtension.h" | |
| 11 | +#import "CNLiveBaseKit.h" | |
| 12 | +#import "CNBPerAuthHeaderView.h" | |
| 13 | +#import "CNBPerAuthViewModel.h" | |
| 14 | +#import "CNBPerCertificationSuccessModel.h" | |
| 15 | +static NSString *infoIdentifier = @"CNBPersonalInfoCell"; | |
| 16 | +static NSString *normalIdentifier = @"CNBInstitutionsInfoCell"; | |
| 17 | +static NSString *groupIdentifier = @"CNBGroupInfoCell"; | |
| 18 | +@interface CNBPerAuthSuccessController ()<UITableViewDelegate,UITableViewDataSource> | |
| 19 | +@property (nonatomic, strong) UITableView *tableView; | |
| 20 | +@property (nonatomic, strong) NSMutableArray *institutionArray; | |
| 21 | +@property (nonatomic, strong) CNBUserInfoModel *infoModel; | |
| 22 | +@property (nonatomic, strong) NSMutableArray *circleArray; | |
| 23 | +@end | |
| 24 | + | |
| 25 | +@implementation CNBPerAuthSuccessController | |
| 26 | + | |
| 27 | +- (void)viewDidLoad { | |
| 28 | + [super viewDidLoad]; | |
| 29 | + [self.view addSubview:self.tableView]; | |
| 30 | + self.title = @"身份校验"; | |
| 31 | + [self requestPerAuthSuccessData]; | |
| 32 | +} | |
| 33 | +#pragma mark - 请求数据 | |
| 34 | +- (void)requestPerAuthSuccessData { | |
| 35 | + __weak typeof(self) weakSelf = self; | |
| 36 | + [CNBPerAuthViewModel getPerAuthSuccessList:^(NSMutableArray * _Nonnull dataArray) { | |
| 37 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 38 | + if (!strongSelf) { | |
| 39 | + return ; | |
| 40 | + } | |
| 41 | + CNBPerCertificationSuccessModel *successModel = dataArray[0]; | |
| 42 | + strongSelf.infoModel = successModel.bUserIdentity; | |
| 43 | + for (CNBInstitutionModel *model in successModel.institution) { | |
| 44 | + [strongSelf.institutionArray addObject:model]; | |
| 45 | + } | |
| 46 | + [strongSelf.institutionArray insertObject:successModel.bUserIdentity atIndex:0]; | |
| 47 | + [strongSelf.tableView reloadData]; | |
| 48 | + } failureBlock:^(NSError * _Nonnull error) { | |
| 49 | + | |
| 50 | + }]; | |
| 51 | +} | |
| 52 | +#pragma mark - 点击放大图片 | |
| 53 | +#pragma mark - tableViewDelegateAndDataSource | |
| 54 | +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | |
| 55 | + return self.institutionArray.count; | |
| 56 | +} | |
| 57 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 58 | + CNBInstitutionModel *model = [[CNBInstitutionModel alloc]init]; | |
| 59 | + if (self.institutionArray.count > 0) { | |
| 60 | + model = self.institutionArray[section]; | |
| 61 | + } | |
| 62 | + if (section == 0) { | |
| 63 | + return 1; | |
| 64 | + }else { | |
| 65 | + return model.quanziItem.count > 0 ? (model.quanziItem.count + 1):2; | |
| 66 | + | |
| 67 | + } | |
| 68 | +} | |
| 69 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 70 | + if (indexPath.section == 0) { | |
| 71 | + CNBPersonalInfoCell *infoCell = [tableView dequeueReusableCellWithIdentifier:infoIdentifier]; | |
| 72 | + if (!infoCell) { | |
| 73 | + infoCell = [[CNBPersonalInfoCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:infoIdentifier]; | |
| 74 | + } | |
| 75 | + infoCell.infoModel = self.infoModel; | |
| 76 | + return infoCell; | |
| 77 | + }else { | |
| 78 | + if (indexPath.row == 0) { | |
| 79 | + CNBInstitutionsInfoCell *normalCell = [tableView dequeueReusableCellWithIdentifier:normalIdentifier]; | |
| 80 | + if (!normalCell) { | |
| 81 | + normalCell = [[CNBInstitutionsInfoCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:normalIdentifier]; | |
| 82 | + } | |
| 83 | + normalCell.institutionModel = self.institutionArray[indexPath.section]; | |
| 84 | + return normalCell; | |
| 85 | + }else { | |
| 86 | + CNBGroupInfoCell *groupCell = [tableView dequeueReusableCellWithIdentifier:groupIdentifier]; | |
| 87 | + if (!groupCell) { | |
| 88 | + groupCell = [[CNBGroupInfoCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:groupIdentifier]; | |
| 89 | + } | |
| 90 | + CNBInstitutionModel *model = self.institutionArray[indexPath.section]; | |
| 91 | + NSArray *circleArray = model.quanziItem; | |
| 92 | + groupCell.circleModel = circleArray[indexPath.row -1]; | |
| 93 | + return groupCell; | |
| 94 | + } | |
| 95 | + } | |
| 96 | +} | |
| 97 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 98 | + if (indexPath.section == 0) { | |
| 99 | + return 232; | |
| 100 | + }else { | |
| 101 | + if (indexPath.row == 0) { | |
| 102 | + return 40; | |
| 103 | + }else { | |
| 104 | + return UITableViewAutomaticDimension; | |
| 105 | + } | |
| 106 | + } | |
| 107 | +} | |
| 108 | +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { | |
| 109 | + if (section == 0) { | |
| 110 | + return [UIView new]; | |
| 111 | + }else { | |
| 112 | + CNBPerAuthHeaderView *headerView = [[CNBPerAuthHeaderView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 41)]; | |
| 113 | + headerView.backgroundColor = [UIColor whiteColor]; | |
| 114 | + return headerView; | |
| 115 | + } | |
| 116 | +} | |
| 117 | +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { | |
| 118 | + if (section == 0) { | |
| 119 | + return 0.01; | |
| 120 | + }else { | |
| 121 | + return 41; | |
| 122 | + } | |
| 123 | +} | |
| 124 | +- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { | |
| 125 | + UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 10)]; | |
| 126 | + view.backgroundColor = CNLiveColorWithHexString(@"F2F2F2"); | |
| 127 | + return view; | |
| 128 | +} | |
| 129 | +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { | |
| 130 | + return 10; | |
| 131 | +} | |
| 132 | +#pragma mark - Lazy | |
| 133 | +- (UITableView *)tableView { | |
| 134 | + if (!_tableView) { | |
| 135 | + _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,kNavigationBarHeight , KScreenWidth, KScreenHeight - kNavigationBarHeight) style:UITableViewStyleGrouped]; | |
| 136 | + _tableView.delegate = self; | |
| 137 | + _tableView.dataSource = self; | |
| 138 | + _tableView.backgroundColor = CNLiveColorWithHexString(@"F2F2F2"); | |
| 139 | + _tableView.estimatedRowHeight = 70; | |
| 140 | + if (@available(iOS 11.0, *)) { | |
| 141 | + _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | |
| 142 | + | |
| 143 | + } else { | |
| 144 | + self.automaticallyAdjustsScrollViewInsets = NO; | |
| 145 | + } | |
| 146 | + } | |
| 147 | + return _tableView; | |
| 148 | +} | |
| 149 | +- (NSMutableArray *)institutionArray { | |
| 150 | + if (!_institutionArray) { | |
| 151 | + _institutionArray = [NSMutableArray array]; | |
| 152 | + } | |
| 153 | + return _institutionArray; | |
| 154 | +} | |
| 155 | +- (NSMutableArray *)circleArray { | |
| 156 | + if (!_circleArray) { | |
| 157 | + _circleArray = [NSMutableArray array]; | |
| 158 | + } | |
| 159 | + return _circleArray; | |
| 160 | +} | |
| 161 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerCertificationController.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerCertificationController.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/16. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +typedef NS_ENUM(NSUInteger,CNBShowCertificatType) { //审核类型 | |
| 10 | + CNBShowCertificatTypeFail, //审核失败 | |
| 11 | + CNBShowCertificatTypeNone, //没验证 | |
| 12 | + CNBShowCertificatTypeAuditing //审核中 | |
| 13 | +}; | |
| 14 | +NS_ASSUME_NONNULL_BEGIN | |
| 15 | + | |
| 16 | +@interface CNBPerCertificationController : UIViewController | |
| 17 | +- (instancetype)initControllerWithCertificatType:(CNBShowCertificatType)type; | |
| 18 | +@end | |
| 19 | + | |
| 20 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPerCertificationController.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerCertificationController.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/16. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPerCertificationController.h" | |
| 9 | +#import "CNLivePerAuthGetImage.h" | |
| 10 | +#import <Masonry/Masonry.h> | |
| 11 | +#import "CNLiveBaseKit.h" | |
| 12 | +#import "UIColor+CNLiveExtension.h" | |
| 13 | +@interface CNBPerCertificationController () | |
| 14 | +@property (nonatomic, assign) CNBShowCertificatType type; | |
| 15 | +@property (nonatomic, strong) UIImageView *showImageV; | |
| 16 | +@property (nonatomic, strong) UILabel *titleLabel; | |
| 17 | +@property (nonatomic, strong) UIButton *sureBtn; | |
| 18 | +@end | |
| 19 | + | |
| 20 | +@implementation CNBPerCertificationController | |
| 21 | + | |
| 22 | +- (instancetype)initControllerWithCertificatType:(CNBShowCertificatType)type { | |
| 23 | + if (self = [super init]) { | |
| 24 | + _type = type; | |
| 25 | + } | |
| 26 | + return self; | |
| 27 | +} | |
| 28 | +- (void)viewDidLoad { | |
| 29 | + [super viewDidLoad]; | |
| 30 | + NSString *text = @""; | |
| 31 | + NSString *buttonName = @""; | |
| 32 | + if (self.type == CNBShowCertificatTypeFail){ | |
| 33 | + self.title = @"个人认证"; | |
| 34 | + text = @"您申请的个人认证审核未通过\n原因:您提交的公司信息有误,请重新申请"; | |
| 35 | + buttonName = @"重新申请"; | |
| 36 | + }else if (self.type == CNBShowCertificatTypeAuditing) { | |
| 37 | + self.title = @"个人认证"; | |
| 38 | + text = @"请您耐心等待,后台正在提交审核中"; | |
| 39 | + buttonName = @"返回"; | |
| 40 | + }else { | |
| 41 | + self.title = @"身份校验"; | |
| 42 | + text = @"亲,您未申请个人认证"; | |
| 43 | + buttonName = @"去认证"; | |
| 44 | + } | |
| 45 | + [self configUI]; | |
| 46 | + self.titleLabel.text = text; | |
| 47 | + [self.sureBtn setTitle:buttonName forState:UIControlStateNormal]; | |
| 48 | + | |
| 49 | +} | |
| 50 | +#pragma mark - 配置UI | |
| 51 | +- (void)configUI { | |
| 52 | + [self.view addSubview:self.showImageV]; | |
| 53 | + [self.view addSubview:self.titleLabel]; | |
| 54 | + [self.view addSubview:self.sureBtn]; | |
| 55 | + __weak typeof(self) weakSelf = self; | |
| 56 | + [_showImageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 57 | + make.centerY.mas_equalTo(weakSelf.view.mas_centerY).offset(-60); | |
| 58 | + make.centerX.mas_equalTo(weakSelf.view.mas_centerX); | |
| 59 | + make.size.mas_equalTo(CGSizeMake(182, 116.5)); | |
| 60 | + }]; | |
| 61 | + [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 62 | + make.top.mas_equalTo(weakSelf.showImageV.mas_bottom).offset(26); | |
| 63 | +// make.height.mas_equalTo(16); | |
| 64 | + make.left.mas_equalTo(weakSelf.view.mas_left).offset(40); | |
| 65 | + make.right.mas_equalTo(weakSelf.view.mas_right).offset(-40); | |
| 66 | + }]; | |
| 67 | + [_sureBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 68 | + make.top.mas_equalTo(weakSelf.titleLabel.mas_bottom).offset(51); | |
| 69 | + make.height.mas_equalTo(45); | |
| 70 | + make.left.mas_equalTo(weakSelf.view.mas_left).offset(23); | |
| 71 | + make.right.mas_equalTo(weakSelf.view.mas_right).offset(-23); | |
| 72 | + }]; | |
| 73 | +} | |
| 74 | +#pragma mark - Action | |
| 75 | +- (void)sureBtnAction { | |
| 76 | + | |
| 77 | +} | |
| 78 | +#pragma mark - lazy | |
| 79 | +- (UIImageView *)showImageV { | |
| 80 | + if (!_showImageV) { | |
| 81 | + _showImageV = [[UIImageView alloc]init]; | |
| 82 | + _showImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"typeicon" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]]; | |
| 83 | + } | |
| 84 | + return _showImageV; | |
| 85 | +} | |
| 86 | +- (UILabel *)titleLabel { | |
| 87 | + if (!_titleLabel) { | |
| 88 | + _titleLabel = [[UILabel alloc]init]; | |
| 89 | + _titleLabel.textColor = CNLiveColorWithHexString(@"999999"); | |
| 90 | + _titleLabel.font = [UIFont systemFontOfSize:15]; | |
| 91 | + _titleLabel.numberOfLines = 0; | |
| 92 | + _titleLabel.textAlignment = NSTextAlignmentCenter; | |
| 93 | + } | |
| 94 | + return _titleLabel; | |
| 95 | +} | |
| 96 | +- (UIButton *)sureBtn { | |
| 97 | + if (!_sureBtn) { | |
| 98 | + _sureBtn = [[UIButton alloc]init]; | |
| 99 | + [_sureBtn setTitle:@"返回" forState:UIControlStateNormal]; | |
| 100 | + [_sureBtn setBackgroundColor:CNLiveColorWithHexString(@"4CAAFC")]; | |
| 101 | + [_sureBtn setTitleColor:CNLiveColorWithHexString(@"FFFFFF") forState:UIControlStateNormal]; | |
| 102 | + _sureBtn.titleLabel.font = [UIFont systemFontOfSize:18]; | |
| 103 | + _sureBtn.layer.cornerRadius = 22.5; | |
| 104 | + [_sureBtn addTarget:self action:@selector(sureBtnAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 105 | + } | |
| 106 | + return _sureBtn; | |
| 107 | +} | |
| 108 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/Controller/CNBPersonalVerificationController.h renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPersonalVerificationController.h
CNLiveBPersonalVerificationModule/Classes/Controller/CNBPersonalVerificationController.m renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Controller/CNBPersonalVerificationController.m
| ... | ... | @@ -16,6 +16,10 @@ |
| 16 | 16 | #import "CNBIdentifierModel.h" |
| 17 | 17 | #import "MJExtension.h" |
| 18 | 18 | #import "CNBPerAuthFooterTBView.h" |
| 19 | +#import "CNBPerAuthManager.h" | |
| 20 | +#import "CNBPerAuthSelectTypeModel.h" | |
| 21 | +#import "CNUserInfoManager.h" | |
| 22 | +#import "CNBPerAuthViewModel.h" | |
| 19 | 23 | #define CNBHeaderShowHeight 43 |
| 20 | 24 | #define CNBAffiliationCellIdentifier @"CNBPersonalVerificationCell" |
| 21 | 25 | #define CNBCircleGroupIdentifier @"CNBCircleGroupCell" |
| ... | ... | @@ -27,10 +31,21 @@ |
| 27 | 31 | @property (nonatomic, strong) UITableView *tableView; |
| 28 | 32 | @property (nonatomic, strong) NSMutableArray *sectionArray ; //有几个组 //存放字符串 0 不可删除 1可删除 |
| 29 | 33 | @property (nonatomic, strong) CNBPerAuthFooterTBView *footerTBView; |
| 34 | +@property (nonatomic, copy) NSString *spId; | |
| 30 | 35 | @end |
| 31 | 36 | |
| 32 | 37 | @implementation CNBPersonalVerificationController |
| 33 | 38 | |
| 39 | +- (void)dealloc { | |
| 40 | + NSLog(@"个人认证走了dealloc"); | |
| 41 | + [[CNBPerAuthManager shareManager].instSelectedArray removeAllObjects]; | |
| 42 | + [[CNBPerAuthManager shareManager].circleDic removeAllObjects]; | |
| 43 | +} | |
| 44 | +- (void)viewDidDisappear:(BOOL)animated{ | |
| 45 | + [super viewDidDisappear:animated]; | |
| 46 | + [[CNBPerAuthManager shareManager].instSelectedArray removeAllObjects]; | |
| 47 | + [[CNBPerAuthManager shareManager].circleDic removeAllObjects]; | |
| 48 | +} | |
| 34 | 49 | - (void)viewDidLoad { |
| 35 | 50 | [super viewDidLoad]; |
| 36 | 51 | self.title = @"填写机构资料"; |
| ... | ... | @@ -40,21 +55,25 @@ |
| 40 | 55 | [self.view addSubview:self.tableView]; |
| 41 | 56 | [self.tableView reloadData]; |
| 42 | 57 | } |
| 58 | +#pragma mark - 开始创建数据 | |
| 43 | 59 | - (void)addData:(NSString *)isDelete addSection:(NSString *)addSection{ |
| 44 | - NSMutableArray *typeArray = [NSMutableArray array]; | |
| 60 | + NSMutableArray *typeArray = [NSMutableArray array]; | |
| 45 | 61 | NSArray *array = @[ |
| 46 | - @{@"type":@"0",@"isDelete":@"0"}, | |
| 47 | - @{@"type":@"1",@"isDelete":@"0"}, | |
| 48 | - @{@"type":@"2",@"isDelete":@"0"}, | |
| 49 | - @{@"type":@"3",@"isDelete":@"0"}, | |
| 50 | - @{@"type":@"4",@"isDelete":@"0"} | |
| 51 | - ]; | |
| 52 | - for (NSDictionary *dic in array) { | |
| 53 | - CNBTypeModel *model = [CNBTypeModel mj_objectWithKeyValues:dic]; | |
| 54 | - [typeArray addObject:model]; | |
| 55 | - } | |
| 62 | + @{@"showType":@"0",@"isDelete":@"0",@"addSection":addSection,@"addRow":@0,@"institutionsName":@"",@"circleName":@"",@"groupName":@"",@"spId":@"",@"type":@"",@"homePageId":@"",@"groupArray":@[] | |
| 63 | + }, | |
| 64 | + @{@"showType":@"1",@"isDelete":@"0",@"addSection":addSection,@"addRow":@1,@"institutionsName":@"",@"circleName":@"",@"groupName":@"",@"spId":@"",@"type":@"",@"homePageId":@"",@"groupArray":@[] | |
| 65 | + }, | |
| 66 | + @{@"showType":@"2",@"isDelete":@"0",@"addSection":addSection,@"addRow":@2,@"institutionsName":@"",@"circleName":@"",@"groupName":@"",@"spId":@"",@"type":@"",@"homePageId":@"",@"groupArray":@[] | |
| 67 | + } | |
| 68 | + // @{@"type":@"3",@"isDelete":@"0"}, | |
| 69 | + // @{@"type":@"4",@"isDelete":@"0"} | |
| 70 | + ]; | |
| 71 | + for (NSDictionary *dic in array) { | |
| 72 | + CNBTypeModel *model = [CNBTypeModel mj_objectWithKeyValues:dic]; | |
| 73 | + [typeArray addObject:model]; | |
| 74 | + } | |
| 56 | 75 | NSArray *sectionArray = @[ |
| 57 | - @{@"isDelete":isDelete,@"addSection":addSection,@"typeArray":typeArray}, | |
| 76 | + @{@"isDelete":isDelete,@"addSection":addSection,@"typeArray":typeArray,@"institutionName":@"",@"institutionId":@""}, | |
| 58 | 77 | ]; |
| 59 | 78 | for (NSDictionary *dic in sectionArray) { |
| 60 | 79 | CNBAddSectionModel *model = [CNBAddSectionModel mj_objectWithKeyValues:dic]; |
| ... | ... | @@ -71,6 +90,26 @@ |
| 71 | 90 | make.height.mas_equalTo(43); |
| 72 | 91 | }]; |
| 73 | 92 | } |
| 93 | +#pragma mark - 字典或者数组转成Json字符串 | |
| 94 | +- (NSString *)objectToJson:(id)obj{ | |
| 95 | + if (obj == nil) { | |
| 96 | + return nil; | |
| 97 | + } | |
| 98 | + NSError *error = nil; | |
| 99 | + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:obj | |
| 100 | + options:0 | |
| 101 | + error:&error]; | |
| 102 | + | |
| 103 | + if ([jsonData length] && error == nil){ | |
| 104 | + return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; | |
| 105 | + }else{ | |
| 106 | + return nil; | |
| 107 | + } | |
| 108 | +} | |
| 109 | +#pragma mark - 通知 | |
| 110 | +//- (void)refresTableView:(NSNotification *)noti { | |
| 111 | +// [self.tableView reloadData]; | |
| 112 | +//} | |
| 74 | 113 | #pragma mark - tableDelegateAndtableDataSource |
| 75 | 114 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { |
| 76 | 115 | return self.sectionArray.count; |
| ... | ... | @@ -83,47 +122,64 @@ |
| 83 | 122 | CNBAddSectionModel *sectionModel = self.sectionArray[indexPath.section]; |
| 84 | 123 | CNBTypeModel *model = sectionModel.typeArray[indexPath.row]; |
| 85 | 124 | __weak typeof(self) weakSelf = self; |
| 86 | - if ([model.type isEqualToString:@"0"]) { | |
| 125 | + if ([model.showType isEqualToString:@"0"]) { | |
| 87 | 126 | CNBPersonalVerificationCell *cell = [tableView dequeueReusableCellWithIdentifier:CNBAffiliationCellIdentifier]; |
| 88 | 127 | if (!cell) { |
| 89 | 128 | cell = [[CNBPersonalVerificationCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CNBAffiliationCellIdentifier]; |
| 90 | 129 | } |
| 130 | + cell.typeModel = model; | |
| 131 | + cell.sectionModel = sectionModel; | |
| 132 | + self.spId = model.spId; | |
| 133 | + cell.refreshDataBlock = ^{ //选择完机构刷新 | |
| 134 | + [weakSelf.tableView reloadData]; | |
| 135 | + }; | |
| 91 | 136 | return cell; |
| 92 | - }else if ([model.type isEqualToString:@"1"]) { | |
| 137 | + }else if ([model.showType isEqualToString:@"1"]) { | |
| 93 | 138 | CNBCircleGroupCell *circleCell = [tableView dequeueReusableCellWithIdentifier:CNBCircleGroupIdentifier]; |
| 94 | 139 | if (!circleCell) { |
| 95 | 140 | circleCell = [[CNBCircleGroupCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CNBCircleGroupIdentifier]; |
| 96 | 141 | } |
| 97 | - circleCell.typeModel = sectionModel.typeArray[indexPath.row]; | |
| 142 | + circleCell.spIdStr = self.spId; | |
| 143 | + CNBTypeModel *circleModel = sectionModel.typeArray[indexPath.row]; | |
| 144 | + circleCell.typeModel = circleModel; | |
| 98 | 145 | __block NSMutableArray *typeArray = [NSMutableArray arrayWithArray:sectionModel.typeArray]; |
| 99 | - circleCell.circleDeleteBlock = ^{ | |
| 146 | + circleCell.circleDeleteBlock = ^{ //删除圈子 | |
| 100 | 147 | [typeArray removeObjectAtIndex:indexPath.row]; |
| 101 | 148 | sectionModel.typeArray = typeArray; |
| 102 | 149 | [weakSelf.tableView reloadData]; |
| 103 | 150 | }; |
| 151 | + circleCell.refreshDataBlock = ^{ //选择完圈子刷新 | |
| 152 | + [weakSelf.tableView reloadData]; | |
| 153 | + }; | |
| 104 | 154 | return circleCell; |
| 105 | - }else if ([model.type isEqualToString:@"2"]) { | |
| 155 | + }else if ([model.showType isEqualToString:@"2"]) { | |
| 106 | 156 | CNBCircleAddGroupCell *circleAddCell = [tableView dequeueReusableCellWithIdentifier:CNBCircleAddGroupIdentifier]; |
| 107 | 157 | if (!circleAddCell) { |
| 108 | 158 | circleAddCell = [[CNBCircleAddGroupCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CNBCircleAddGroupIdentifier]; |
| 109 | 159 | } |
| 110 | 160 | __block NSMutableArray *circleArray = [NSMutableArray array]; |
| 111 | 161 | __block NSMutableArray *typeArray = [NSMutableArray arrayWithArray:sectionModel.typeArray]; |
| 112 | - circleAddCell.addCircleGroupBlock = ^{ | |
| 162 | + circleAddCell.addCircleGroupBlock = ^{ //添加圈子 | |
| 113 | 163 | CNBTypeModel *addModel = [[CNBTypeModel alloc]init]; |
| 114 | - addModel.type = @"1"; | |
| 164 | + addModel.showType = @"1"; | |
| 115 | 165 | addModel.isDelete = @"1"; |
| 116 | 166 | for (CNBTypeModel *model in typeArray) { |
| 117 | - if ([model.type isEqualToString:@"1"]) { | |
| 167 | + if ([model.showType isEqualToString:@"1"]) { | |
| 118 | 168 | [circleArray addObject:model]; |
| 119 | 169 | } |
| 120 | 170 | } |
| 121 | - [typeArray insertObject:addModel atIndex:circleArray.count + 1]; | |
| 171 | + addModel.addRow = circleArray.count + 1; | |
| 172 | + addModel.addSection = sectionModel.addSection; | |
| 173 | + addModel.circleName = @""; | |
| 174 | + addModel.groupName = @""; | |
| 175 | + addModel.groupArray = @[]; | |
| 176 | + addModel.homePageId = @""; | |
| 177 | + [typeArray insertObject:addModel atIndex:circleArray.count + 1]; | |
| 122 | 178 | sectionModel.typeArray = typeArray; |
| 123 | - [weakSelf.tableView reloadData]; | |
| 179 | + [weakSelf.tableView reloadData]; | |
| 124 | 180 | }; |
| 125 | 181 | return circleAddCell; |
| 126 | - }else if ([model.type isEqualToString:@"3"]) { | |
| 182 | + }else if ([model.showType isEqualToString:@"3"]) { //相关账号不会有了 ,已经删除了 | |
| 127 | 183 | CNBAccountGroupCell *accountCell = [tableView dequeueReusableCellWithIdentifier:CNBAccountGroupIdentifier]; |
| 128 | 184 | if (!accountCell) { |
| 129 | 185 | accountCell = [[CNBAccountGroupCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CNBAccountGroupIdentifier]; |
| ... | ... | @@ -137,7 +193,7 @@ |
| 137 | 193 | [weakSelf.tableView reloadData]; |
| 138 | 194 | }; |
| 139 | 195 | return accountCell; |
| 140 | - }else if ([model.type isEqualToString:@"4"]) { | |
| 196 | + }else if ([model.showType isEqualToString:@"4"]) { //添加相关账号,已经删除了 | |
| 141 | 197 | CNBAddAccountGroupCell *addAccountCell = [tableView dequeueReusableCellWithIdentifier:CNBAddAccountGroupIdentifier]; |
| 142 | 198 | if (!addAccountCell) { |
| 143 | 199 | addAccountCell = [[CNBAddAccountGroupCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CNBAddAccountGroupIdentifier]; |
| ... | ... | @@ -145,7 +201,7 @@ |
| 145 | 201 | __block NSMutableArray *addGroupArray = [NSMutableArray arrayWithArray:sectionModel.typeArray]; |
| 146 | 202 | addAccountCell.addAccountGroupBlock = ^{ |
| 147 | 203 | CNBTypeModel *model = [[CNBTypeModel alloc]init]; |
| 148 | - model.type = @"3"; | |
| 204 | + model.showType = @"3"; | |
| 149 | 205 | model.isDelete = @"1"; |
| 150 | 206 | [addGroupArray insertObject:model atIndex:addGroupArray.count - 1]; |
| 151 | 207 | sectionModel.typeArray = addGroupArray; |
| ... | ... | @@ -176,20 +232,71 @@ |
| 176 | 232 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
| 177 | 233 | CNBAddSectionModel *sectionModel = self.sectionArray[indexPath.section]; |
| 178 | 234 | CNBTypeModel *model = sectionModel.typeArray[indexPath.row]; |
| 179 | - if ([model.type isEqualToString:@"0"]) { | |
| 235 | + if ([model.showType isEqualToString:@"0"]) { | |
| 180 | 236 | return 45; |
| 181 | - }else if ([model.type isEqualToString:@"1"]) { | |
| 237 | + }else if ([model.showType isEqualToString:@"1"]) { | |
| 182 | 238 | return 92; |
| 183 | - }else if ([model.type isEqualToString:@"2"]){ | |
| 239 | + }else if ([model.showType isEqualToString:@"2"]){ | |
| 184 | 240 | return 52; |
| 185 | - }else if ([model.type isEqualToString:@"3"]) { | |
| 241 | + }else if ([model.showType isEqualToString:@"3"]) { | |
| 186 | 242 | return 92; |
| 187 | - }else if ([model.type isEqualToString:@"4"]) { | |
| 243 | + }else if ([model.showType isEqualToString:@"4"]) { | |
| 188 | 244 | return 52; |
| 189 | 245 | }else { |
| 190 | 246 | return 0.01; |
| 191 | 247 | } |
| 192 | 248 | } |
| 249 | +#pragma mark -提交数据 | |
| 250 | +- (void)submitData { | |
| 251 | + NSMutableDictionary *submitDic = [NSMutableDictionary dictionary]; | |
| 252 | + NSMutableArray *instritutionArray = [NSMutableArray array]; | |
| 253 | + for (CNBAddSectionModel *sectionModel in self.sectionArray) { | |
| 254 | + if (CNLiveStringIsEmpty(sectionModel.institutionId)) { | |
| 255 | + [QMUITips showWithText:@"请填写机构信息" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 256 | + return ; | |
| 257 | + } | |
| 258 | + NSMutableDictionary *instritutionDic = [NSMutableDictionary dictionary]; | |
| 259 | + NSMutableArray *circleArray = [NSMutableArray array]; | |
| 260 | + [instritutionDic setObject:sectionModel.institutionId forKey:@"mainId"]; | |
| 261 | + [instritutionDic setObject:sectionModel.institutionName forKey:@"mainName"]; | |
| 262 | + for (CNBTypeModel *typeModel in sectionModel.typeArray) { | |
| 263 | + if (typeModel.addSection == sectionModel.addSection) { | |
| 264 | + if ([typeModel.showType isEqualToString:@"1"]) { | |
| 265 | + NSMutableDictionary *circleDic = [NSMutableDictionary dictionary]; | |
| 266 | + if (!CNLiveStringIsEmpty(typeModel.homePageId)) { | |
| 267 | + [circleDic setObject:typeModel.type forKey:@"type"]; | |
| 268 | + [circleDic setObject:typeModel.homePageId forKey:@"quanziId"]; | |
| 269 | + [circleDic setObject:typeModel.circleName forKey:@"quanziName"]; | |
| 270 | + } | |
| 271 | + NSMutableArray *groupArray = [NSMutableArray array]; | |
| 272 | + for (CNBPerAuthSelectTypeModel *groupModel in typeModel.groupArray) { | |
| 273 | + NSMutableDictionary *groupDic = [NSMutableDictionary dictionary]; | |
| 274 | + [groupDic setObject:groupModel.groupId forKey:@"groupId"]; | |
| 275 | + [groupDic setObject:groupModel.name forKey:@"groupName"]; | |
| 276 | + [groupArray addObject:groupDic]; | |
| 277 | + } | |
| 278 | + [circleDic setObject:groupArray forKey:@"groupItem"]; | |
| 279 | + [circleArray addObject:circleDic]; | |
| 280 | + | |
| 281 | + } | |
| 282 | + | |
| 283 | + [instritutionDic addArray:circleArray.copy forKey:@"quanziItem"]; | |
| 284 | + } | |
| 285 | + } | |
| 286 | + [instritutionArray addObject:instritutionDic]; | |
| 287 | + } | |
| 288 | + [submitDic setObject:instritutionArray forKey:@"Institution"]; | |
| 289 | + [submitDic setObject:@"10511059" forKey:@"sid"]; | |
| 290 | + | |
| 291 | + NSString *submitStr = [self objectToJson:submitDic]; | |
| 292 | + submitStr = [submitStr stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"]; | |
| 293 | + | |
| 294 | + [CNBPerAuthViewModel submitPerAuthData:submitStr successBlock:^(BOOL isSuccess) { | |
| 295 | + NSLog(@"提交数据成功"); | |
| 296 | + } failureBlock:^(NSError * _Nonnull error) { | |
| 297 | + | |
| 298 | + }]; | |
| 299 | +} | |
| 193 | 300 | #pragma mark - lazy |
| 194 | 301 | - (QMUIButton *)promptBtn { |
| 195 | 302 | if (!_promptBtn) { |
| ... | ... | @@ -214,14 +321,13 @@ |
| 214 | 321 | _footerTBView = [[CNBPerAuthFooterTBView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 168)]; |
| 215 | 322 | _footerTBView.backgroundColor = CNLiveColorWithHexString(@"F7F7F7"); |
| 216 | 323 | __weak typeof(self) weakSelf = self; |
| 217 | - _footerTBView.addInstitutionsBlock = ^{ | |
| 218 | -// CNBAddSectionModel *model = [[CNBAddSectionModel alloc]init]; | |
| 219 | -// model.isDelete = @"1"; | |
| 220 | -// model.addSection = weakSelf.sectionArray.count; | |
| 221 | -// [weakSelf.sectionArray addObject:model]; | |
| 324 | + _footerTBView.addInstitutionsBlock = ^{ //添加机构 | |
| 222 | 325 | [weakSelf addData:@"1" addSection:[NSString stringWithFormat:@"%ld",weakSelf.sectionArray.count]]; |
| 223 | 326 | [weakSelf.tableView reloadData]; |
| 224 | 327 | }; |
| 328 | + _footerTBView.submitActionBlock = ^{ //提交数据 | |
| 329 | + [weakSelf submitData]; | |
| 330 | + }; | |
| 225 | 331 | _tableView.tableFooterView = _footerTBView; |
| 226 | 332 | _tableView.tableHeaderView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 0.1)]; |
| 227 | 333 | if (@available(iOS 11.0, *)) { | ... | ... |
CNLiveBPersonalVerificationModule/Classes/Model/CNBIdentifierModel.h renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Model/CNBIdentifierModel.h
| ... | ... | @@ -7,19 +7,29 @@ |
| 7 | 7 | |
| 8 | 8 | #import <Foundation/Foundation.h> |
| 9 | 9 | @class CNBTypeModel; |
| 10 | +@class CNBPerAuthSelectTypeModel; | |
| 10 | 11 | NS_ASSUME_NONNULL_BEGIN |
| 11 | 12 | //添加圈子等 |
| 12 | 13 | @interface CNBTypeModel : NSObject |
| 13 | -@property (nonatomic, copy) NSString *type; //区分是什么 0是所属机构 1 您的圈子 2 添加圈子 3 相关子账号 4 添加子账号 | |
| 14 | -@property (nonatomic, copy) NSString *isDelete; //是否可以删除 0 不可删除 1 可删除 | |
| 15 | -@property (nonatomic, assign) NSInteger AddSection; //组 | |
| 16 | -@property (nonatomic, assign) NSInteger addRow; | |
| 14 | +@property (nonatomic, copy) NSString *showType; //区分是什么 0是所属机构 1 您的圈子 2 添加圈子 3 相关子账号 4 添加子账号 | |
| 15 | +@property (nonatomic, copy) NSString *isDelete; //是否可以删除 0 不可删除 1 可删除 | |
| 16 | +@property (nonatomic, assign) NSInteger addSection; //组 | |
| 17 | +@property (nonatomic, assign) NSInteger addRow; | |
| 18 | +@property (nonatomic, copy) NSString *institutionsName; //机构text | |
| 19 | +@property (nonatomic, copy) NSString *circleName; //展示圈子text | |
| 20 | +@property (nonatomic, copy) NSString *groupName; //展示群组Id | |
| 21 | +@property (nonatomic, copy) NSString *spId; //请求的Id 圈子传 spId, 群组传homePageId | |
| 22 | +@property (nonatomic, copy) NSString *homePageId; | |
| 23 | +@property (nonatomic, strong) NSArray <CNBPerAuthSelectTypeModel *>*groupArray; //存放groupArray | |
| 24 | +@property (nonatomic, copy) NSString *type; //给后台传的圈子type | |
| 17 | 25 | @end |
| 18 | 26 | //添加机构 |
| 19 | 27 | @interface CNBAddSectionModel : NSObject |
| 20 | -@property (nonatomic, copy) NSString *isDelete; //是否可删除 00 不可删除 1 可删除 | |
| 28 | +@property (nonatomic, copy) NSString *isDelete; //是否可删除 00 不可删除 1 可删除 | |
| 21 | 29 | @property (nonatomic, assign) NSInteger addSection; //添加时所在组 |
| 22 | 30 | @property (nonatomic, strong) NSMutableArray <CNBTypeModel *>*typeArray; //存放每种类型cell的数组 |
| 31 | +@property (nonatomic, copy) NSString *institutionName; //机构名称 | |
| 32 | +@property (nonatomic, copy) NSString *institutionId; //机构Id | |
| 23 | 33 | @end |
| 24 | 34 | |
| 25 | 35 | NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/Model/CNBIdentifierModel.m renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Model/CNBIdentifierModel.m
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Model/CNBPerAuthSelectTypeModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthSelectTypeModel.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/10. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +NS_ASSUME_NONNULL_BEGIN | |
| 10 | + | |
| 11 | +typedef NS_ENUM(NSUInteger, CNBPerAuthRadioType) { | |
| 12 | + CNBPerAuthRadioTypeInstitutions, //机构 | |
| 13 | + CNBPerAuthRadioTypeCircle, //圈子 | |
| 14 | + CNBPerAuthRadioTypeAccount, //相关账号 | |
| 15 | + CNBPerAuthRadioTypeGroup, //单选群组 | |
| 16 | + CNBperAuthRadioTypeMultiGroup, //多选群组 | |
| 17 | +}; | |
| 18 | +@interface CNBPerAuthSelectTypeModel : NSObject | |
| 19 | +@property (nonatomic, copy) NSString *name; | |
| 20 | +@property (nonatomic, copy) NSString *typeId; | |
| 21 | +@property (nonatomic, copy) NSString *icon; | |
| 22 | +@property (nonatomic, copy) NSString *type; | |
| 23 | +@property (nonatomic, copy) NSString *groupId; | |
| 24 | +@property (nonatomic, copy) NSString *isCellSelected; //cell是否被选中 | |
| 25 | +@property (nonatomic, copy) NSString *isNoCanSelected; //不可选 | |
| 26 | +@property (nonatomic, assign) CNBPerAuthRadioType showType; | |
| 27 | +@end | |
| 28 | + | |
| 29 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Model/CNBPerAuthSelectTypeModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthSelectTypeModel.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/10. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPerAuthSelectTypeModel.h" | |
| 9 | +#import "MJExtension.h" | |
| 10 | +@implementation CNBPerAuthSelectTypeModel | |
| 11 | ++ (NSDictionary *)mj_replacedKeyFromPropertyName | |
| 12 | +{ | |
| 13 | + return @{ | |
| 14 | + @"typeId":@"id", | |
| 15 | + }; | |
| 16 | +} | |
| 17 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Model/CNBPerCertificationSuccessModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerCertificationSuccessModel.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +@class CNBUserInfoModel; | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNBPerCertificationSuccessModel : NSObject | |
| 13 | +@property (nonatomic, copy) NSString *checkStatus; //审核状态 "0" 未认证 "1" 已认证 "2"审核中 "3" 审核失败 | |
| 14 | +@property (nonatomic, strong) NSArray *institution; | |
| 15 | +@property (nonatomic, strong) CNBUserInfoModel *bUserIdentity; | |
| 16 | +@end | |
| 17 | +@interface CNBUserInfoModel : NSObject | |
| 18 | +@property (nonatomic, copy) NSString *address; | |
| 19 | +@property (nonatomic, copy) NSString *createTime; | |
| 20 | +@property (nonatomic, copy) NSString *icon; //展示的图片 | |
| 21 | +@property (nonatomic, copy) NSString *id; | |
| 22 | +@property (nonatomic, copy) NSString *idCardNo; //身份证号 | |
| 23 | +@property (nonatomic, copy) NSString *idCardObv; | |
| 24 | +@property (nonatomic, copy) NSString *idCardRev; | |
| 25 | +@property (nonatomic, copy) NSString *mobile; | |
| 26 | +@property (nonatomic, copy) NSString *realName; //姓名 | |
| 27 | +@property (nonatomic, copy) NSString *sid; | |
| 28 | +@property (nonatomic, copy) NSString *status; | |
| 29 | +@property (nonatomic, copy) NSString *updateTime; | |
| 30 | +@end | |
| 31 | +@interface CNBInstitutionModel : NSObject | |
| 32 | +@property (nonatomic, copy) NSString *mainName; //机构名称 | |
| 33 | +@property (nonatomic, copy) NSString *mainId; //机构Id | |
| 34 | +@property (nonatomic, strong) NSArray *quanziItem; //圈子数组 | |
| 35 | +@end | |
| 36 | +@interface CNBCirccleModel : NSObject | |
| 37 | +@property (nonatomic, copy) NSString *quanziName; //圈子名称 | |
| 38 | +@property (nonatomic, copy) NSString *quanziId; //圈子Id | |
| 39 | +@property (nonatomic, copy) NSString *type; //类型 | |
| 40 | +@property (nonatomic, strong) NSArray *groupItem; //群组 | |
| 41 | +@end | |
| 42 | +@interface CNBGroupModel : NSObject | |
| 43 | +@property (nonatomic, copy) NSString *groupId; //群组Id | |
| 44 | +@property (nonatomic, copy) NSString *groupName; //群组名称 | |
| 45 | +@end | |
| 46 | + | |
| 47 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/Model/CNBPerCertificationSuccessModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerCertificationSuccessModel.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPerCertificationSuccessModel.h" | |
| 9 | +#import "MJExtension.h" | |
| 10 | +@implementation CNBPerCertificationSuccessModel | |
| 11 | ++ (NSDictionary *)mj_objectClassInArray { | |
| 12 | + return @{@"institution":@"CNBInstitutionModel"}; | |
| 13 | +} | |
| 14 | +@end | |
| 15 | + | |
| 16 | +@implementation CNBUserInfoModel | |
| 17 | + | |
| 18 | +@end | |
| 19 | +@implementation CNBInstitutionModel | |
| 20 | ++ (NSDictionary *)mj_objectClassInArray { | |
| 21 | + return @{@"quanziItem":@"CNBCirccleModel"}; | |
| 22 | +} | |
| 23 | +@end | |
| 24 | +@implementation CNBCirccleModel | |
| 25 | ++ (NSDictionary *)mj_objectClassInArray { | |
| 26 | + return @{@"groupItem":@"CNBGroupModel"}; | |
| 27 | +} | |
| 28 | +@end | |
| 29 | +@implementation CNBGroupModel | |
| 30 | + | |
| 31 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/View/CNBPerAuthFooterTBView.h renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthFooterTBView.h
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // CNBPerAuthFooterTBView.h |
| 3 | 3 | // CNLiveBPersonalVerificationModule |
| 4 | 4 | // |
| 5 | -// Created by 殷巧娟 on 2020/4/8. | |
| 5 | +// Created by 殷巧娟 on 2020/4/16. | |
| 6 | 6 | // |
| 7 | 7 | |
| 8 | 8 | #import <UIKit/UIKit.h> |
| ... | ... | @@ -10,8 +10,8 @@ |
| 10 | 10 | NS_ASSUME_NONNULL_BEGIN |
| 11 | 11 | |
| 12 | 12 | @interface CNBPerAuthFooterTBView : UIView |
| 13 | -@property (nonatomic, copy) void (^addInstitutionsBlock) (void); | |
| 14 | -@property (nonatomic, copy) void (^submitActionBlock)(void); | |
| 13 | +@property (nonatomic, copy) void (^addInstitutionsBlock)(void); //添加机构 | |
| 14 | +@property (nonatomic, copy) void (^submitActionBlock)(void); //提交 | |
| 15 | 15 | @end |
| 16 | 16 | |
| 17 | 17 | NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/View/CNBPerAuthFooterTBView.m renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthFooterTBView.m
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // CNBPerAuthFooterTBView.m |
| 3 | 3 | // CNLiveBPersonalVerificationModule |
| 4 | 4 | // |
| 5 | -// Created by 殷巧娟 on 2020/4/8. | |
| 5 | +// Created by 殷巧娟 on 2020/4/16. | |
| 6 | 6 | // |
| 7 | 7 | |
| 8 | 8 | #import "CNBPerAuthFooterTBView.h" |
| ... | ... | @@ -118,3 +118,4 @@ |
| 118 | 118 | return _submitBtn; |
| 119 | 119 | } |
| 120 | 120 | @end |
| 121 | + | ... | ... |
CNLiveBPersonalVerificationModule/Classes/View/CNBPerAuthHeaderView.h renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthHeaderView.h
CNLiveBPersonalVerificationModule/Classes/View/CNBPerAuthHeaderView.m renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthHeaderView.m
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthShowView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthShowView.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/10. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNBPerAuthShowView : UIView | |
| 13 | +@property (nonatomic, strong) UILabel *showLabel; | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthShowView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthShowView.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/10. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPerAuthShowView.h" | |
| 9 | +#import <Masonry/Masonry.h> | |
| 10 | +#import "UIColor+CNLiveExtension.h" | |
| 11 | +#import "CNLivePerAuthGetImage.h" | |
| 12 | +@interface CNBPerAuthShowView () | |
| 13 | +@property (nonatomic, strong) UIImageView *showImageV; | |
| 14 | +@end | |
| 15 | + | |
| 16 | +@implementation CNBPerAuthShowView | |
| 17 | + | |
| 18 | +- (instancetype)initWithFrame:(CGRect)frame { | |
| 19 | + if (self = [super initWithFrame:frame]) { | |
| 20 | + [self configUI]; | |
| 21 | + } | |
| 22 | + return self; | |
| 23 | +} | |
| 24 | +#pragma mark - 配置UI | |
| 25 | +- (void)configUI { | |
| 26 | + [self addSubview:self.showImageV]; | |
| 27 | + [self addSubview:self.showLabel]; | |
| 28 | + __weak typeof(self) weakSelf = self; | |
| 29 | + [_showImageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 30 | + make.right.mas_equalTo(weakSelf.mas_right).offset(-8); | |
| 31 | + make.centerY.mas_equalTo(weakSelf.mas_centerY); | |
| 32 | + make.size.mas_equalTo(CGSizeMake(6.5, 12)); | |
| 33 | + }]; | |
| 34 | + [_showLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 35 | + make.left.mas_equalTo(weakSelf.mas_left).offset(11); | |
| 36 | + make.right.mas_equalTo(weakSelf.showImageV.mas_left).offset(-12.5); | |
| 37 | + make.centerY.mas_equalTo(weakSelf.mas_centerY); | |
| 38 | + make.height.mas_equalTo(12); | |
| 39 | + }]; | |
| 40 | + | |
| 41 | +} | |
| 42 | + | |
| 43 | +#pragma mark -lazy { | |
| 44 | +- (UILabel *)showLabel { | |
| 45 | + if (!_showLabel) { | |
| 46 | + _showLabel = [[UILabel alloc]init]; | |
| 47 | + _showLabel.textColor = CNLiveColorWithHexString(@"B9B9B9"); | |
| 48 | + _showLabel.font = [UIFont systemFontOfSize:12]; | |
| 49 | + _showLabel.textAlignment = NSTextAlignmentLeft; | |
| 50 | + _showLabel.numberOfLines = 1; | |
| 51 | + } | |
| 52 | + return _showLabel; | |
| 53 | +} | |
| 54 | +- (UIImageView *)showImageV { | |
| 55 | + if (!_showImageV) { | |
| 56 | + _showImageV = [[UIImageView alloc]init]; | |
| 57 | + _showImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"xuanze" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]]; | |
| 58 | + } | |
| 59 | + return _showImageV; | |
| 60 | +} | |
| 61 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthTypeRadioView.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthTypeRadioView.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/10. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +#import "CNBPerAuthSelectTypeModel.h" | |
| 10 | +@class CNBTypeModel; | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | +typedef NS_ENUM(NSUInteger,CNBPerShowErrorType) { | |
| 13 | + CNBPerShowErrorTypeNoNet, //没网 | |
| 14 | + CNBPerShowErrorTypeFail, //请求失败 | |
| 15 | + CNBPerShowErrorTypeNoData //没数据 | |
| 16 | +}; | |
| 17 | +@interface CNBPerAuthTypeRadioView : UIView | |
| 18 | + | |
| 19 | +/// 选择类型弹出 | |
| 20 | +/// @param selectType 是圈子还是机构等选择 | |
| 21 | +/// @param spId spId 机构接口返回 | |
| 22 | +/// @param type 1 子账号 2圈子 | |
| 23 | +/// @param homepageId 主页Id | |
| 24 | +- (instancetype)initWithSelectType:(CNBPerAuthRadioType)selectType spId:(NSString *)spId type:(NSString *)type homepageId:(NSString *)homepageId typeModel:(CNBTypeModel *)typeModel; | |
| 25 | +- (void)show; | |
| 26 | +- (void)dismiss; | |
| 27 | +@property (nonatomic, copy)void (^selectedCellBlock) (CNBTypeModel *typeModel, CNBPerAuthSelectTypeModel *selectModel); | |
| 28 | +//圈子多选 | |
| 29 | +@property (nonatomic, copy) void (^multiSelectBlock) (CNBTypeModel *typeMoedl, NSArray *groupArray); | |
| 30 | +@end | |
| 31 | + | |
| 32 | +@interface CNBPerAuthTypeRadioCell : UITableViewCell | |
| 33 | +@property (nonatomic, strong) CNBPerAuthSelectTypeModel *typeModel; | |
| 34 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier showType:(CNBPerAuthRadioType)showType; | |
| 35 | +@end | |
| 36 | + | |
| 37 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPerAuthTypeRadioView.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthTypeRadioView.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/10. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPerAuthTypeRadioView.h" | |
| 9 | +#import <Masonry/Masonry.h> | |
| 10 | +#import "CNLivePerAuthGetImage.h" | |
| 11 | +#import "UIColor+CNLiveExtension.h" | |
| 12 | +#import "CNLiveBaseKit.h" | |
| 13 | +#import <QMUIKit/QMUIKit.h> | |
| 14 | +#import "CNBPerAuthViewModel.h" | |
| 15 | +#import "MJRefresh.h" | |
| 16 | +#import "CNEmptyView.h" | |
| 17 | +#import "CNBIdentifierModel.h" | |
| 18 | +#import "CNBPerAuthManager.h" | |
| 19 | +#define CNBSelecctIdentifier @"CNBPerAuthTypeRadioCell" | |
| 20 | +#define CNBottomSureBtnHeight 75 | |
| 21 | +@interface CNBPerAuthTypeRadioView ()<UITableViewDelegate,UITableViewDataSource,UIGestureRecognizerDelegate> | |
| 22 | +@property (nonatomic, strong) UIView *containerView; | |
| 23 | +@property (nonatomic, strong) UIButton *closeBtn; | |
| 24 | +@property (nonatomic, strong) UITableView *tableView; | |
| 25 | +@property (nonatomic, strong) UILabel *titleLabel; | |
| 26 | +@property (nonatomic, assign) CNBPerAuthRadioType selectType; | |
| 27 | +@property (nonatomic, copy) NSString *spId; | |
| 28 | +@property (nonatomic, copy) NSString *type; | |
| 29 | +@property (nonatomic, copy) NSString *homepageId; | |
| 30 | +@property (nonatomic, assign) NSInteger page; | |
| 31 | +@property (nonatomic, strong) NSMutableArray *dataSource; | |
| 32 | +@property (nonatomic, strong) CNEmptyView *emptyView; | |
| 33 | +@property (nonatomic, strong) UIButton *sureBtn; //确定按钮 | |
| 34 | +@property (nonatomic, strong) CNBTypeModel *typeModel; | |
| 35 | +@property (nonatomic, strong) NSMutableArray *sureDataArray; //最后确定提交的数组,最多只能添加5个群组 | |
| 36 | +@property (nonatomic, assign) BOOL isRefresh; //刷新过,就不在加数据 | |
| 37 | +@end | |
| 38 | + | |
| 39 | +@implementation CNBPerAuthTypeRadioView | |
| 40 | + | |
| 41 | +- (void)dealloc { | |
| 42 | + NSLog(@"看看选择弹框走dealloc了吗"); | |
| 43 | +} | |
| 44 | +- (instancetype)initWithSelectType:(CNBPerAuthRadioType)selectType spId:(NSString *)spId type:(NSString *)type homepageId:(NSString *)homepageId typeModel:(CNBTypeModel *)typeModel | |
| 45 | +{ | |
| 46 | + if (self = [super init]) { | |
| 47 | + self.frame = [UIScreen mainScreen].bounds; | |
| 48 | + self.backgroundColor = RGBA(172,172,172,0.4); | |
| 49 | + _selectType = selectType; | |
| 50 | + _spId = spId; | |
| 51 | + _type = type; | |
| 52 | + _homepageId = homepageId; | |
| 53 | + _typeModel = typeModel; | |
| 54 | + _page = 1; | |
| 55 | + UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleGuesture:)]; | |
| 56 | + tapGestureRecognizer.delegate = self; | |
| 57 | + [self addGestureRecognizer:tapGestureRecognizer]; | |
| 58 | + [self configUI]; | |
| 59 | + if (selectType == CNBperAuthRadioTypeMultiGroup) { | |
| 60 | + [self setMultiSelectView]; | |
| 61 | + } | |
| 62 | + [self requestTypeListData:_page]; | |
| 63 | + NSString *titleStr = @""; | |
| 64 | + if (selectType == CNBPerAuthRadioTypeCircle) { | |
| 65 | + titleStr = @"请选择您的圈子"; | |
| 66 | + }else if (selectType == CNBPerAuthRadioTypeAccount) { | |
| 67 | + titleStr = @"请选择机构子账号"; | |
| 68 | + }else if (selectType == CNBPerAuthRadioTypeGroup){ | |
| 69 | + titleStr = @"请选择子账号群组"; | |
| 70 | + }else if (selectType == CNBPerAuthRadioTypeInstitutions){ | |
| 71 | + titleStr = @"请选择所属机构"; | |
| 72 | + }else if (selectType == CNBperAuthRadioTypeMultiGroup) { | |
| 73 | + titleStr = @"请选择圈子群组"; | |
| 74 | + } | |
| 75 | + self.titleLabel.text = titleStr; | |
| 76 | + } | |
| 77 | + return self; | |
| 78 | + | |
| 79 | +} | |
| 80 | +#pragma mark -配置UI | |
| 81 | +- (void)configUI { | |
| 82 | + [self addSubview:self.containerView]; | |
| 83 | + [self.containerView addSubview:self.closeBtn]; | |
| 84 | + [self.containerView addSubview:self.tableView]; | |
| 85 | + [self.containerView addSubview:self.titleLabel]; | |
| 86 | + [self addMasony]; | |
| 87 | +} | |
| 88 | +- (void)addMasony { | |
| 89 | + __weak typeof(self) weakSelf = self; | |
| 90 | + [_containerView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 91 | + make.bottom.mas_equalTo(weakSelf.mas_bottom); | |
| 92 | + make.left.right.mas_equalTo(weakSelf); | |
| 93 | + make.height.mas_equalTo((KScreenHeight*3/4) - kNavigationBarHeight); | |
| 94 | + }]; | |
| 95 | + [_closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 96 | + make.top.mas_equalTo(weakSelf.containerView.mas_top).offset(17); | |
| 97 | + make.right.mas_equalTo(weakSelf.containerView.mas_right).offset(-17); | |
| 98 | + make.width.height.mas_equalTo(13); | |
| 99 | + }]; | |
| 100 | + [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 101 | + make.left.mas_equalTo(weakSelf.containerView.mas_left).offset(50); | |
| 102 | + make.right.mas_equalTo(weakSelf.containerView.mas_right).offset(-50); | |
| 103 | + make.top.mas_equalTo(weakSelf.containerView.mas_top).offset(17); | |
| 104 | + make.height.mas_equalTo(15); | |
| 105 | + }]; | |
| 106 | + CGFloat bottom = 0; | |
| 107 | + if (self.selectType == CNBperAuthRadioTypeMultiGroup) { | |
| 108 | + bottom = -kVerticalBottomSafeHeight - CNBottomSureBtnHeight; | |
| 109 | + [self setMultiSelectView]; | |
| 110 | + }else { | |
| 111 | + bottom = -kVerticalBottomSafeHeight; | |
| 112 | + } | |
| 113 | + [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 114 | + make.left.right.mas_equalTo(weakSelf.containerView); | |
| 115 | + make.bottom.mas_equalTo(weakSelf.containerView.mas_bottom).offset(bottom); | |
| 116 | + make.top.mas_equalTo(weakSelf.containerView.mas_top).offset(40); | |
| 117 | + }]; | |
| 118 | +} | |
| 119 | +#pragma mark - 多选布局 | |
| 120 | +- (void)setMultiSelectView { | |
| 121 | + __weak typeof(self) weakSelf = self; | |
| 122 | + [self.containerView addSubview:self.sureBtn]; | |
| 123 | + [_sureBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 124 | + make.left.mas_equalTo(weakSelf.containerView.mas_left).offset(23); | |
| 125 | + make.right.mas_equalTo(weakSelf.containerView.mas_right).offset(-23); | |
| 126 | + make.height.mas_equalTo(45); | |
| 127 | + make.bottom.mas_equalTo(weakSelf.containerView.mas_bottom).offset (-kVerticalBottomSafeHeight - 20); | |
| 128 | + }]; | |
| 129 | +} | |
| 130 | +#pragma mark - requestData | |
| 131 | +- (void)requestTypeListData:(NSInteger)page { | |
| 132 | + __weak typeof(self) weakSelf = self; | |
| 133 | + [CNBPerAuthViewModel getPerAuthTypeListWithSpId:self.spId type:self.type homepageId:self.homepageId page:page selectType:self.selectType successBlock:^(NSMutableArray * _Nonnull dataSource, NSString *hasNextPage) { | |
| 134 | + __strong typeof(weakSelf) strongSelf = weakSelf; | |
| 135 | + if (!strongSelf) { | |
| 136 | + return ; | |
| 137 | + } | |
| 138 | + [strongSelf.tableView.mj_footer endRefreshing]; | |
| 139 | + [strongSelf.dataSource addObjectsFromArray:dataSource]; | |
| 140 | + strongSelf.tableView.mj_footer.hidden = strongSelf.dataSource.count == 0; | |
| 141 | + if ([hasNextPage isEqualToString:@"1"]) { | |
| 142 | + strongSelf.page ++; | |
| 143 | + }else { | |
| 144 | + [strongSelf.tableView.mj_footer endRefreshingWithNoMoreData]; | |
| 145 | + } | |
| 146 | + if (strongSelf.dataSource.count == 0) { | |
| 147 | + [strongSelf showEmptyView:self.selectType errorType:CNBPerShowErrorTypeNoData]; | |
| 148 | + }else { | |
| 149 | + strongSelf.tableView.tableFooterView = [UIView new]; | |
| 150 | + [strongSelf.emptyView removeFromSuperview]; | |
| 151 | + } | |
| 152 | + if (strongSelf.selectType == CNBPerAuthRadioTypeCircle ) { | |
| 153 | + if (!strongSelf.isRefresh) { | |
| 154 | + CNBPerAuthSelectTypeModel *selectModel = [[CNBPerAuthSelectTypeModel alloc]init]; | |
| 155 | + selectModel.name = @"无"; | |
| 156 | + selectModel.typeId = @""; | |
| 157 | + selectModel.type = @""; | |
| 158 | + selectModel.icon = @""; | |
| 159 | + selectModel.groupId = @""; | |
| 160 | + selectModel.isCellSelected = @"0"; | |
| 161 | + selectModel.showType = self.selectType; | |
| 162 | + [strongSelf.dataSource insertObject:selectModel atIndex:0]; | |
| 163 | + self.isRefresh = YES; | |
| 164 | + } | |
| 165 | + } | |
| 166 | + [strongSelf.tableView reloadData]; | |
| 167 | + | |
| 168 | + } failureBlock:^(NSError * _Nonnull error) { | |
| 169 | + [weakSelf.tableView.mj_footer endRefreshing]; | |
| 170 | + weakSelf.tableView.mj_footer.hidden = YES; | |
| 171 | + if (weakSelf.dataSource.count == 0) { | |
| 172 | + if (error.code == -1009 || error.code == -1001) { | |
| 173 | + [weakSelf showEmptyView:self.selectType errorType:CNBPerShowErrorTypeNoNet]; | |
| 174 | + | |
| 175 | + }else { | |
| 176 | + [weakSelf showEmptyView:self.selectType errorType:CNBPerShowErrorTypeFail]; | |
| 177 | + } | |
| 178 | + }else { | |
| 179 | + [weakSelf.emptyView removeFromSuperview]; | |
| 180 | + [QMUITips showWithText:error.localizedDescription inView:AppKeyWindow hideAfterDelay:1.5f]; | |
| 181 | + } | |
| 182 | + }]; | |
| 183 | +} | |
| 184 | +#pragma mark -加载更多 | |
| 185 | +- (void)loadMoreData { | |
| 186 | + [self requestTypeListData:self.page]; | |
| 187 | +} | |
| 188 | +#pragma mark - 重试 | |
| 189 | +- (void)retryloadData { | |
| 190 | + [self requestTypeListData:self.page]; | |
| 191 | +} | |
| 192 | +#pragma mark - 展示空视图 | |
| 193 | +- (void)showEmptyView:(CNBPerAuthRadioType)selectType errorType:(CNBPerShowErrorType)errorType { | |
| 194 | + NSString *titleName = @""; | |
| 195 | + NSString *imageName = @""; | |
| 196 | + NSString *retryName = @""; | |
| 197 | + if (errorType == CNBPerShowErrorTypeNoData) { | |
| 198 | + if (selectType == CNBPerAuthRadioTypeInstitutions) { | |
| 199 | + titleName = @"暂无机构"; | |
| 200 | + }else if (selectType == CNBPerAuthRadioTypeAccount){ | |
| 201 | + titleName = @"暂无机构子账号"; | |
| 202 | + }else if (selectType == CNBPerAuthRadioTypeGroup) { | |
| 203 | + titleName = @"暂无群组"; | |
| 204 | + }else if (selectType == CNBPerAuthRadioTypeCircle) { | |
| 205 | + titleName = @"暂无圈子"; | |
| 206 | + }else if (selectType == CNBperAuthRadioTypeMultiGroup){ | |
| 207 | + titleName = @"暂无群组"; | |
| 208 | + } | |
| 209 | + self.sureBtn.hidden = YES; | |
| 210 | + imageName = @"zanwuquanzi"; | |
| 211 | + }else if (errorType == CNBPerShowErrorTypeNoNet) { | |
| 212 | + imageName = @"dd_wlcw"; | |
| 213 | + titleName = @"网络开小差了,刷新试试"; | |
| 214 | + retryName = @"刷新"; | |
| 215 | + }else if (errorType == CNBPerShowErrorTypeFail) { | |
| 216 | + imageName = @"wufalianjie"; | |
| 217 | + titleName = @"接口开小差了,试试重新请求"; | |
| 218 | + retryName = @"重试"; | |
| 219 | + } | |
| 220 | + | |
| 221 | + BOOL isHiden = errorType == CNBPerShowErrorTypeNoData; | |
| 222 | + [self.emptyView showImage:[CNLivePerAuthGetImage cnLivePerAuth_getImageName:imageName bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]] title:titleName detailTitle:@"" retryBtnTitle:retryName]; | |
| 223 | + self.emptyView.retryBtn.hidden = isHiden; | |
| 224 | + self.emptyView.retryBtn.backgroundColor = kWhiteColor; | |
| 225 | + self.emptyView.retryBtn.layer.masksToBounds = YES; | |
| 226 | + self.emptyView.retryBtn.layer.cornerRadius = 14; | |
| 227 | + self.emptyView.retryBtn.layer.borderWidth = 1; | |
| 228 | + self.emptyView.retryBtn.layer.borderColor = CNLiveColorWithHexString(@"48A7F9").CGColor; | |
| 229 | + [self.emptyView.retryBtn setTitleColor:CNLiveColorWithHexString(@"48A7F9") forState:UIControlStateNormal]; | |
| 230 | + [self.emptyView.retryBtn setTitleColor:CNLiveColorWithHexString(@"48A7F9") forState:UIControlStateHighlighted]; | |
| 231 | + errorType == CNBPerShowErrorTypeNoData ?self.tableView.tableFooterView = self.emptyView :[self addSubview:self.emptyView]; | |
| 232 | + if (!isHiden) { | |
| 233 | + [self.emptyView.retryBtn addTarget:self action:@selector(retryloadData) forControlEvents:UIControlEventTouchUpInside]; | |
| 234 | + } | |
| 235 | + | |
| 236 | +} | |
| 237 | +#pragma mark - Action | |
| 238 | +- (void)handleGuesture:(UITapGestureRecognizer *)tap { | |
| 239 | + CGPoint point = [tap locationInView:_containerView]; | |
| 240 | + if(![_containerView.layer containsPoint:point]) { | |
| 241 | + [self dismiss]; | |
| 242 | + return; | |
| 243 | + } | |
| 244 | +} | |
| 245 | +- (void)closeBtnAction { | |
| 246 | + [self dismiss]; | |
| 247 | +} | |
| 248 | +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { | |
| 249 | + if ([NSStringFromClass([touch.view.superview class]) isEqualToString:@"CNBPerAuthTypeRadioCell"]) { | |
| 250 | + return NO; | |
| 251 | + }else { | |
| 252 | + return YES; | |
| 253 | + } | |
| 254 | +} | |
| 255 | +#pragma mark - 确定按钮 | |
| 256 | +- (void)sureBtnAcction { | |
| 257 | + | |
| 258 | + if (self.sureDataArray.count > 5) { | |
| 259 | + [QMUITips showWithText:@"您最多只能选择5个群组" inView:AppKeyWindow hideAfterDelay:1.5f]; | |
| 260 | + return; | |
| 261 | + } | |
| 262 | + if (self.sureDataArray.count == 0) { | |
| 263 | + [QMUITips showWithText:@"您还没有选择群组" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 264 | + return; | |
| 265 | + } | |
| 266 | + if (self.multiSelectBlock) { | |
| 267 | + self.multiSelectBlock(self.typeModel, self.sureDataArray.copy); | |
| 268 | + } | |
| 269 | + [self dismiss]; | |
| 270 | +} | |
| 271 | +#pragma mark -显示 | |
| 272 | +- (void)show { | |
| 273 | + __weak typeof(self) weakSelf = self; | |
| 274 | + UIWindow *window = [[[UIApplication sharedApplication]delegate] window]; | |
| 275 | + [window addSubview:self]; | |
| 276 | + [UIView animateWithDuration:0.15f | |
| 277 | + delay:0.0f | |
| 278 | + options:UIViewAnimationOptionCurveEaseOut | |
| 279 | + animations:^{ | |
| 280 | + CGRect frame = weakSelf.containerView.frame; | |
| 281 | + frame.origin.y = frame.origin.y - frame.size.height; | |
| 282 | + weakSelf.containerView.frame = frame; | |
| 283 | + } | |
| 284 | + completion:^(BOOL finished) { | |
| 285 | + }]; | |
| 286 | +} | |
| 287 | +#pragma mark - 消失 | |
| 288 | +- (void)dismiss { | |
| 289 | + //dismiss的时候,存上次选择过的数据 | |
| 290 | + __weak typeof(self) weakSelf = self; | |
| 291 | + [UIView animateWithDuration:0.15f | |
| 292 | + delay:0.0f | |
| 293 | + options:UIViewAnimationOptionCurveEaseIn | |
| 294 | + animations:^{ | |
| 295 | + CGRect frame = weakSelf.containerView.frame; | |
| 296 | + frame.origin.y = frame.origin.y + frame.size.height; | |
| 297 | + weakSelf.containerView.frame = frame; | |
| 298 | + } | |
| 299 | + completion:^(BOOL finished) { | |
| 300 | + [weakSelf removeFromSuperview]; | |
| 301 | + }]; | |
| 302 | +} | |
| 303 | +#pragma mark - tableViewDelegateAndtableViewDataSource | |
| 304 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 305 | + return self.dataSource.count; | |
| 306 | +} | |
| 307 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 308 | + CNBPerAuthSelectTypeModel *model = self.dataSource[indexPath.row]; | |
| 309 | + CNBPerAuthTypeRadioCell *cell = [tableView dequeueReusableCellWithIdentifier:CNBSelecctIdentifier]; | |
| 310 | + if (!cell) { | |
| 311 | + cell = [[CNBPerAuthTypeRadioCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CNBSelecctIdentifier showType:self.selectType]; | |
| 312 | + } | |
| 313 | + if (self.selectType == CNBPerAuthRadioTypeInstitutions) { //h机构 | |
| 314 | + NSArray *array = [CNBPerAuthManager shareManager].instSelectedArray.copy; | |
| 315 | + | |
| 316 | + if ([array containsObject:model.typeId]) { | |
| 317 | + model.isNoCanSelected = @"1"; | |
| 318 | + }else { | |
| 319 | + model.isNoCanSelected = @"0"; | |
| 320 | + } | |
| 321 | + }else if (self.selectType == CNBPerAuthRadioTypeCircle) { | |
| 322 | + NSMutableArray *circleArray = [[CNBPerAuthManager shareManager].circleDic objectForKey:[NSString stringWithFormat:@"%ld",self.typeModel.addSection]]; | |
| 323 | + if ([circleArray containsObject:model.typeId]) { //圈子 | |
| 324 | + model.isNoCanSelected = @"1"; | |
| 325 | + }else { | |
| 326 | + model.isNoCanSelected = @"0"; | |
| 327 | + } | |
| 328 | + } | |
| 329 | + | |
| 330 | + cell.typeModel = model; | |
| 331 | + return cell; | |
| 332 | +} | |
| 333 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 334 | + return 49.5; | |
| 335 | +} | |
| 336 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 337 | + NSLog(@"点击了cell"); | |
| 338 | + if (self.selectType == CNBperAuthRadioTypeMultiGroup) { | |
| 339 | + CNBPerAuthSelectTypeModel *model = self.dataSource[indexPath.row]; | |
| 340 | + if ([model.isCellSelected isEqualToString:@"1"]) { | |
| 341 | + model.isCellSelected = @"0"; | |
| 342 | + [self.sureDataArray removeObject:[self.dataSource objectAtIndex:indexPath.row]]; | |
| 343 | + }else { | |
| 344 | + model.isCellSelected = @"1"; | |
| 345 | + [self.sureDataArray addObject:[self.dataSource objectAtIndex:indexPath.row]]; | |
| 346 | + } | |
| 347 | + }else { | |
| 348 | + | |
| 349 | + if (self.selectType == CNBPerAuthRadioTypeCircle) { //圈子选择后不可在选 | |
| 350 | + NSMutableArray *array = [[CNBPerAuthManager shareManager].circleDic objectForKey:[NSString stringWithFormat:@"%ld",self.typeModel.addSection]]; | |
| 351 | + NSMutableArray *tempArray = [NSMutableArray arrayWithArray:array.copy]; | |
| 352 | + if ([tempArray containsObject:self.typeModel.homePageId]) { | |
| 353 | + [tempArray removeObject:self.typeModel.homePageId]; | |
| 354 | + } | |
| 355 | + NSMutableArray *circleSelectArray = [NSMutableArray array]; | |
| 356 | + for (int i = 0 ; i < self.dataSource.count;i ++) { | |
| 357 | + CNBPerAuthSelectTypeModel *model = self.dataSource[i]; | |
| 358 | + if (i == indexPath.row ) { | |
| 359 | + model.isCellSelected = @"1"; | |
| 360 | + if (!CNLiveStringIsEmpty(model.typeId)) { | |
| 361 | + [circleSelectArray addObject:model.typeId]; | |
| 362 | + } | |
| 363 | + }else { | |
| 364 | + if ([circleSelectArray containsObject:model.typeId]) { | |
| 365 | + [circleSelectArray removeObject:model.typeId]; | |
| 366 | + } | |
| 367 | + model.isCellSelected = @"0"; | |
| 368 | + } | |
| 369 | + } | |
| 370 | + [tempArray addObjectsFromArray:circleSelectArray]; | |
| 371 | + [[CNBPerAuthManager shareManager].circleDic setObject:tempArray forKey:[NSString stringWithFormat:@"%ld",self.typeModel.addSection]]; | |
| 372 | + }else if (self.selectType == CNBPerAuthRadioTypeInstitutions) { | |
| 373 | + | |
| 374 | + NSArray *array = [CNBPerAuthManager shareManager].instSelectedArray.copy; | |
| 375 | + NSMutableArray *tempArray = [NSMutableArray arrayWithArray:array]; | |
| 376 | + if ([tempArray containsObject:self.typeModel.spId]) { | |
| 377 | + [tempArray removeObject:self.typeModel.spId]; | |
| 378 | + } | |
| 379 | + NSMutableArray *selectArray = [NSMutableArray array]; | |
| 380 | + for (int i = 0 ; i < self.dataSource.count;i ++) { | |
| 381 | + CNBPerAuthSelectTypeModel *model = self.dataSource[i]; | |
| 382 | + if (i == indexPath.row && !CNLiveStringIsEmpty(model.typeId)) { | |
| 383 | + model.isCellSelected = @"1"; | |
| 384 | + [selectArray addObject:model.typeId]; | |
| 385 | + }else { | |
| 386 | + if ([selectArray containsObject:model.typeId]) { | |
| 387 | + [selectArray removeObject:model.typeId]; | |
| 388 | + } | |
| 389 | + model.isCellSelected = @"0"; | |
| 390 | + } | |
| 391 | + } | |
| 392 | + [tempArray addObjectsFromArray:selectArray]; | |
| 393 | + [CNBPerAuthManager shareManager].instSelectedArray = tempArray; | |
| 394 | + } | |
| 395 | + | |
| 396 | + } | |
| 397 | + | |
| 398 | + if (self.selectedCellBlock) { | |
| 399 | + self.selectedCellBlock(self.typeModel,self.dataSource[indexPath.row]); | |
| 400 | + } | |
| 401 | + [self.tableView reloadData]; | |
| 402 | +} | |
| 403 | + | |
| 404 | +#pragma mark - lazy | |
| 405 | +- (UIView *)containerView { | |
| 406 | + if (!_containerView) { | |
| 407 | + _containerView = [[UIView alloc]init]; | |
| 408 | + _containerView.backgroundColor = CNLiveColorWithHexString(@"FFFFFF"); | |
| 409 | + UIBezierPath *rounded = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth, KScreenHeight*3/4 - kNavigationBarHeight) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10.0f, 10.0f)]; | |
| 410 | + CAShapeLayer *shape = [[CAShapeLayer alloc]init]; | |
| 411 | + [shape setPath:rounded.CGPath]; | |
| 412 | + _containerView.layer.mask = shape; | |
| 413 | + } | |
| 414 | + return _containerView; | |
| 415 | +} | |
| 416 | +- (UIButton *)closeBtn { | |
| 417 | + if (!_closeBtn) { | |
| 418 | + _closeBtn = [[UIButton alloc]init]; | |
| 419 | + [_closeBtn setImage:[CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"perAuth_cancel" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]] forState:UIControlStateNormal]; | |
| 420 | +// _closeBtn.touchAreaInsets = UIEdgeInsetsMake(15, 15, 15, 15); | |
| 421 | + [_closeBtn addTarget:self action:@selector(closeBtnAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 422 | + } | |
| 423 | + return _closeBtn; | |
| 424 | +} | |
| 425 | +- (UITableView *)tableView { | |
| 426 | + if (!_tableView) { | |
| 427 | + _tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain]; | |
| 428 | + _tableView.backgroundColor = [UIColor clearColor]; | |
| 429 | +// _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
| 430 | + _tableView.delegate = self; | |
| 431 | + _tableView.dataSource = self; | |
| 432 | + _tableView.estimatedRowHeight = 49.5; | |
| 433 | + _tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)]; | |
| 434 | + _tableView.mj_footer.hidden = YES; | |
| 435 | + } | |
| 436 | + return _tableView; | |
| 437 | +} | |
| 438 | +- (UILabel *)titleLabel { | |
| 439 | + if (!_titleLabel) { | |
| 440 | + _titleLabel = [[UILabel alloc]init]; | |
| 441 | + _titleLabel.font = [UIFont systemFontOfSize:15]; | |
| 442 | + _titleLabel.textColor = CNLiveColorWithHexString(@"282828"); | |
| 443 | + _titleLabel.numberOfLines = 0; | |
| 444 | + _titleLabel.textAlignment = NSTextAlignmentCenter; | |
| 445 | + _titleLabel.text = @"请选择您的圈子"; | |
| 446 | + } | |
| 447 | + return _titleLabel; | |
| 448 | +} | |
| 449 | +- (UIButton *)sureBtn { | |
| 450 | + if (!_sureBtn) { | |
| 451 | + _sureBtn = [[UIButton alloc]init]; | |
| 452 | + [_sureBtn setTitle:@"确定" forState:UIControlStateNormal]; | |
| 453 | + [_sureBtn setTitleColor:CNLiveColorWithHexString(@"FFFFFF") forState:UIControlStateNormal]; | |
| 454 | + _sureBtn.backgroundColor = CNLiveColorWithHexString(@"48A7F9"); | |
| 455 | + _sureBtn.layer.cornerRadius = 22.5; | |
| 456 | + [_sureBtn addTarget:self action:@selector(sureBtnAcction) forControlEvents:UIControlEventTouchUpInside]; | |
| 457 | + } | |
| 458 | + return _sureBtn; | |
| 459 | +} | |
| 460 | +- (NSMutableArray *)dataSource { | |
| 461 | + if (!_dataSource) { | |
| 462 | + _dataSource = [NSMutableArray array]; | |
| 463 | + } | |
| 464 | + return _dataSource; | |
| 465 | +} | |
| 466 | +- (NSMutableArray *)sureDataArray { | |
| 467 | + if (!_sureDataArray) { | |
| 468 | + _sureDataArray = [NSMutableArray array]; | |
| 469 | + } | |
| 470 | + return _sureDataArray; | |
| 471 | +} | |
| 472 | +- (CNEmptyView *)emptyView { | |
| 473 | + if (!_emptyView) { | |
| 474 | + _emptyView = [[CNEmptyView alloc]initWithFrame:CGRectMake(0, KScreenHeight/4 +kNavigationBarHeight, KScreenWidth, KScreenHeight*3/4 - kNavigationBarHeight - kVerticalBottomSafeHeight) type:1]; | |
| 475 | + } | |
| 476 | + return _emptyView; | |
| 477 | +} | |
| 478 | +@end | |
| 479 | + | |
| 480 | +@interface CNBPerAuthTypeRadioCell () | |
| 481 | +@property (nonatomic, strong) UILabel *titleLabel; | |
| 482 | +@property (nonatomic, strong) UIImageView *selectImageV; | |
| 483 | +@property (nonatomic, strong) UIImageView *selectMultiImageV; //多选后面的图片 | |
| 484 | +@property (nonatomic, assign) CNBPerAuthRadioType showType; | |
| 485 | +@end | |
| 486 | +@implementation CNBPerAuthTypeRadioCell | |
| 487 | + | |
| 488 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier showType:(CNBPerAuthRadioType)showType { | |
| 489 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 490 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 491 | + if (self) { | |
| 492 | + _showType = showType; | |
| 493 | + [self configUI:showType]; | |
| 494 | + } | |
| 495 | + return self; | |
| 496 | +} | |
| 497 | +#pragma mark - 配置UI | |
| 498 | +- (void)configUI:(CNBPerAuthRadioType) showType { | |
| 499 | + __weak typeof(self) weakSelf = self; | |
| 500 | + [self.contentView addSubview:self.titleLabel]; | |
| 501 | + [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 502 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(15); | |
| 503 | + make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY); | |
| 504 | + make.height.mas_equalTo(14); | |
| 505 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-40); | |
| 506 | + }]; | |
| 507 | + if (showType == CNBperAuthRadioTypeMultiGroup) { | |
| 508 | + [self addMultiSelectImageView]; | |
| 509 | + }else { | |
| 510 | + [self addRadioSelectImageView]; | |
| 511 | + } | |
| 512 | +} | |
| 513 | +#pragma mark - 添加单选后面图片 | |
| 514 | +- (void)addRadioSelectImageView { | |
| 515 | + [self.contentView addSubview:self.selectImageV]; | |
| 516 | + __weak typeof(self) weakSelf = self; | |
| 517 | + [_selectImageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 518 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15); | |
| 519 | + make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY); | |
| 520 | + make.size.mas_equalTo(CGSizeMake(20, 15)); | |
| 521 | + }]; | |
| 522 | +} | |
| 523 | +#pragma mark - 添加多选后面button | |
| 524 | +- (void)addMultiSelectImageView { | |
| 525 | + [self.contentView addSubview:self.selectMultiImageV]; | |
| 526 | + __weak typeof(self) weakSelf = self; | |
| 527 | + [_selectMultiImageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 528 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15); | |
| 529 | + make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY); | |
| 530 | + make.size.mas_equalTo(CGSizeMake(20, 20)); | |
| 531 | + }]; | |
| 532 | +} | |
| 533 | +#pragma mark - getterAndSetter | |
| 534 | +- (void)setTypeModel:(CNBPerAuthSelectTypeModel *)typeModel { | |
| 535 | + _typeModel = typeModel; | |
| 536 | + _titleLabel.text = typeModel.name; | |
| 537 | + if (typeModel.showType == CNBperAuthRadioTypeMultiGroup) { | |
| 538 | + if ([typeModel.isCellSelected isEqualToString:@"1"]) { | |
| 539 | + _selectMultiImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"dl_xuanzhong" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]]; | |
| 540 | + }else { | |
| 541 | + _selectMultiImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"gz_faqiqunliao_wxz" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]]; | |
| 542 | + } | |
| 543 | + }else { | |
| 544 | + | |
| 545 | + if ([typeModel.isCellSelected isEqualToString:@"1"]) { | |
| 546 | + self.selectImageV.hidden = NO; | |
| 547 | + self.titleLabel.textColor = CNLiveColorWithHexString(@"282828"); | |
| 548 | + self.selectImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"perAuth_Sure" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]];; | |
| 549 | + self.userInteractionEnabled = YES; | |
| 550 | + }else { | |
| 551 | + if ([typeModel.isNoCanSelected isEqualToString:@"1"]) { | |
| 552 | + self.titleLabel.textColor = CNLiveColorWithHexString(@"999999"); | |
| 553 | + self.userInteractionEnabled = NO; | |
| 554 | + self.selectImageV.hidden = NO; | |
| 555 | + self.selectImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"yixuan" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]];; | |
| 556 | + }else { | |
| 557 | + self.selectImageV.hidden = YES; | |
| 558 | + self.userInteractionEnabled = YES; | |
| 559 | + self.titleLabel.textColor = CNLiveColorWithHexString(@"282828"); | |
| 560 | + } | |
| 561 | + } | |
| 562 | + } | |
| 563 | +} | |
| 564 | +#pragma mark - lazy | |
| 565 | +- (UILabel *)titleLabel { | |
| 566 | + if (!_titleLabel) { | |
| 567 | + _titleLabel = [[UILabel alloc]init]; | |
| 568 | + _titleLabel.textColor = CNLiveColorWithHexString(@"282828"); | |
| 569 | + _titleLabel.numberOfLines = 0; | |
| 570 | + _titleLabel.font = [UIFont systemFontOfSize:14]; | |
| 571 | + _titleLabel.textAlignment = NSTextAlignmentLeft; | |
| 572 | + } | |
| 573 | + return _titleLabel; | |
| 574 | +} | |
| 575 | +- (UIImageView *)selectImageV { | |
| 576 | + if (!_selectImageV) { | |
| 577 | + _selectImageV = [[UIImageView alloc]init]; | |
| 578 | + _selectImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"perAuth_Sure" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]]; | |
| 579 | + _selectImageV.hidden = YES; | |
| 580 | + } | |
| 581 | + return _selectImageV; | |
| 582 | +} | |
| 583 | +- (UIImageView *)selectMultiImageV { | |
| 584 | + if (!_selectMultiImageV) { | |
| 585 | + _selectMultiImageV = [[UIImageView alloc]init]; | |
| 586 | + _selectMultiImageV.image = [CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"gz_faqiqunliao_wxz" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]]; | |
| 587 | + _selectMultiImageV.hidden = NO; | |
| 588 | +// _selectMultiImageV.backgroundColor = [UIColor cyanColor]; | |
| 589 | + } | |
| 590 | + return _selectMultiImageV; | |
| 591 | +} | |
| 592 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPersonalInfoCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPersonalInfoCell.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +@class CNBUserInfoModel; | |
| 10 | +@class CNBInstitutionModel; | |
| 11 | +@class CNBCirccleModel; | |
| 12 | +NS_ASSUME_NONNULL_BEGIN | |
| 13 | + | |
| 14 | +//身份证展示cell | |
| 15 | +@interface CNBPersonalInfoCell : UITableViewCell | |
| 16 | +@property (nonatomic, strong) CNBUserInfoModel *infoModel; | |
| 17 | +@property (nonatomic, copy) void (^tapImageVBlock)(); | |
| 18 | +@end | |
| 19 | +//机构圈子展示cell | |
| 20 | +@interface CNBInstitutionsInfoCell : UITableViewCell | |
| 21 | +@property (nonatomic, strong) CNBInstitutionModel *institutionModel; | |
| 22 | +@end | |
| 23 | +//群组展示cell | |
| 24 | +@interface CNBGroupInfoCell : UITableViewCell | |
| 25 | +@property (nonatomic, strong) CNBCirccleModel *circleModel; | |
| 26 | +@end | |
| 27 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPersonalInfoCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPersonalInfoCell.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/14. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPersonalInfoCell.h" | |
| 9 | +#import <Masonry/Masonry.h> | |
| 10 | +#import "CNLivePerAuthGetImage.h" | |
| 11 | +#import "UIColor+CNLiveExtension.h" | |
| 12 | +#import "CNLiveBaseKit.h" | |
| 13 | +#import <QMUIKit/QMUIKit.h> | |
| 14 | +#import "CNBPerCertificationSuccessModel.h" | |
| 15 | +#import <SDWebImage/SDWebImage.h> | |
| 16 | +#import "CNBImageZoom.h" | |
| 17 | +#pragma mark - 身份证cell | |
| 18 | +@interface CNBPersonalInfoCell () | |
| 19 | +@property (nonatomic, strong) UILabel *nameLabel; //名字名称 | |
| 20 | +@property (nonatomic, strong) UILabel *cardLabel; //身份证号 | |
| 21 | +@property (nonatomic, strong) UIImageView *photoImageV; //图片 | |
| 22 | +@property (nonatomic, strong) UIImageView *authImageV; //认证图片 | |
| 23 | +@property (nonatomic, strong) UIView *bgView; | |
| 24 | +@property (nonatomic, assign) CGSize imageSize; | |
| 25 | +@end | |
| 26 | + | |
| 27 | +@implementation CNBPersonalInfoCell | |
| 28 | + | |
| 29 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
| 30 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 31 | + if (self) { | |
| 32 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 33 | + [self configUI]; | |
| 34 | + } | |
| 35 | + return self; | |
| 36 | +} | |
| 37 | +#pragma mark - 配置UI | |
| 38 | +- (void)configUI{ | |
| 39 | + [self.contentView addSubview:self.nameLabel]; | |
| 40 | + [self.contentView addSubview:self.cardLabel]; | |
| 41 | + [self.contentView addSubview:self.photoImageV]; | |
| 42 | + [self.contentView addSubview:self.authImageV]; | |
| 43 | + [self addMasony]; | |
| 44 | +} | |
| 45 | +- (void)addMasony { | |
| 46 | + __weak typeof(self) weakSelf = self; | |
| 47 | + [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 48 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(11.5); | |
| 49 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-150); | |
| 50 | + make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(20); | |
| 51 | + make.height.mas_equalTo(15); | |
| 52 | + }]; | |
| 53 | + [_cardLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 54 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(11.5); | |
| 55 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-150); | |
| 56 | + make.top.mas_equalTo(weakSelf.nameLabel.mas_bottom).offset(12); | |
| 57 | + make.height.mas_equalTo(10); | |
| 58 | + }]; | |
| 59 | + [_photoImageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 60 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(11.5); | |
| 61 | + make.top.mas_equalTo(weakSelf.cardLabel.mas_bottom).offset(10); | |
| 62 | + make.size.mas_equalTo(CGSizeMake(101, 151)); | |
| 63 | + }]; | |
| 64 | + [_authImageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 65 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).mas_offset(-28); | |
| 66 | + make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(26); | |
| 67 | + make.size.mas_equalTo(CGSizeMake(81, 81)); | |
| 68 | + }]; | |
| 69 | +} | |
| 70 | +#pragma mark - GetterAndSetter | |
| 71 | +- (void)setInfoModel:(CNBUserInfoModel *)infoModel { | |
| 72 | + _infoModel = infoModel; | |
| 73 | + self.nameLabel.text = [self replaceWithOriginalStr:infoModel.realName startLocation:0 length:infoModel.realName.length - 1]; | |
| 74 | + self.cardLabel.text = [self replaceWithOriginalStr:infoModel.idCardNo startLocation:1 length:infoModel.idCardNo.length - 2]; | |
| 75 | +// [_photoImageV sd_setImageWithURL:[NSURL URLWithString:infoModel.icon] placeholderImage:nil]; | |
| 76 | + __weak typeof(self) weakSelf = self; | |
| 77 | + [_photoImageV sd_setImageWithURL:[NSURL URLWithString:infoModel.icon] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { | |
| 78 | + weakSelf.photoImageV.image = image; | |
| 79 | + }]; | |
| 80 | +} | |
| 81 | +#pragma mark -替换字符串 | |
| 82 | +- (NSString *)replaceWithOriginalStr:(NSString *)originalStr startLocation:(NSInteger)startLocation length:(NSInteger)length { | |
| 83 | + NSString *newStr = originalStr; | |
| 84 | + for (int i = 0 ; i < length; i ++ ) { | |
| 85 | + NSRange range = NSMakeRange(startLocation, 1); | |
| 86 | + newStr = [newStr stringByReplacingCharactersInRange:range withString:@"*"]; | |
| 87 | + startLocation ++; | |
| 88 | + } | |
| 89 | + return newStr; | |
| 90 | +} | |
| 91 | +#pragma mark -身份证点击放大预览 | |
| 92 | +- (void)tapAction:(UITapGestureRecognizer *)tap { | |
| 93 | + UIImageView *clickedImageView = (UIImageView *)tap.view; | |
| 94 | + [CNBImageZoom imageZoomWithImageView:clickedImageView]; | |
| 95 | +} | |
| 96 | +#pragma mark -lazy | |
| 97 | +- (UILabel *)nameLabel { | |
| 98 | + if (!_nameLabel) { | |
| 99 | + _nameLabel = [[UILabel alloc]init]; | |
| 100 | + _nameLabel.textColor = CNLiveColorWithHexString(@"1A1A1A"); | |
| 101 | + _nameLabel.font = [UIFont systemFontOfSize:16]; | |
| 102 | + _nameLabel.textAlignment = NSTextAlignmentLeft; | |
| 103 | + _nameLabel.numberOfLines = 0; | |
| 104 | + _nameLabel.text = @"**哈"; | |
| 105 | + } | |
| 106 | + return _nameLabel; | |
| 107 | +} | |
| 108 | +- (UILabel *)cardLabel { | |
| 109 | + if (!_cardLabel) { | |
| 110 | + _cardLabel = [[UILabel alloc]init]; | |
| 111 | + _cardLabel.textColor = CNLiveColorWithHexString(@"9C9C9C"); | |
| 112 | + _cardLabel.font = [UIFont systemFontOfSize:12]; | |
| 113 | + _cardLabel.numberOfLines = 1; | |
| 114 | + _cardLabel.textAlignment = NSTextAlignmentLeft; | |
| 115 | + _cardLabel.text = @"1****0"; | |
| 116 | + } | |
| 117 | + return _cardLabel; | |
| 118 | +} | |
| 119 | +- (UIImageView *)photoImageV { | |
| 120 | + if (!_photoImageV) { | |
| 121 | + _photoImageV = [[UIImageView alloc]init]; | |
| 122 | + _photoImageV.contentMode = UIViewContentModeScaleAspectFit; | |
| 123 | +// _photoImageV.backgroundColor = [UIColor cyanColor]; | |
| 124 | + _photoImageV.userInteractionEnabled = YES; | |
| 125 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction:)]; | |
| 126 | + [_photoImageV addGestureRecognizer:tap]; | |
| 127 | + } | |
| 128 | + return _photoImageV; | |
| 129 | +} | |
| 130 | +- (UIImageView *)authImageV { | |
| 131 | + if (!_authImageV) { | |
| 132 | + _authImageV = [[UIImageView alloc]init]; | |
| 133 | + _authImageV.image =[CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"authSuccess" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]]; | |
| 134 | + _authImageV.contentMode = UIViewContentModeScaleAspectFit; | |
| 135 | + } | |
| 136 | + return _authImageV; | |
| 137 | +} | |
| 138 | +@end | |
| 139 | +#pragma mark - 机构cell | |
| 140 | +@interface CNBInstitutionsInfoCell () | |
| 141 | +@property (nonatomic, strong) UILabel *institutionsLabel; //圈子 | |
| 142 | +@property (nonatomic, strong) UILabel *institutionsDescLabel; | |
| 143 | +@end | |
| 144 | + | |
| 145 | +@implementation CNBInstitutionsInfoCell | |
| 146 | + | |
| 147 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
| 148 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 149 | + if (self) { | |
| 150 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 151 | + [self configUI]; | |
| 152 | + } | |
| 153 | + return self; | |
| 154 | +} | |
| 155 | +#pragma mark - 配置UI | |
| 156 | +- (void)configUI { | |
| 157 | + [self.contentView addSubview:self.institutionsLabel]; | |
| 158 | + [self.contentView addSubview:self.institutionsDescLabel]; | |
| 159 | + __weak typeof(self) weakSelf = self; | |
| 160 | + [_institutionsLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 161 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(12); | |
| 162 | + make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(14); | |
| 163 | + make.height.mas_equalTo(12); | |
| 164 | + make.width.mas_equalTo(118); | |
| 165 | + }]; | |
| 166 | + [_institutionsDescLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 167 | + make.left.mas_equalTo(weakSelf.institutionsLabel.mas_right).offset(8); | |
| 168 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15); | |
| 169 | + make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(14); | |
| 170 | + make.height.mas_equalTo(12); | |
| 171 | + }]; | |
| 172 | +} | |
| 173 | +- (void)setInstitutionModel:(CNBInstitutionModel *)institutionModel { | |
| 174 | + _institutionModel = institutionModel; | |
| 175 | + _institutionsDescLabel.text = institutionModel.mainName; | |
| 176 | +} | |
| 177 | +#pragma mark -Lazy | |
| 178 | +- (UILabel *)institutionsLabel { | |
| 179 | + if (!_institutionsLabel) { | |
| 180 | + _institutionsLabel = [[UILabel alloc]init]; | |
| 181 | + _institutionsLabel.textColor = CNLiveColorWithHexString(@"333333"); | |
| 182 | + _institutionsLabel.font = [UIFont systemFontOfSize:12.5]; | |
| 183 | + _institutionsLabel.numberOfLines = 1; | |
| 184 | + _institutionsLabel.text = @"所属机构 (主账号) :"; | |
| 185 | + _institutionsLabel.textAlignment = NSTextAlignmentLeft; | |
| 186 | + } | |
| 187 | + return _institutionsLabel; | |
| 188 | +} | |
| 189 | +- (UILabel *)institutionsDescLabel { | |
| 190 | + if (!_institutionsDescLabel) { | |
| 191 | + _institutionsDescLabel = [[UILabel alloc]init]; | |
| 192 | + _institutionsDescLabel.textColor = CNLiveColorWithHexString(@"B9B9B9"); | |
| 193 | + _institutionsDescLabel.font = [UIFont systemFontOfSize:12.5]; | |
| 194 | + _institutionsDescLabel.numberOfLines = 1; | |
| 195 | + _institutionsDescLabel.textAlignment = NSTextAlignmentLeft; | |
| 196 | + _institutionsDescLabel.text = @"北京中投视讯文化传媒股份有限公司"; | |
| 197 | + } | |
| 198 | + return _institutionsDescLabel; | |
| 199 | +} | |
| 200 | +@end | |
| 201 | +#pragma mark -群组cell | |
| 202 | +@interface CNBGroupInfoCell () | |
| 203 | +@property (nonatomic, strong) UILabel *circleLabel; //圈子 | |
| 204 | +@property (nonatomic, strong) UILabel *circleDescLabel; | |
| 205 | +@property (nonatomic, strong) UILabel *groupLabel; //群组 | |
| 206 | +@property (nonatomic, strong) UIView *groupDesView; | |
| 207 | +@property (nonatomic, strong) UIView *middleline; //中间的line | |
| 208 | +@end | |
| 209 | +@implementation CNBGroupInfoCell | |
| 210 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
| 211 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 212 | + if (self) { | |
| 213 | + [self configUI]; | |
| 214 | + self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 215 | + } | |
| 216 | + return self; | |
| 217 | +} | |
| 218 | +#pragma mark - 配置UI | |
| 219 | +- (void)configUI { | |
| 220 | + [self.contentView addSubview:self.circleLabel]; | |
| 221 | + [self.contentView addSubview:self.circleDescLabel]; | |
| 222 | + [self.contentView addSubview:self.middleline]; | |
| 223 | + [self.contentView addSubview:self.groupLabel]; | |
| 224 | + [self.contentView addSubview:self.groupDesView]; | |
| 225 | + __weak typeof(self) weakSelf = self; | |
| 226 | + [_circleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 227 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(12); | |
| 228 | + make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(14); | |
| 229 | + make.height.mas_equalTo(12); | |
| 230 | + make.width.mas_equalTo(118); | |
| 231 | + }]; | |
| 232 | + [_circleDescLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 233 | + make.left.mas_equalTo(weakSelf.circleLabel.mas_right).offset(8); | |
| 234 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15); | |
| 235 | + make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(14); | |
| 236 | + make.height.mas_equalTo(12); | |
| 237 | + }]; | |
| 238 | + [_middleline mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 239 | + make.top.mas_equalTo(weakSelf.circleLabel.mas_bottom).offset(14); | |
| 240 | + make.left.right.mas_equalTo(weakSelf.contentView); | |
| 241 | + make.height.mas_equalTo(0.5); | |
| 242 | + }]; | |
| 243 | + [_groupLabel mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 244 | + make.top.mas_equalTo (weakSelf.middleline.mas_bottom).offset(14); | |
| 245 | + make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(12); | |
| 246 | + make.width.mas_equalTo(118); | |
| 247 | + make.height.mas_equalTo(12); | |
| 248 | + }]; | |
| 249 | + [_groupDesView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 250 | + make.left.mas_equalTo(weakSelf.groupLabel.mas_right); | |
| 251 | + make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15); | |
| 252 | + make.top.mas_equalTo (weakSelf.middleline.mas_bottom).offset(8.5); | |
| 253 | + make.bottom.mas_equalTo(weakSelf.contentView.mas_bottom).offset(-10); | |
| 254 | + }]; | |
| 255 | + | |
| 256 | +} | |
| 257 | +- (void)setCircleModel:(CNBCirccleModel *)circleModel { | |
| 258 | + _circleModel = circleModel; | |
| 259 | + _circleDescLabel.text = circleModel.quanziName; | |
| 260 | + NSArray *array = circleModel.groupItem; | |
| 261 | +// NSArray *array = @[@"高老师学习小组",@"书法一班",@"书法二班"]; | |
| 262 | + [self setTagView:array]; | |
| 263 | +} | |
| 264 | +#pragma mark -展示标签列表 | |
| 265 | +- (void)setTagView:(NSArray *)array { | |
| 266 | + CGFloat tagsTotalWidth = 8; | |
| 267 | + CGFloat tagsTotalHeigh = 0; | |
| 268 | + CGFloat tagHeight = 0; | |
| 269 | + for (CNBGroupModel *groupModel in array) { | |
| 270 | + UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(tagsTotalWidth, tagsTotalHeigh, 0, 0)]; | |
| 271 | + label.font = [UIFont systemFontOfSize:12]; | |
| 272 | + label.textAlignment = NSTextAlignmentCenter; | |
| 273 | + label.layer.cornerRadius = 5; | |
| 274 | + label.layer.borderWidth = 1; | |
| 275 | + label.layer.borderColor = CNLiveColorWithHexString(@"48A7F9").CGColor; | |
| 276 | + label.textColor = CNLiveColorWithHexString(@"48A7F9"); | |
| 277 | + label.text = CNLiveStringIsEmpty(groupModel.groupName) ?@"无":groupModel.groupName; | |
| 278 | + [label sizeToFit]; | |
| 279 | + label.frame = CGRectMake(tagsTotalWidth, tagsTotalHeigh, CGRectGetWidth(label.frame) + 7.5, CGRectGetHeight(label.frame)+7.5); | |
| 280 | + | |
| 281 | + tagsTotalWidth += CGRectGetWidth(label.frame)+8; | |
| 282 | + tagHeight = CGRectGetHeight(label.frame); | |
| 283 | + if (tagsTotalWidth > KScreenWidth - 170) { | |
| 284 | + tagsTotalHeigh += CGRectGetHeight(label.frame) + 7.5; | |
| 285 | + tagsTotalWidth = 8; | |
| 286 | + label.frame = CGRectMake(tagsTotalWidth, tagsTotalHeigh, CGRectGetWidth(label.frame) + 7.5, CGRectGetHeight(label.frame)); | |
| 287 | + tagsTotalWidth += CGRectGetWidth(label.frame)+7.5; | |
| 288 | + } | |
| 289 | + [self.groupDesView addSubview:label]; | |
| 290 | + | |
| 291 | + } | |
| 292 | + tagsTotalHeigh += tagHeight; | |
| 293 | + [_groupDesView mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 294 | + make.height.mas_equalTo(tagsTotalHeigh); | |
| 295 | + }]; | |
| 296 | +} | |
| 297 | +#pragma mark -Lazy | |
| 298 | +- (UILabel *)circleLabel { | |
| 299 | + if (!_circleLabel) { | |
| 300 | + _circleLabel = [[UILabel alloc]init]; | |
| 301 | + _circleLabel.textColor = CNLiveColorWithHexString(@"333333"); | |
| 302 | + _circleLabel.font = [UIFont systemFontOfSize:12.5]; | |
| 303 | + _circleLabel.numberOfLines = 1; | |
| 304 | + _circleLabel.text = @"您的圈子 (子账号) :"; | |
| 305 | + _circleLabel.textAlignment = NSTextAlignmentLeft; | |
| 306 | + } | |
| 307 | + return _circleLabel; | |
| 308 | +} | |
| 309 | +- (UILabel *)circleDescLabel { | |
| 310 | + if (!_circleDescLabel) { | |
| 311 | + _circleDescLabel = [[UILabel alloc]init]; | |
| 312 | + _circleDescLabel.textColor = CNLiveColorWithHexString(@"B9B9B9"); | |
| 313 | + _circleDescLabel.font = [UIFont systemFontOfSize:12.5]; | |
| 314 | + _circleDescLabel.numberOfLines = 1; | |
| 315 | + _circleDescLabel.textAlignment = NSTextAlignmentLeft; | |
| 316 | + _circleDescLabel.text = @"李德文老师的圈子"; | |
| 317 | + } | |
| 318 | + return _circleDescLabel; | |
| 319 | +} | |
| 320 | +- (UIView *)middleline { | |
| 321 | + if (!_middleline) { | |
| 322 | + _middleline = [[UIView alloc]init]; | |
| 323 | + _middleline.backgroundColor = CNLiveColorWithHexString(@"EDEDED"); | |
| 324 | + } | |
| 325 | + return _middleline; | |
| 326 | +} | |
| 327 | +- (UILabel *)groupLabel { | |
| 328 | + if (!_groupLabel) { | |
| 329 | + _groupLabel = [[UILabel alloc]init]; | |
| 330 | + _groupLabel.textColor = CNLiveColorWithHexString(@"333333"); | |
| 331 | + _groupLabel.font = [UIFont systemFontOfSize:13]; | |
| 332 | + _groupLabel.text = @"圈子群组 (子群组) :"; | |
| 333 | + _groupLabel.numberOfLines = 1; | |
| 334 | + } | |
| 335 | + return _groupLabel; | |
| 336 | +} | |
| 337 | +- (UIView *)groupDesView { | |
| 338 | + if (!_groupDesView) { | |
| 339 | + _groupDesView = [[UIView alloc]init]; | |
| 340 | + _groupDesView.backgroundColor = [UIColor whiteColor]; | |
| 341 | + } | |
| 342 | + return _groupDesView; | |
| 343 | +} | |
| 344 | +@end | |
| 345 | + | |
| 346 | + | |
| 347 | + | ... | ... |
CNLiveBPersonalVerificationModule/Classes/View/CNBPersonalVerificationCell.h renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPersonalVerificationCell.h
| ... | ... | @@ -7,15 +7,21 @@ |
| 7 | 7 | |
| 8 | 8 | #import <UIKit/UIKit.h> |
| 9 | 9 | @class CNBTypeModel; |
| 10 | +@class CNBAddSectionModel; | |
| 11 | +@class CNBPerAuthSelectTypeModel; | |
| 10 | 12 | NS_ASSUME_NONNULL_BEGIN |
| 11 | 13 | //所属机构 |
| 12 | 14 | @interface CNBPersonalVerificationCell : UITableViewCell |
| 13 | - | |
| 15 | +@property (nonatomic, strong) CNBTypeModel *typeModel; | |
| 16 | +@property (nonatomic, strong) CNBAddSectionModel *sectionModel; | |
| 17 | +@property (nonatomic, copy) void (^refreshDataBlock)(void); //刷新tableView | |
| 14 | 18 | @end |
| 15 | 19 | //您的圈子和圈子群组 |
| 16 | 20 | @interface CNBCircleGroupCell : UITableViewCell |
| 17 | 21 | @property (nonatomic, strong) CNBTypeModel *typeModel; |
| 18 | -@property (nonatomic, copy) void (^circleDeleteBlock) (void); | |
| 22 | +@property (nonatomic, copy) NSString *spIdStr; //圈子请求用的spid | |
| 23 | +@property (nonatomic, copy) void (^circleDeleteBlock) (void); //删除圈子 | |
| 24 | +@property (nonatomic, copy) void (^refreshDataBlock) (void); | |
| 19 | 25 | @end |
| 20 | 26 | //添加圈子 |
| 21 | 27 | @interface CNBCircleAddGroupCell : UITableViewCell | ... | ... |
CNLiveBPersonalVerificationModule/Classes/View/CNBPersonalVerificationCell.m renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/View/CNBPersonalVerificationCell.m
| ... | ... | @@ -12,12 +12,14 @@ |
| 12 | 12 | #import "CNLiveBaseKit.h" |
| 13 | 13 | #import <QMUIKit/QMUIKit.h> |
| 14 | 14 | #import "CNBIdentifierModel.h" |
| 15 | +#import "CNBPerAuthShowView.h" | |
| 16 | +#import "CNBPerAuthTypeRadioView.h" | |
| 17 | +#import "CNBPerAuthManager.h" | |
| 15 | 18 | @interface CNBPersonalVerificationCell ()<UITextFieldDelegate> |
| 16 | 19 | @property (nonatomic, strong) UIImageView *logoImageV; //是不是必须的标识 |
| 17 | 20 | @property (nonatomic, strong) UILabel *titleLabel; //标题 |
| 18 | -//@property (nonatomic, strong) UIView *containerView; | |
| 19 | -@property (nonatomic, strong) UITextField *textField; | |
| 20 | -@property (nonatomic, strong) UIButton *rightBtn; | |
| 21 | +@property (nonatomic, strong) CNBPerAuthShowView *institutionsView; //所属机构 | |
| 22 | +@property (nonatomic, strong) NSMutableArray *selectArray; | |
| 21 | 23 | @end |
| 22 | 24 | #pragma mark - 所属机构 |
| 23 | 25 | @implementation CNBPersonalVerificationCell |
| ... | ... | @@ -34,7 +36,7 @@ |
| 34 | 36 | - (void)configUI { |
| 35 | 37 | [self.contentView addSubview:self.logoImageV]; |
| 36 | 38 | [self.contentView addSubview:self.titleLabel]; |
| 37 | - [self.contentView addSubview:self.textField]; | |
| 39 | + [self.contentView addSubview:self.institutionsView]; | |
| 38 | 40 | [self addMasony]; |
| 39 | 41 | } |
| 40 | 42 | #pragma mark - 添加约束 |
| ... | ... | @@ -50,7 +52,7 @@ |
| 50 | 52 | make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY); |
| 51 | 53 | make.size.mas_equalTo(CGSizeMake(100, 12)); |
| 52 | 54 | }]; |
| 53 | - [_textField mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 55 | + [_institutionsView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 54 | 56 | make.left.mas_equalTo(weakSelf.titleLabel.mas_right).offset(8); |
| 55 | 57 | make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY); |
| 56 | 58 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-16); |
| ... | ... | @@ -58,8 +60,49 @@ |
| 58 | 60 | }]; |
| 59 | 61 | } |
| 60 | 62 | #pragma mark - Action |
| 61 | -- (void)rightBtnAction { | |
| 62 | - | |
| 63 | +- (void)handleGesture:(UITapGestureRecognizer *)tap { | |
| 64 | + __weak typeof(self) weakSelf = self; | |
| 65 | + CNBPerAuthTypeRadioView *typeView = [[CNBPerAuthTypeRadioView alloc]initWithSelectType:CNBPerAuthRadioTypeInstitutions spId:@"" type:@"" homepageId:@"" typeModel:self.typeModel]; | |
| 66 | + typeView.selectedCellBlock = ^(CNBTypeModel * _Nonnull typeModel, CNBPerAuthSelectTypeModel * _Nonnull selectModel) { | |
| 67 | + | |
| 68 | + if (weakSelf.sectionModel.addSection == typeModel.addSection) { | |
| 69 | + weakSelf.sectionModel.institutionId = selectModel.typeId; | |
| 70 | + weakSelf.sectionModel.institutionName = selectModel.name; | |
| 71 | + for (CNBTypeModel * circleModel in weakSelf.sectionModel.typeArray) { | |
| 72 | + circleModel.circleName = @""; | |
| 73 | + circleModel.homePageId = @""; | |
| 74 | + circleModel.groupName = @""; | |
| 75 | + circleModel.groupArray = @[]; //如果点击切换了机构,就将圈子和群组的数据都清空 | |
| 76 | + } | |
| 77 | + if ([CNBPerAuthManager shareManager].circleDic && [[[CNBPerAuthManager shareManager].circleDic allKeys]containsObject:[NSString stringWithFormat:@"%ld",typeModel.addSection]]) { | |
| 78 | + [[CNBPerAuthManager shareManager].circleDic removeObjectForKey:[NSString stringWithFormat:@"%ld",typeModel.addSection]]; //删除存储的圈子信息 | |
| 79 | + } | |
| 80 | + | |
| 81 | + } | |
| 82 | + if (weakSelf.typeModel.addSection == typeModel.addSection) { //机构显示 | |
| 83 | + if (weakSelf.typeModel.addRow == typeModel.addRow) { | |
| 84 | + weakSelf.typeModel.institutionsName = selectModel.name; | |
| 85 | + weakSelf.typeModel.spId = selectModel.typeId; | |
| 86 | + if (weakSelf.refreshDataBlock) { | |
| 87 | + weakSelf.refreshDataBlock(); | |
| 88 | + } | |
| 89 | + } | |
| 90 | + } | |
| 91 | + }; | |
| 92 | + [typeView show]; | |
| 93 | +} | |
| 94 | +- (void)setSectionModel:(CNBAddSectionModel *)sectionModel { | |
| 95 | + _sectionModel = sectionModel; | |
| 96 | +} | |
| 97 | +- (void)setTypeModel:(CNBTypeModel *)typeModel { | |
| 98 | + _typeModel = typeModel; | |
| 99 | + if (CNLiveStringIsEmpty(typeModel.institutionsName)) { | |
| 100 | + self.institutionsView.showLabel.text = @"请选择您所属的机构"; | |
| 101 | + self.institutionsView.showLabel.textColor = CNLiveColorWithHexString(@"B9B9B9"); | |
| 102 | + }else { | |
| 103 | + self.institutionsView.showLabel.text = typeModel.institutionsName; | |
| 104 | + self.institutionsView.showLabel.textColor = CNLiveColorWithHexString(@"333333"); | |
| 105 | + } | |
| 63 | 106 | } |
| 64 | 107 | #pragma mark -lazy |
| 65 | 108 | - (UIImageView *)logoImageV { |
| ... | ... | @@ -81,32 +124,33 @@ |
| 81 | 124 | } |
| 82 | 125 | return _titleLabel; |
| 83 | 126 | } |
| 84 | -- (UITextField *)textField { | |
| 85 | - if (!_textField) { | |
| 86 | - _textField = [[UITextField alloc]init]; | |
| 87 | - _textField.textColor = CNLiveColorWithHexString(@"333333"); | |
| 88 | - _textField.font = [UIFont systemFontOfSize:12]; | |
| 89 | - _textField.placeholder = @"请选择您所属的机构"; | |
| 90 | - _textField.layer.borderWidth = 0.5; | |
| 91 | - _textField.layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 92 | - _textField.layer.cornerRadius = 5; | |
| 93 | - _textField.delegate = self; | |
| 94 | - UIButton *rightBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 6.5, 12)]; | |
| 95 | - [rightBtn setImage:[CNLivePerAuthGetImage cnLivePerAuth_getImageName:@"xuanze" bundle:@"CNLiveBPersonalVerificationModule.bundle/CNLiveBPersonalVerificationModule" targetClass:[self class]] forState:UIControlStateNormal]; | |
| 96 | - [rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 97 | - _textField.rightView = rightBtn; | |
| 98 | - _textField.rightViewMode = UITextFieldViewModeAlways; | |
| 99 | - } | |
| 100 | - return _textField; | |
| 127 | +- (CNBPerAuthShowView *)institutionsView { | |
| 128 | + if (!_institutionsView) { | |
| 129 | + _institutionsView = [[CNBPerAuthShowView alloc]init]; | |
| 130 | + _institutionsView.showLabel.text = @"请选择您所属的机构"; | |
| 131 | + _institutionsView.layer.borderWidth = 0.5; | |
| 132 | + _institutionsView.layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 133 | + _institutionsView.layer.cornerRadius = 5; | |
| 134 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleGesture:)]; | |
| 135 | + [_institutionsView addGestureRecognizer:tap]; | |
| 136 | + } | |
| 137 | + return _institutionsView; | |
| 138 | +} | |
| 139 | +- (NSMutableArray *)selectArray { | |
| 140 | + if (!_selectArray) { | |
| 141 | + _selectArray = [NSMutableArray array]; | |
| 142 | + } | |
| 143 | + return _selectArray; | |
| 101 | 144 | } |
| 102 | - | |
| 103 | 145 | @end |
| 104 | 146 | #pragma mark - 圈子和圈子群组 |
| 147 | +static const NSInteger CNBCircleTag = 201; | |
| 148 | +static const NSInteger CNBGroupTag = 202; | |
| 105 | 149 | @interface CNBCircleGroupCell () |
| 106 | 150 | @property (nonatomic, strong) UILabel *circleLabel; //圈子 |
| 107 | -@property (nonatomic, strong) UITextField *circleTextField;//圈子TF | |
| 151 | +@property (nonatomic, strong) CNBPerAuthShowView *circleView;//圈子TF | |
| 108 | 152 | @property (nonatomic, strong) UILabel *groupLabel; //群组 |
| 109 | -@property (nonatomic, strong) UITextField *groupTextField; //群组TF | |
| 153 | +@property (nonatomic, strong) CNBPerAuthShowView *groupView; //群组TF | |
| 110 | 154 | @property (nonatomic, strong) UIButton *deleteBtn; //删除 |
| 111 | 155 | @end |
| 112 | 156 | |
| ... | ... | @@ -122,9 +166,9 @@ |
| 122 | 166 | #pragma mark - 配置UI |
| 123 | 167 | - (void)configUI { |
| 124 | 168 | [self.contentView addSubview:self.circleLabel]; |
| 125 | - [self.contentView addSubview:self.circleTextField]; | |
| 169 | + [self.contentView addSubview:self.circleView]; | |
| 126 | 170 | [self.contentView addSubview:self.groupLabel]; |
| 127 | - [self.contentView addSubview:self.groupTextField]; | |
| 171 | + [self.contentView addSubview:self.groupView]; | |
| 128 | 172 | [self addMasony]; |
| 129 | 173 | } |
| 130 | 174 | - (void)addMasony { |
| ... | ... | @@ -134,7 +178,7 @@ |
| 134 | 178 | make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(20); |
| 135 | 179 | make.size.mas_equalTo(CGSizeMake(100, 12)); |
| 136 | 180 | }]; |
| 137 | - [_circleTextField mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 181 | + [_circleView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 138 | 182 | make.left.mas_equalTo(weakSelf.circleLabel.mas_right).offset(8); |
| 139 | 183 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-16); |
| 140 | 184 | make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(12); |
| ... | ... | @@ -145,7 +189,7 @@ |
| 145 | 189 | make.bottom.mas_equalTo(weakSelf.contentView.mas_bottom).offset(-20); |
| 146 | 190 | make.size.mas_equalTo(CGSizeMake(100, 12)); |
| 147 | 191 | }]; |
| 148 | - [_groupTextField mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 192 | + [_groupView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 149 | 193 | make.left.mas_equalTo(weakSelf.groupLabel.mas_right).offset(8); |
| 150 | 194 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-16); |
| 151 | 195 | make.bottom.mas_equalTo(weakSelf.contentView.mas_bottom).offset(-12); |
| ... | ... | @@ -162,17 +206,17 @@ |
| 162 | 206 | make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY); |
| 163 | 207 | make.size.mas_equalTo(CGSizeMake(20, 20)); |
| 164 | 208 | }]; |
| 165 | - [_circleTextField mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 209 | + [_circleView mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 166 | 210 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-43); |
| 167 | 211 | }]; |
| 168 | - [_groupTextField mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 212 | + [_groupView mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 169 | 213 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-43); |
| 170 | 214 | }]; |
| 171 | 215 | } |
| 172 | 216 | #pragma mark - getterAndSetter |
| 173 | 217 | - (void)setTypeModel:(CNBTypeModel *)typeModel{ |
| 174 | 218 | _typeModel = typeModel; |
| 175 | - if ([typeModel.type isEqualToString:@"1"]) { | |
| 219 | + if ([typeModel.showType isEqualToString:@"1"]) { | |
| 176 | 220 | if ([typeModel.isDelete isEqualToString:@"1"]) { |
| 177 | 221 | [self showDeleteBtn]; |
| 178 | 222 | }else { |
| ... | ... | @@ -180,7 +224,20 @@ |
| 180 | 224 | self.deleteBtn.hidden = YES; |
| 181 | 225 | } |
| 182 | 226 | } |
| 183 | - | |
| 227 | + if (CNLiveStringIsEmpty(typeModel.circleName)) { | |
| 228 | + self.circleView.showLabel.text = @"无"; | |
| 229 | + self.circleView.showLabel.textColor = CNLiveColorWithHexString(@"B9B9B9"); | |
| 230 | + }else { | |
| 231 | + self.circleView.showLabel.text = typeModel.circleName; | |
| 232 | + self.circleView.showLabel.textColor = CNLiveColorWithHexString(@"333333"); | |
| 233 | + } | |
| 234 | + if (CNLiveStringIsEmpty(typeModel.groupName)) { | |
| 235 | + self.groupView.showLabel.text = @"无"; | |
| 236 | + self.groupView.showLabel.textColor = CNLiveColorWithHexString(@"B9B9B9"); | |
| 237 | + }else { | |
| 238 | + self.groupView.showLabel.text = typeModel.groupName; | |
| 239 | + self.groupView.showLabel.textColor = CNLiveColorWithHexString(@"333333"); | |
| 240 | + } | |
| 184 | 241 | } |
| 185 | 242 | #pragma mark - Action |
| 186 | 243 | - (void)deleteBtnAction { |
| ... | ... | @@ -188,7 +245,58 @@ |
| 188 | 245 | self.circleDeleteBlock(); |
| 189 | 246 | } |
| 190 | 247 | } |
| 191 | - | |
| 248 | +- (void)handleGesture:(UITapGestureRecognizer *)tap { | |
| 249 | + __weak typeof(self) weakSelf = self; | |
| 250 | + if (tap.view.tag == CNBCircleTag) { | |
| 251 | + if (CNLiveStringIsEmpty(self.spIdStr)) { | |
| 252 | + [QMUITips showWithText:@"请先选择所属机构" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 253 | + return; | |
| 254 | + } | |
| 255 | + CNBPerAuthTypeRadioView *circleView = [[CNBPerAuthTypeRadioView alloc]initWithSelectType:CNBPerAuthRadioTypeCircle spId:self.spIdStr type:@"" homepageId:@"" typeModel:self.typeModel]; | |
| 256 | + circleView.selectedCellBlock = ^(CNBTypeModel * _Nonnull typeModel, CNBPerAuthSelectTypeModel * _Nonnull selectModel) { | |
| 257 | + if (weakSelf.typeModel.addSection == typeModel.addSection) { | |
| 258 | + if (weakSelf.typeModel.addRow == typeModel.addRow) { | |
| 259 | + weakSelf.typeModel.circleName = selectModel.name; | |
| 260 | + weakSelf.typeModel.homePageId = selectModel.typeId; | |
| 261 | + weakSelf.typeModel.type = selectModel.type; | |
| 262 | + weakSelf.typeModel.groupName = @""; | |
| 263 | + weakSelf.typeModel.groupArray = @[]; //切换圈子删掉群组信息 | |
| 264 | + if (weakSelf.refreshDataBlock) { | |
| 265 | + weakSelf.refreshDataBlock(); | |
| 266 | + } | |
| 267 | + } | |
| 268 | + } | |
| 269 | + }; | |
| 270 | + [circleView show]; | |
| 271 | + | |
| 272 | + }else if (tap.view.tag == CNBGroupTag) { //这里是多选 要弹出多选框 | |
| 273 | + if (CNLiveStringIsEmpty(self.spIdStr)) { | |
| 274 | + [QMUITips showWithText:@"请先选择所属机构" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 275 | + return; | |
| 276 | + } | |
| 277 | + if (CNLiveStringIsEmpty(self.typeModel.homePageId)) { | |
| 278 | + [QMUITips showWithText:@"请先选择您的圈子" inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 279 | + return; | |
| 280 | + } | |
| 281 | + CNBPerAuthTypeRadioView *groupView = [[CNBPerAuthTypeRadioView alloc]initWithSelectType:CNBperAuthRadioTypeMultiGroup spId:@"" type:@"" homepageId:self.typeModel.homePageId typeModel:self.typeModel]; | |
| 282 | + __block NSMutableArray *nameArray = [NSMutableArray array]; | |
| 283 | + groupView.multiSelectBlock = ^(CNBTypeModel * _Nonnull typeMoedl, NSArray * _Nonnull groupArray) { | |
| 284 | + for (CNBPerAuthSelectTypeModel *groupModel in groupArray) { | |
| 285 | + [nameArray addObject:groupModel.name]; | |
| 286 | + } | |
| 287 | + if (weakSelf.typeModel.addSection == typeMoedl.addSection) { | |
| 288 | + if (weakSelf.typeModel.addRow == typeMoedl.addRow) { | |
| 289 | + weakSelf.typeModel.groupName = [nameArray componentsJoinedByString:@","]; | |
| 290 | + weakSelf.typeModel.groupArray = groupArray; | |
| 291 | + if (weakSelf.refreshDataBlock) { | |
| 292 | + weakSelf.refreshDataBlock(); | |
| 293 | + } | |
| 294 | + } | |
| 295 | + } | |
| 296 | + }; | |
| 297 | + [groupView show]; | |
| 298 | + } | |
| 299 | +} | |
| 192 | 300 | #pragma mark - lazy |
| 193 | 301 | - (UILabel *)circleLabel { |
| 194 | 302 | if (!_circleLabel) { |
| ... | ... | @@ -201,17 +309,19 @@ |
| 201 | 309 | } |
| 202 | 310 | return _circleLabel; |
| 203 | 311 | } |
| 204 | -- (UITextField *)circleTextField { | |
| 205 | - if (!_circleTextField) { | |
| 206 | - _circleTextField = [[UITextField alloc]init]; | |
| 207 | - _circleTextField.textColor = CNLiveColorWithHexString(@"333333"); | |
| 208 | - _circleTextField.placeholder = @"请选择您的圈子"; | |
| 209 | - _circleTextField.layer.borderWidth = 0.5; | |
| 210 | - _circleTextField.layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 211 | - _circleTextField.font = [UIFont systemFontOfSize:12]; | |
| 212 | - _circleTextField.layer.cornerRadius = 5; | |
| 312 | +- (CNBPerAuthShowView *)circleView { | |
| 313 | + if (!_circleView) { | |
| 314 | + _circleView = [[CNBPerAuthShowView alloc]init]; | |
| 315 | + _circleView.showLabel.text = @"请选择您的圈子"; | |
| 316 | + _circleView.layer.borderWidth = 0.5; | |
| 317 | + _circleView.layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 318 | + _circleView.layer.cornerRadius = 5; | |
| 319 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleGesture:)]; | |
| 320 | + _circleView.tag = CNBCircleTag; | |
| 321 | + [_circleView addGestureRecognizer:tap]; | |
| 322 | + | |
| 213 | 323 | } |
| 214 | - return _circleTextField; | |
| 324 | + return _circleView; | |
| 215 | 325 | } |
| 216 | 326 | - (UILabel *)groupLabel { |
| 217 | 327 | if (!_groupLabel) { |
| ... | ... | @@ -224,17 +334,18 @@ |
| 224 | 334 | } |
| 225 | 335 | return _groupLabel; |
| 226 | 336 | } |
| 227 | -- (UITextField *)groupTextField { | |
| 228 | - if (!_groupTextField) { | |
| 229 | - _groupTextField = [[UITextField alloc]init]; | |
| 230 | - _groupTextField .textColor = CNLiveColorWithHexString(@"333333"); | |
| 231 | - _groupTextField .placeholder = @"请选择圈子群组"; | |
| 232 | - _groupTextField .layer.borderWidth = 0.5; | |
| 233 | - _groupTextField .layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 234 | - _groupTextField .font = [UIFont systemFontOfSize:12]; | |
| 235 | - _groupTextField .layer.cornerRadius = 5; | |
| 337 | +- (CNBPerAuthShowView *)groupView { | |
| 338 | + if (!_groupView) { | |
| 339 | + _groupView= [[CNBPerAuthShowView alloc]init]; | |
| 340 | + _groupView.showLabel.text = @"请选择圈子群组"; | |
| 341 | + _groupView .layer.borderWidth = 0.5; | |
| 342 | + _groupView .layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 343 | + _groupView .layer.cornerRadius = 5; | |
| 344 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleGesture:)]; | |
| 345 | + _groupView.tag = CNBGroupTag; | |
| 346 | + [_groupView addGestureRecognizer:tap]; | |
| 236 | 347 | } |
| 237 | - return _groupTextField; | |
| 348 | + return _groupView; | |
| 238 | 349 | } |
| 239 | 350 | - (UIButton *)deleteBtn { |
| 240 | 351 | if (!_deleteBtn) { |
| ... | ... | @@ -315,11 +426,13 @@ |
| 315 | 426 | } |
| 316 | 427 | @end |
| 317 | 428 | #pragma mark - 相关账号和相关群组 |
| 429 | +static const NSInteger CNBAccountTag = 203; | |
| 430 | +static const NSInteger CNBRelateGroupTag = 204; | |
| 318 | 431 | @interface CNBAccountGroupCell () |
| 319 | 432 | @property (nonatomic, strong) UILabel *accountLabel; //圈子 |
| 320 | -@property (nonatomic, strong) UITextField *accountTextField;//圈子TF | |
| 433 | +@property (nonatomic, strong) CNBPerAuthShowView *accountView;//圈子TF | |
| 321 | 434 | @property (nonatomic, strong) UILabel *relateGroupLabel; //群组 |
| 322 | -@property (nonatomic, strong) UITextField *relateGroupTextField; //群组TF | |
| 435 | +@property (nonatomic, strong) CNBPerAuthShowView *relateGroupView; //群组TF | |
| 323 | 436 | @property (nonatomic, strong) UIButton *deleteBtn; //删除 |
| 324 | 437 | @end |
| 325 | 438 | |
| ... | ... | @@ -336,9 +449,9 @@ |
| 336 | 449 | #pragma mark - 配置UI |
| 337 | 450 | - (void)configUI { |
| 338 | 451 | [self.contentView addSubview:self.accountLabel]; |
| 339 | - [self.contentView addSubview:self.accountTextField]; | |
| 452 | + [self.contentView addSubview:self.accountView]; | |
| 340 | 453 | [self.contentView addSubview:self.relateGroupLabel]; |
| 341 | - [self.contentView addSubview:self.relateGroupTextField]; | |
| 454 | + [self.contentView addSubview:self.relateGroupView]; | |
| 342 | 455 | [self addMasony]; |
| 343 | 456 | } |
| 344 | 457 | - (void)addMasony { |
| ... | ... | @@ -348,7 +461,7 @@ |
| 348 | 461 | make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(20); |
| 349 | 462 | make.size.mas_equalTo(CGSizeMake(100, 12)); |
| 350 | 463 | }]; |
| 351 | - [_accountTextField mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 464 | + [_accountView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 352 | 465 | make.left.mas_equalTo(weakSelf.accountLabel.mas_right).offset(8); |
| 353 | 466 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-16); |
| 354 | 467 | make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(12); |
| ... | ... | @@ -359,7 +472,7 @@ |
| 359 | 472 | make.bottom.mas_equalTo(weakSelf.contentView.mas_bottom).offset(-20); |
| 360 | 473 | make.size.mas_equalTo(CGSizeMake(100, 12)); |
| 361 | 474 | }]; |
| 362 | - [_relateGroupTextField mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 475 | + [_relateGroupView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 363 | 476 | make.left.mas_equalTo(weakSelf.relateGroupLabel.mas_right).offset(8); |
| 364 | 477 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-16); |
| 365 | 478 | make.bottom.mas_equalTo(weakSelf.contentView.mas_bottom).offset(-12); |
| ... | ... | @@ -376,17 +489,17 @@ |
| 376 | 489 | make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY); |
| 377 | 490 | make.size.mas_equalTo(CGSizeMake(20, 20)); |
| 378 | 491 | }]; |
| 379 | - [_accountTextField mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 492 | + [_accountView mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 380 | 493 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-43); |
| 381 | 494 | }]; |
| 382 | - [_relateGroupTextField mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 495 | + [_relateGroupView mas_updateConstraints:^(MASConstraintMaker *make) { | |
| 383 | 496 | make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-43); |
| 384 | 497 | }]; |
| 385 | 498 | } |
| 386 | 499 | #pragma mark - getterAndSetter |
| 387 | 500 | - (void)setAccountTypeModel:(CNBTypeModel *)accountTypeModel { |
| 388 | 501 | _accountTypeModel = accountTypeModel; |
| 389 | - if ([accountTypeModel.type isEqualToString:@"3"]) { | |
| 502 | + if ([accountTypeModel.showType isEqualToString:@"3"]) { | |
| 390 | 503 | if ([accountTypeModel.isDelete isEqualToString:@"1"]) { |
| 391 | 504 | [self showDeleteBtn]; |
| 392 | 505 | }else{ |
| ... | ... | @@ -413,17 +526,18 @@ |
| 413 | 526 | } |
| 414 | 527 | return _accountLabel; |
| 415 | 528 | } |
| 416 | -- (UITextField *)accountTextField { | |
| 417 | - if (!_accountTextField) { | |
| 418 | - _accountTextField= [[UITextField alloc]init]; | |
| 419 | - _accountTextField.textColor = CNLiveColorWithHexString(@"333333"); | |
| 420 | - _accountTextField.placeholder = @"请选择机构子账号"; | |
| 421 | - _accountTextField.layer.borderWidth = 0.5; | |
| 422 | - _accountTextField.layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 423 | - _accountTextField.font = [UIFont systemFontOfSize:12]; | |
| 424 | - _accountTextField.layer.cornerRadius = 5; | |
| 529 | +- (CNBPerAuthShowView *)accountView { | |
| 530 | + if (!_accountView) { | |
| 531 | + _accountView = [[CNBPerAuthShowView alloc]init]; | |
| 532 | + _accountView.showLabel.text = @"请选择机构子账号"; | |
| 533 | + _accountView.layer.borderWidth = 0.5; | |
| 534 | + _accountView.layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 535 | + _accountView.layer.cornerRadius = 5; | |
| 536 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleGesture:)]; | |
| 537 | + tap.view.tag = CNBAccountTag; | |
| 538 | + [_accountView addGestureRecognizer:tap]; | |
| 425 | 539 | } |
| 426 | - return _accountTextField; | |
| 540 | + return _accountView; | |
| 427 | 541 | } |
| 428 | 542 | - (UILabel *)relateGroupLabel { |
| 429 | 543 | if (!_relateGroupLabel) { |
| ... | ... | @@ -436,17 +550,18 @@ |
| 436 | 550 | } |
| 437 | 551 | return _relateGroupLabel; |
| 438 | 552 | } |
| 439 | -- (UITextField *)relateGroupTextField { | |
| 440 | - if (!_relateGroupTextField) { | |
| 441 | - _relateGroupTextField = [[UITextField alloc]init]; | |
| 442 | - _relateGroupTextField.textColor = CNLiveColorWithHexString(@"333333"); | |
| 443 | - _relateGroupTextField.placeholder = @"请选择圈子账号群组"; | |
| 444 | - _relateGroupTextField.layer.borderWidth = 0.5; | |
| 445 | - _relateGroupTextField.layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 446 | - _relateGroupTextField.font = [UIFont systemFontOfSize:12]; | |
| 447 | - _relateGroupTextField.layer.cornerRadius = 5; | |
| 448 | - } | |
| 449 | - return _relateGroupTextField; | |
| 553 | +- (CNBPerAuthShowView *)relateGroupView{ | |
| 554 | + if (!_relateGroupView) { | |
| 555 | + _relateGroupView = [[CNBPerAuthShowView alloc]init]; | |
| 556 | + _relateGroupView.showLabel.text = @"请选择圈子账号群组"; | |
| 557 | + _relateGroupView.layer.borderWidth = 0.5; | |
| 558 | + _relateGroupView.layer.borderColor = CNLiveColorWithHexString(@"C1C1C1").CGColor; | |
| 559 | + _relateGroupView.layer.cornerRadius = 5; | |
| 560 | + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleGesture:)]; | |
| 561 | + tap.view.tag = CNBRelateGroupTag; | |
| 562 | + [_relateGroupView addGestureRecognizer:tap]; | |
| 563 | + } | |
| 564 | + return _relateGroupView; | |
| 450 | 565 | } |
| 451 | 566 | - (UIButton *)deleteBtn { |
| 452 | 567 | if (!_deleteBtn) { | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNBImageZoom.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBImageZoom.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/16. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNBImageZoom : NSObject | |
| 13 | ++ (void)imageZoomWithImageView:(UIImageView *)contentImageView; | |
| 14 | +@end | |
| 15 | + | |
| 16 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNBImageZoom.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBImageZoom.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/16. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBImageZoom.h" | |
| 9 | +#import "CNLiveBaseKit.h" | |
| 10 | +@implementation CNBImageZoom | |
| 11 | +static CGRect oldframe; | |
| 12 | ++ (void)imageZoomWithImageView:(UIImageView *)contentImageView { | |
| 13 | + UIWindow *window = [UIApplication sharedApplication].keyWindow; | |
| 14 | + [self scanBigImageWithImage:contentImageView.image frame:[contentImageView convertRect:contentImageView.bounds toView:window]]; | |
| 15 | +} | |
| 16 | ++ (void)scanBigImageWithImage:(UIImage *)image frame:(CGRect)oldframe { | |
| 17 | + UIWindow *window = [UIApplication sharedApplication].keyWindow; | |
| 18 | + //背景 | |
| 19 | + UIView *bgVew = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; | |
| 20 | + bgVew.backgroundColor = [UIColor blackColor]; | |
| 21 | + bgVew.hidden = YES; | |
| 22 | + //将所展示的imageView重新绘制在Window中 | |
| 23 | + UIImageView *imageView = [[UIImageView alloc] initWithFrame:oldframe]; | |
| 24 | + [imageView setImage:image]; | |
| 25 | + [imageView setTag:1024]; | |
| 26 | + [bgVew addSubview:imageView]; | |
| 27 | + //将原始视图添加到背景视图中 | |
| 28 | + [window addSubview:bgVew]; | |
| 29 | + //添加点击事件同样是类方法 -> 作用是再次点击回到初始大小 | |
| 30 | + UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideImageView:)]; | |
| 31 | + [bgVew addGestureRecognizer:tapGestureRecognizer]; | |
| 32 | + | |
| 33 | + //动画放大所展示的ImageView | |
| 34 | + | |
| 35 | + [UIView animateWithDuration:0.4 animations:^{ | |
| 36 | + CGFloat y,width,height; | |
| 37 | + y = ([UIScreen mainScreen].bounds.size.height - image.size.height * [UIScreen mainScreen].bounds.size.width / image.size.width) * 0.5; | |
| 38 | + //宽度为屏幕宽度 | |
| 39 | + width = [UIScreen mainScreen].bounds.size.width; | |
| 40 | + //高度 根据图片宽高比设置 | |
| 41 | + height = image.size.height * [UIScreen mainScreen].bounds.size.width / image.size.width; | |
| 42 | + [imageView setFrame:CGRectMake(0, y, width, height)]; | |
| 43 | + //重要! 将视图显示出来 | |
| 44 | + bgVew.hidden = NO; | |
| 45 | + } completion:^(BOOL finished) { | |
| 46 | + | |
| 47 | + }]; | |
| 48 | + | |
| 49 | +} | |
| 50 | + | |
| 51 | ++(void)hideImageView:(UITapGestureRecognizer *)tap{ | |
| 52 | + UIView *backgroundView = tap.view; | |
| 53 | + //原始imageview | |
| 54 | + UIImageView *imageView = [tap.view viewWithTag:1024]; | |
| 55 | + //恢复 | |
| 56 | + [UIView animateWithDuration:0.4 animations:^{ | |
| 57 | + [imageView setFrame:oldframe]; | |
| 58 | + backgroundView.hidden = YES;; | |
| 59 | + } completion:^(BOOL finished) { | |
| 60 | + //完成后操作->将背景视图删掉 | |
| 61 | + [backgroundView removeFromSuperview]; | |
| 62 | + }]; | |
| 63 | +} | |
| 64 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNBPerAuthManager.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthManager.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/11. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "YYCache.h" | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNBPerAuthManager : NSObject | |
| 13 | ++ (instancetype)shareManager; | |
| 14 | +@property (nonatomic, strong) NSMutableArray *instSelectedArray; //机构选择过的数组 | |
| 15 | +@property (nonatomic, strong) NSMutableDictionary *circleDic; | |
| 16 | +@end | |
| 17 | + | |
| 18 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNBPerAuthManager.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthManager.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/11. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPerAuthManager.h" | |
| 9 | +#import "CNUserInfoManager.h" | |
| 10 | +#import "NSString+CNLiveExtension.h" | |
| 11 | +static YYCache *yycache = nil; | |
| 12 | +@interface CNBPerAuthManager () | |
| 13 | + | |
| 14 | +@end | |
| 15 | + | |
| 16 | +@implementation CNBPerAuthManager | |
| 17 | ++ (instancetype)shareManager { | |
| 18 | + static CNBPerAuthManager *manager = nil; | |
| 19 | + static dispatch_once_t onceToken; | |
| 20 | + dispatch_once(&onceToken, ^{ | |
| 21 | + manager = [[self alloc] init]; | |
| 22 | + }); | |
| 23 | + return manager; | |
| 24 | +} | |
| 25 | +- (instancetype)init { | |
| 26 | + if (self = [super init]) { | |
| 27 | + self.instSelectedArray = [NSMutableArray array]; | |
| 28 | + self.circleDic = [NSMutableDictionary dictionary]; | |
| 29 | + } | |
| 30 | + return self; | |
| 31 | +} | |
| 32 | + | |
| 33 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNBPerAuthViewModel.h
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthViewModel.h | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/10. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +#import "CNBPerAuthSelectTypeModel.h" | |
| 10 | +NS_ASSUME_NONNULL_BEGIN | |
| 11 | + | |
| 12 | +@interface CNBPerAuthViewModel : NSObject | |
| 13 | + | |
| 14 | +/// 请求 机构 圈子 还有群组 | |
| 15 | +/// @param spId 机构 传@"" 圈子传 | |
| 16 | +/// @param type 类型 | |
| 17 | +/// @param homepageId 请求 群组的时候传 | |
| 18 | +/// @param page 页数 | |
| 19 | +/// @param selectType 选择类型 | |
| 20 | +/// @param successBlock 成功 | |
| 21 | +/// @param failureBlock 失败 | |
| 22 | ++ (void)getPerAuthTypeListWithSpId:(NSString *)spId type:(NSString *)type homepageId:(NSString *)homepageId page:(NSInteger)page selectType:(CNBPerAuthRadioType)selectType successBlock:(void (^)(NSMutableArray *dataSource,NSString * hasNextPage))successBlock failureBlock:(void (^) (NSError *error))failureBlock; | |
| 23 | + | |
| 24 | +/// 提交接口 | |
| 25 | +/// @param institutionStr 给后台传的json字符串 | |
| 26 | +/// @param successBlock 成功 | |
| 27 | +/// @param failureBlock 失败 | |
| 28 | ++ (void)submitPerAuthData:(NSString *)institutionStr successBlock:(void (^)(BOOL isSuccess))successBlock failureBlock:(void (^) (NSError *error))failureBlock; | |
| 29 | + | |
| 30 | +/// 请求认证成功的接口 | |
| 31 | +/// @param successBlock 成功 | |
| 32 | +/// @param failureBlock 失败 | |
| 33 | ++ (void)getPerAuthSuccessList:(void (^)(NSMutableArray *dataArray))successBlock failureBlock:(void (^)(NSError *error))failureBlock; | |
| 34 | +@end | |
| 35 | + | |
| 36 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNBPerAuthViewModel.m
0 → 100644
| 1 | +// | |
| 2 | +// CNBPerAuthViewModel.m | |
| 3 | +// CNLiveBPersonalVerificationModule | |
| 4 | +// | |
| 5 | +// Created by 殷巧娟 on 2020/4/10. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNBPerAuthViewModel.h" | |
| 9 | +#import "CNLiveNetworking.h" | |
| 10 | +#import "NSString+CNLiveExtension.h" | |
| 11 | +#import "MJExtension.h" | |
| 12 | +#import <QMUIKit/QMUIKit.h> | |
| 13 | +#import "CNBPerCertificationSuccessModel.h" | |
| 14 | +#import "CNLiveBaseKit.h" | |
| 15 | +@implementation CNBPerAuthViewModel | |
| 16 | +#pragma mark - 请求机构等列表 | |
| 17 | ++ (void)getPerAuthTypeListWithSpId:(NSString *)spId type:(NSString *)type homepageId:(NSString *)homepageId page:(NSInteger)page selectType:(CNBPerAuthRadioType)selectType successBlock:(void (^)(NSMutableArray *dataSource,NSString *hasNextPage))successBlock failureBlock:(void (^) (NSError *error))failureBlock { | |
| 18 | + NSDictionary *param = @{ | |
| 19 | + @"spId": CNLiveStringIsEmpty(spId) ? @"": spId, | |
| 20 | + @"type" : CNLiveStringIsEmpty(type) ? @"": type, | |
| 21 | + @"homepageId":CNLiveStringIsEmpty(homepageId) ? @"": homepageId, | |
| 22 | + @"page": [NSString stringWithFormat:@"%ld",page], | |
| 23 | + @"pageSize":[NSString stringWithFormat:@"%d",10], | |
| 24 | + }; | |
| 25 | + | |
| 26 | + [CNLiveNetworking setupShowDataResult:NO]; | |
| 27 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 28 | + NSString *url = @"http://cmstest.cnlive.com:8768/contentApi/getAllSp"; | |
| 29 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:url Param:param CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 30 | + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]]) { | |
| 31 | + NSString *errorCode = [NSString stringWithFormat:@"%@",[responseObject objectForKey:@"errorCode"]]; | |
| 32 | + NSMutableArray *listArray = [NSMutableArray array]; | |
| 33 | + NSString *errorMessage = responseObject[@"errorMessage"]; | |
| 34 | + if ([errorCode isEqualToString:@"0"]) { | |
| 35 | + NSDictionary *data = responseObject[@"data"]; | |
| 36 | + if (data && [data isKindOfClass:[NSDictionary class]]) { | |
| 37 | + NSString *isHaveNext = [NSString stringWithFormat:@"%@",data[@"hasNextPage"]]; | |
| 38 | + if (data[@"list"] && [data[@"list"] isKindOfClass:[NSArray class]]) { | |
| 39 | + NSArray *lists = data[@"list"]; | |
| 40 | + for (NSDictionary *dic in lists) { | |
| 41 | + CNBPerAuthSelectTypeModel *model = [CNBPerAuthSelectTypeModel mj_objectWithKeyValues:dic]; | |
| 42 | + model.showType = selectType; | |
| 43 | + [listArray addObject:model]; | |
| 44 | + } | |
| 45 | + } | |
| 46 | + !successBlock ?: successBlock(listArray, isHaveNext); | |
| 47 | + } | |
| 48 | + }else { | |
| 49 | + [QMUITips showWithText:errorMessage inView:AppKeyWindow hideAfterDelay:1.5]; | |
| 50 | + } | |
| 51 | + }else { | |
| 52 | + !failureBlock ? : failureBlock(error); | |
| 53 | + } | |
| 54 | + }]; | |
| 55 | +} | |
| 56 | +#pragma mark - 提交接口 | |
| 57 | ++ (void)submitPerAuthData:(NSString *)institutionStr successBlock:(void (^)(BOOL))successBlock failureBlock:(void (^)(NSError * _Nonnull))failureBlock { | |
| 58 | + [CNLiveNetworking setupShowDataResult:NO]; | |
| 59 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 60 | + NSDictionary *param = @{ | |
| 61 | + @"institution":CNLiveStringIsEmpty(institutionStr) ? @"":institutionStr | |
| 62 | + }; | |
| 63 | + NSString *url = @"https://apiwjjtest.cnlive.com/Daren/buser/saveInstitution.action"; | |
| 64 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:url Param:param CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 65 | + if (!error) { | |
| 66 | + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]]) { | |
| 67 | + NSString *errorCode = [NSString stringWithFormat:@"%@",[responseObject objectForKey:@"errorCode"]]; | |
| 68 | + NSString *errorMessage = responseObject[@"errorMessage"]; | |
| 69 | + if ([errorCode isEqualToString:@"0"]) { | |
| 70 | + !successBlock? : successBlock(YES); | |
| 71 | + }else { | |
| 72 | + [QMUITips showWithText:errorMessage inView:AppKeyWindow hideAfterDelay:1.5f]; | |
| 73 | + } | |
| 74 | + } | |
| 75 | + }else { | |
| 76 | + !failureBlock ? :failureBlock(error); | |
| 77 | + } | |
| 78 | + }]; | |
| 79 | +} | |
| 80 | +#pragma mark -请求认证成功 | |
| 81 | ++ (void)getPerAuthSuccessList:(void (^)(NSMutableArray *dataArray))successBlock failureBlock:(void (^)(NSError * error))failureBlock { | |
| 82 | + NSDictionary *param = @{ | |
| 83 | + @"sid":@"10513196" | |
| 84 | + }; | |
| 85 | + [CNLiveNetworking setupShowDataResult:NO]; | |
| 86 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 87 | + NSMutableArray *array = [NSMutableArray array]; | |
| 88 | + NSString *url = @"https://apiwjjtest.cnlive.com/Daren/buser/getBUserInfo.action"; | |
| 89 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:url Param:param CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | |
| 90 | + if (!error) { | |
| 91 | + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]]) { | |
| 92 | + NSString *errorCode = [NSString stringWithFormat:@"%@",[responseObject objectForKey:@"errorCode"]]; | |
| 93 | + NSString *errorMessage = responseObject[@"errorMessage"]; | |
| 94 | + if ([errorCode isEqualToString:@"0"]) { | |
| 95 | + if (responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]) { | |
| 96 | + CNBPerCertificationSuccessModel *model = [CNBPerCertificationSuccessModel mj_objectWithKeyValues:responseObject[@"data"]]; | |
| 97 | + [array addObject:model]; | |
| 98 | + | |
| 99 | + } | |
| 100 | + !successBlock ? :successBlock(array); | |
| 101 | + }else { | |
| 102 | + [QMUITips showWithText:errorMessage inView:AppKeyWindow hideAfterDelay:1.5f]; | |
| 103 | + } | |
| 104 | + | |
| 105 | + } | |
| 106 | + }else { | |
| 107 | + !failureBlock ? :failureBlock(error); | |
| 108 | + } | |
| 109 | + }]; | |
| 110 | +} | |
| 111 | +@end | ... | ... |
CNLiveBPersonalVerificationModule/Classes/ViewModel/CNLivePerAuthGetImage.h renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNLivePerAuthGetImage.h
CNLiveBPersonalVerificationModule/Classes/ViewModel/CNLivePerAuthGetImage.m renamed to CNLiveBPersonalVerificationModule/Classes/CNBInstitutionInfo/ViewModel/CNLivePerAuthGetImage.m
Example/CNLiveBPersonalVerificationModule.xcodeproj/project.pbxproj
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | 27702AE45A435A3D3F6D7F80 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; |
| 42 | 42 | 2EE018FA9C0FF28273EA7BB2 /* Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveBPersonalVerificationModule_Example/Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig"; sourceTree = "<group>"; }; |
| 43 | 43 | 5116195DD3BA1DE9570EE346 /* Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveBPersonalVerificationModule_Tests/Pods-CNLiveBPersonalVerificationModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; |
| 44 | - 6003F58A195388D20070C39A /* CNLiveBPersonalVerificationModule_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveBPersonalVerificationModule_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 44 | + 6003F58A195388D20070C39A /* CNLiveBPersonalVerificationModule.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CNLiveBPersonalVerificationModule.app; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 45 | 45 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; |
| 46 | 46 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; |
| 47 | 47 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; |
| ... | ... | @@ -110,7 +110,7 @@ |
| 110 | 110 | 6003F58B195388D20070C39A /* Products */ = { |
| 111 | 111 | isa = PBXGroup; |
| 112 | 112 | children = ( |
| 113 | - 6003F58A195388D20070C39A /* CNLiveBPersonalVerificationModule_Example.app */, | |
| 113 | + 6003F58A195388D20070C39A /* CNLiveBPersonalVerificationModule.app */, | |
| 114 | 114 | 6003F5AE195388D20070C39A /* CNLiveBPersonalVerificationModule_Tests.xctest */, |
| 115 | 115 | ); |
| 116 | 116 | name = Products; |
| ... | ... | @@ -207,7 +207,7 @@ |
| 207 | 207 | 6003F586195388D20070C39A /* Sources */, |
| 208 | 208 | 6003F587195388D20070C39A /* Frameworks */, |
| 209 | 209 | 6003F588195388D20070C39A /* Resources */, |
| 210 | - 4F2DF1EFF922B3D1F3D9B2AC /* [CP] Embed Pods Frameworks */, | |
| 210 | + B2F8A8613C02A00CFC3ED01D /* [CP] Embed Pods Frameworks */, | |
| 211 | 211 | ); |
| 212 | 212 | buildRules = ( |
| 213 | 213 | ); |
| ... | ... | @@ -215,7 +215,7 @@ |
| 215 | 215 | ); |
| 216 | 216 | name = CNLiveBPersonalVerificationModule_Example; |
| 217 | 217 | productName = CNLiveBPersonalVerificationModule; |
| 218 | - productReference = 6003F58A195388D20070C39A /* CNLiveBPersonalVerificationModule_Example.app */; | |
| 218 | + productReference = 6003F58A195388D20070C39A /* CNLiveBPersonalVerificationModule.app */; | |
| 219 | 219 | productType = "com.apple.product-type.application"; |
| 220 | 220 | }; |
| 221 | 221 | 6003F5AD195388D20070C39A /* CNLiveBPersonalVerificationModule_Tests */ = { |
| ... | ... | @@ -247,6 +247,9 @@ |
| 247 | 247 | LastUpgradeCheck = 0720; |
| 248 | 248 | ORGANIZATIONNAME = dawanzi; |
| 249 | 249 | TargetAttributes = { |
| 250 | + 6003F589195388D20070C39A = { | |
| 251 | + DevelopmentTeam = 94X49GG3ZW; | |
| 252 | + }; | |
| 250 | 253 | 6003F5AD195388D20070C39A = { |
| 251 | 254 | TestTargetID = 6003F589195388D20070C39A; |
| 252 | 255 | }; |
| ... | ... | @@ -339,7 +342,7 @@ |
| 339 | 342 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; |
| 340 | 343 | showEnvVarsInLog = 0; |
| 341 | 344 | }; |
| 342 | - 4F2DF1EFF922B3D1F3D9B2AC /* [CP] Embed Pods Frameworks */ = { | |
| 345 | + B2F8A8613C02A00CFC3ED01D /* [CP] Embed Pods Frameworks */ = { | |
| 343 | 346 | isa = PBXShellScriptBuildPhase; |
| 344 | 347 | buildActionMask = 2147483647; |
| 345 | 348 | files = ( |
| ... | ... | @@ -348,9 +351,13 @@ |
| 348 | 351 | "${PODS_ROOT}/Target Support Files/Pods-CNLiveBPersonalVerificationModule_Example/Pods-CNLiveBPersonalVerificationModule_Example-frameworks.sh", |
| 349 | 352 | "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", |
| 350 | 353 | "${BUILT_PRODUCTS_DIR}/CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule.framework", |
| 354 | + "${BUILT_PRODUCTS_DIR}/CNLiveBaseClass/CNLiveBaseClass.framework", | |
| 351 | 355 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", |
| 356 | + "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework", | |
| 352 | 357 | "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", |
| 358 | + "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework", | |
| 353 | 359 | "${BUILT_PRODUCTS_DIR}/CNLiveCustomUI/CNLiveCustomUI.framework", |
| 360 | + "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", | |
| 354 | 361 | "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", |
| 355 | 362 | "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework", |
| 356 | 363 | "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", |
| ... | ... | @@ -359,15 +366,20 @@ |
| 359 | 366 | "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", |
| 360 | 367 | "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", |
| 361 | 368 | "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", |
| 369 | + "${BUILT_PRODUCTS_DIR}/WebViewJavascriptBridge/WebViewJavascriptBridge.framework", | |
| 362 | 370 | "${BUILT_PRODUCTS_DIR}/YYKit/YYKit.framework", |
| 363 | 371 | ); |
| 364 | 372 | name = "[CP] Embed Pods Frameworks"; |
| 365 | 373 | outputPaths = ( |
| 366 | 374 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", |
| 367 | 375 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBPersonalVerificationModule.framework", |
| 376 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseClass.framework", | |
| 368 | 377 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", |
| 378 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework", | |
| 369 | 379 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", |
| 380 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework", | |
| 370 | 381 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomUI.framework", |
| 382 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", | |
| 371 | 383 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", |
| 372 | 384 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework", |
| 373 | 385 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", |
| ... | ... | @@ -376,6 +388,7 @@ |
| 376 | 388 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", |
| 377 | 389 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", |
| 378 | 390 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", |
| 391 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebViewJavascriptBridge.framework", | |
| 379 | 392 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKit.framework", |
| 380 | 393 | ); |
| 381 | 394 | runOnlyForDeploymentPostprocessing = 0; |
| ... | ... | @@ -520,12 +533,13 @@ |
| 520 | 533 | baseConfigurationReference = 2EE018FA9C0FF28273EA7BB2 /* Pods-CNLiveBPersonalVerificationModule_Example.debug.xcconfig */; |
| 521 | 534 | buildSettings = { |
| 522 | 535 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 536 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | |
| 523 | 537 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 524 | 538 | GCC_PREFIX_HEADER = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Prefix.pch"; |
| 525 | 539 | INFOPLIST_FILE = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Info.plist"; |
| 526 | 540 | MODULE_NAME = ExampleApp; |
| 527 | - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 528 | - PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 541 | + PRODUCT_BUNDLE_IDENTIFIER = CNLiveBPersonalVerificationModule.debug; | |
| 542 | + PRODUCT_NAME = CNLiveBPersonalVerificationModule; | |
| 529 | 543 | SWIFT_VERSION = 4.0; |
| 530 | 544 | WRAPPER_EXTENSION = app; |
| 531 | 545 | }; |
| ... | ... | @@ -536,12 +550,13 @@ |
| 536 | 550 | baseConfigurationReference = 7FEBB718E90600F2D63EAB08 /* Pods-CNLiveBPersonalVerificationModule_Example.release.xcconfig */; |
| 537 | 551 | buildSettings = { |
| 538 | 552 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 553 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | |
| 539 | 554 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 540 | 555 | GCC_PREFIX_HEADER = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Prefix.pch"; |
| 541 | 556 | INFOPLIST_FILE = "CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Info.plist"; |
| 542 | 557 | MODULE_NAME = ExampleApp; |
| 543 | - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; | |
| 544 | - PRODUCT_NAME = "$(TARGET_NAME)"; | |
| 558 | + PRODUCT_BUNDLE_IDENTIFIER = CNLiveBPersonalVerificationModule.debug; | |
| 559 | + PRODUCT_NAME = CNLiveBPersonalVerificationModule; | |
| 545 | 560 | SWIFT_VERSION = 4.0; |
| 546 | 561 | WRAPPER_EXTENSION = app; |
| 547 | 562 | }; | ... | ... |
Example/CNLiveBPersonalVerificationModule.xcodeproj/xcshareddata/xcschemes/CNLiveBPersonalVerificationModule-Example.xcscheme
| ... | ... | @@ -15,7 +15,7 @@ |
| 15 | 15 | <BuildableReference |
| 16 | 16 | BuildableIdentifier = "primary" |
| 17 | 17 | BlueprintIdentifier = "6003F589195388D20070C39A" |
| 18 | - BuildableName = "CNLiveBPersonalVerificationModule_Example.app" | |
| 18 | + BuildableName = "CNLiveBPersonalVerificationModule.app" | |
| 19 | 19 | BlueprintName = "CNLiveBPersonalVerificationModule_Example" |
| 20 | 20 | ReferencedContainer = "container:CNLiveBPersonalVerificationModule.xcodeproj"> |
| 21 | 21 | </BuildableReference> |
| ... | ... | @@ -27,6 +27,15 @@ |
| 27 | 27 | selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
| 28 | 28 | selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
| 29 | 29 | shouldUseLaunchSchemeArgsEnv = "YES"> |
| 30 | + <MacroExpansion> | |
| 31 | + <BuildableReference | |
| 32 | + BuildableIdentifier = "primary" | |
| 33 | + BlueprintIdentifier = "6003F589195388D20070C39A" | |
| 34 | + BuildableName = "CNLiveBPersonalVerificationModule.app" | |
| 35 | + BlueprintName = "CNLiveBPersonalVerificationModule_Example" | |
| 36 | + ReferencedContainer = "container:CNLiveBPersonalVerificationModule.xcodeproj"> | |
| 37 | + </BuildableReference> | |
| 38 | + </MacroExpansion> | |
| 30 | 39 | <Testables> |
| 31 | 40 | <TestableReference |
| 32 | 41 | skipped = "NO"> |
| ... | ... | @@ -39,17 +48,6 @@ |
| 39 | 48 | </BuildableReference> |
| 40 | 49 | </TestableReference> |
| 41 | 50 | </Testables> |
| 42 | - <MacroExpansion> | |
| 43 | - <BuildableReference | |
| 44 | - BuildableIdentifier = "primary" | |
| 45 | - BlueprintIdentifier = "6003F589195388D20070C39A" | |
| 46 | - BuildableName = "CNLiveBPersonalVerificationModule_Example.app" | |
| 47 | - BlueprintName = "CNLiveBPersonalVerificationModule_Example" | |
| 48 | - ReferencedContainer = "container:CNLiveBPersonalVerificationModule.xcodeproj"> | |
| 49 | - </BuildableReference> | |
| 50 | - </MacroExpansion> | |
| 51 | - <AdditionalOptions> | |
| 52 | - </AdditionalOptions> | |
| 53 | 51 | </TestAction> |
| 54 | 52 | <LaunchAction |
| 55 | 53 | buildConfiguration = "Debug" |
| ... | ... | @@ -66,13 +64,11 @@ |
| 66 | 64 | <BuildableReference |
| 67 | 65 | BuildableIdentifier = "primary" |
| 68 | 66 | BlueprintIdentifier = "6003F589195388D20070C39A" |
| 69 | - BuildableName = "CNLiveBPersonalVerificationModule_Example.app" | |
| 67 | + BuildableName = "CNLiveBPersonalVerificationModule.app" | |
| 70 | 68 | BlueprintName = "CNLiveBPersonalVerificationModule_Example" |
| 71 | 69 | ReferencedContainer = "container:CNLiveBPersonalVerificationModule.xcodeproj"> |
| 72 | 70 | </BuildableReference> |
| 73 | 71 | </BuildableProductRunnable> |
| 74 | - <AdditionalOptions> | |
| 75 | - </AdditionalOptions> | |
| 76 | 72 | </LaunchAction> |
| 77 | 73 | <ProfileAction |
| 78 | 74 | buildConfiguration = "Release" |
| ... | ... | @@ -85,7 +81,7 @@ |
| 85 | 81 | <BuildableReference |
| 86 | 82 | BuildableIdentifier = "primary" |
| 87 | 83 | BlueprintIdentifier = "6003F589195388D20070C39A" |
| 88 | - BuildableName = "CNLiveBPersonalVerificationModule_Example.app" | |
| 84 | + BuildableName = "CNLiveBPersonalVerificationModule.app" | |
| 89 | 85 | BlueprintName = "CNLiveBPersonalVerificationModule_Example" |
| 90 | 86 | ReferencedContainer = "container:CNLiveBPersonalVerificationModule.xcodeproj"> |
| 91 | 87 | </BuildableReference> | ... | ... |
Example/CNLiveBPersonalVerificationModule/CNLIVEAppDelegate.m
| ... | ... | @@ -8,6 +8,10 @@ |
| 8 | 8 | |
| 9 | 9 | #import "CNLIVEAppDelegate.h" |
| 10 | 10 | #import "CNLIVEViewController.h" |
| 11 | +#import "CNLIVEViewController.h" | |
| 12 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 13 | +#import "CNLiveEnvironment.h" | |
| 14 | +static NSString * uuid; | |
| 11 | 15 | @implementation CNLIVEAppDelegate |
| 12 | 16 | |
| 13 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
| ... | ... | @@ -18,9 +22,35 @@ |
| 18 | 22 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; |
| 19 | 23 | self.window.rootViewController = nav; |
| 20 | 24 | [self.window makeKeyAndVisible]; |
| 25 | + [self networkParamAction]; | |
| 21 | 26 | return YES; |
| 22 | 27 | } |
| 23 | 28 | |
| 29 | +- (void)networkParamAction { | |
| 30 | + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init]; | |
| 31 | + [mDict setValue:@"10511059" forKey:@"loginSid"]; | |
| 32 | + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"] forKey:@"platform_id"]; | |
| 33 | + [mDict setValue:[self appUUIDString] forKey:@"uuid"]; | |
| 34 | + [mDict setValue:@"i" forKey:@"plat"]; | |
| 35 | + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"]; | |
| 36 | + [mDict setObject:AppId forKey:@"appId"]; | |
| 37 | + [CNLiveNetworking setupDefaultParam:mDict]; | |
| 38 | + [CNLiveNetworking setupShowResult:NO]; | |
| 39 | + [CNLiveNetworking setupSignKey:APPKey]; | |
| 40 | + NSLog(@"打印appkey%@",APPKey); | |
| 41 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | |
| 42 | + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON]; | |
| 43 | + | |
| 44 | +} | |
| 45 | +- (NSString *)appUUIDString | |
| 46 | + { | |
| 47 | + static dispatch_once_t onceToken; | |
| 48 | + dispatch_once(&onceToken, ^{ | |
| 49 | + uuid = [[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""]; | |
| 50 | + }); | |
| 51 | + return uuid; | |
| 52 | + } | |
| 53 | + | |
| 24 | 54 | - (void)applicationWillResignActive:(UIApplication *)application |
| 25 | 55 | { |
| 26 | 56 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. | ... | ... |
Example/CNLiveBPersonalVerificationModule/CNLIVEViewController.m
| ... | ... | @@ -8,6 +8,8 @@ |
| 8 | 8 | |
| 9 | 9 | #import "CNLIVEViewController.h" |
| 10 | 10 | #import "CNBPersonalVerificationController.h" |
| 11 | +#import "CNBPerAuthSuccessController.h" | |
| 12 | +#import "CNBPerCertificationController.h" | |
| 11 | 13 | @interface CNLIVEViewController () |
| 12 | 14 | |
| 13 | 15 | @end |
| ... | ... | @@ -22,10 +24,39 @@ |
| 22 | 24 | button.backgroundColor = [UIColor cyanColor]; |
| 23 | 25 | [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside]; |
| 24 | 26 | [self.view addSubview:button]; |
| 27 | + UIButton *successBtn = [UIButton buttonWithType:UIButtonTypeSystem]; | |
| 28 | + successBtn.frame = CGRectMake(240, 100, 100, 100); | |
| 29 | + successBtn.backgroundColor = [UIColor purpleColor]; | |
| 30 | + [successBtn addTarget:self action:@selector(successBtnAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 31 | + [self.view addSubview:successBtn]; | |
| 32 | + for (int i = 0; i < 3; i ++) { | |
| 33 | + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 34 | + button.frame = CGRectMake(20*(i +1) + 100*i, 240, 100, 100); | |
| 35 | + button.backgroundColor = [UIColor greenColor]; | |
| 36 | + [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside]; | |
| 37 | + button.tag = 200 +i; | |
| 38 | + [self.view addSubview:button]; | |
| 39 | + } | |
| 25 | 40 | } |
| 26 | 41 | - (void)buttonAction { |
| 27 | 42 | CNBPersonalVerificationController *vc = [[CNBPersonalVerificationController alloc]init]; |
| 28 | - [self.navigationController pushViewController:vc animated:YES]; | |
| 43 | + [self.navigationController pushViewController:vc animated:NO]; | |
| 44 | +} | |
| 45 | +- (void)successBtnAction { | |
| 46 | + CNBPerAuthSuccessController *vc = [[CNBPerAuthSuccessController alloc]init]; | |
| 47 | + [self.navigationController pushViewController:vc animated:NO]; | |
| 48 | +} | |
| 49 | +- (void)buttonClick:(UIButton *)sender { | |
| 50 | + if (sender.tag == 200) { | |
| 51 | + CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:CNBShowCertificatTypeFail]; | |
| 52 | + [self.navigationController pushViewController:vc animated:NO]; | |
| 53 | + }else if (sender.tag == 201){ | |
| 54 | + CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:CNBShowCertificatTypeNone]; | |
| 55 | + [self.navigationController pushViewController:vc animated:NO]; | |
| 56 | + }else { | |
| 57 | + CNBPerCertificationController *vc = [[CNBPerCertificationController alloc]initControllerWithCertificatType:CNBShowCertificatTypeAuditing]; | |
| 58 | + [self.navigationController pushViewController:vc animated:NO]; | |
| 59 | + } | |
| 29 | 60 | } |
| 30 | 61 | - (void)didReceiveMemoryWarning |
| 31 | 62 | { | ... | ... |
Example/CNLiveBPersonalVerificationModule/CNLiveBPersonalVerificationModule-Info.plist
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | <key>CFBundleDevelopmentRegion</key> |
| 6 | 6 | <string>en</string> |
| 7 | 7 | <key>CFBundleDisplayName</key> |
| 8 | - <string>${PRODUCT_NAME}</string> | |
| 8 | + <string>$(PRODUCT_NAME)</string> | |
| 9 | 9 | <key>CFBundleExecutable</key> |
| 10 | 10 | <string>${EXECUTABLE_NAME}</string> |
| 11 | 11 | <key>CFBundleIdentifier</key> |
| ... | ... | @@ -22,8 +22,15 @@ |
| 22 | 22 | <string>????</string> |
| 23 | 23 | <key>CFBundleVersion</key> |
| 24 | 24 | <string>1.0</string> |
| 25 | + <key>LSApplicationCategoryType</key> | |
| 26 | + <string></string> | |
| 25 | 27 | <key>LSRequiresIPhoneOS</key> |
| 26 | 28 | <true/> |
| 29 | + <key>NSAppTransportSecurity</key> | |
| 30 | + <dict> | |
| 31 | + <key>NSAllowsArbitraryLoads</key> | |
| 32 | + <true/> | |
| 33 | + </dict> | |
| 27 | 34 | <key>UILaunchStoryboardName</key> |
| 28 | 35 | <string>LaunchScreen</string> |
| 29 | 36 | <key>UIMainStoryboardFile</key> | ... | ... |
Example/Podfile
| ... | ... | @@ -2,13 +2,12 @@ use_frameworks! |
| 2 | 2 | source 'https://github.com/CocoaPods/Specs.git' |
| 3 | 3 | source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git' |
| 4 | 4 | platform :ios, '9.0' |
| 5 | - | |
| 6 | 5 | target 'CNLiveBPersonalVerificationModule_Example' do |
| 7 | 6 | pod 'CNLiveBPersonalVerificationModule', :path => '../' |
| 8 | - | |
| 7 | +# pod 'CNLiveMall', :git => 'https://gitee.com/feng520ckx/CNLiveMallSDK.git' | |
| 8 | + pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} | |
| 9 | + end | |
| 9 | 10 | target 'CNLiveBPersonalVerificationModule_Tests' do |
| 10 | 11 | inherit! :search_paths |
| 11 | - | |
| 12 | - | |
| 13 | 12 | end |
| 14 | 13 | end | ... | ... |