Commit 54f5bf5d15cf8b7949fcff2863335e04de0df0ec
1 parent
6b473c0d
提交更改
Showing
7 changed files
with
81 additions
and
32 deletions
CNLiveServiceCenterModule.podspec
| @@ -81,12 +81,6 @@ Pod::Spec.new do |s| | @@ -81,12 +81,6 @@ Pod::Spec.new do |s| | ||
| 81 | ### 所有github三方管理库(非频繁更新) | 81 | ### 所有github三方管理库(非频繁更新) |
| 82 | ######################################## | 82 | ######################################## |
| 83 | s.dependency 'CNLiveTripartiteManagement' | 83 | s.dependency 'CNLiveTripartiteManagement' |
| 84 | - | ||
| 85 | - #TODO:后面都注释掉直接在主工程导入 | ||
| 86 | - #认证模块 | ||
| 87 | - s.dependency 'CNLiveOrganizationValidationModule' | ||
| 88 | - #用户认证模块 | ||
| 89 | - s.dependency 'CNLiveBPersonalVerificationModule' | ||
| 90 | 84 | ||
| 91 | 85 | ||
| 92 | end | 86 | end |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Controller/CNLiveBCreatorViewController.h
| @@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN | @@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 12 | 12 | ||
| 13 | @interface CNLiveBCreatorViewController : CNCommonViewController | 13 | @interface CNLiveBCreatorViewController : CNCommonViewController |
| 14 | 14 | ||
| 15 | + | ||
| 16 | +@property (strong, nonatomic) NSString *url; | ||
| 17 | + | ||
| 15 | @end | 18 | @end |
| 16 | 19 | ||
| 17 | NS_ASSUME_NONNULL_END | 20 | NS_ASSUME_NONNULL_END |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Controller/CNLiveBCreatorViewController.m
| @@ -18,18 +18,11 @@ | @@ -18,18 +18,11 @@ | ||
| 18 | #import <objc/runtime.h> | 18 | #import <objc/runtime.h> |
| 19 | #import <CNLiveBaseKit/CNLiveBaseKit.h> | 19 | #import <CNLiveBaseKit/CNLiveBaseKit.h> |
| 20 | 20 | ||
| 21 | -//http://wjjh5.cnlive.com/cnBCzzxy.html | ||
| 22 | -//http://wjjh5test.cnlive.com/cnBCzzxy.html | ||
| 23 | - | ||
| 24 | - | ||
| 25 | -#define CNLiveBCenterCreaterUrl cn_WjjH5_Host(@"/cnBCzzxy.html") | ||
| 26 | 21 | ||
| 27 | @interface CNLiveBCreatorViewController ()<WKNavigationDelegate,WKUIDelegate,UIScrollViewDelegate> | 22 | @interface CNLiveBCreatorViewController ()<WKNavigationDelegate,WKUIDelegate,UIScrollViewDelegate> |
| 28 | 23 | ||
| 29 | @property (strong, nonatomic) WKWebView *wkwebView; | 24 | @property (strong, nonatomic) WKWebView *wkwebView; |
| 30 | 25 | ||
| 31 | -@property (strong, nonatomic) NSString *url; | ||
| 32 | - | ||
| 33 | @property (assign,nonatomic) NSUInteger loadCount; | 26 | @property (assign,nonatomic) NSUInteger loadCount; |
| 34 | @property (assign,nonatomic) UIProgressView *progressView; | 27 | @property (assign,nonatomic) UIProgressView *progressView; |
| 35 | 28 | ||
| @@ -40,7 +33,6 @@ | @@ -40,7 +33,6 @@ | ||
| 40 | 33 | ||
| 41 | - (void)viewDidLoad { | 34 | - (void)viewDidLoad { |
| 42 | [super viewDidLoad]; | 35 | [super viewDidLoad]; |
| 43 | - self.title = @"创作者学院"; | ||
| 44 | [self.view setBackgroundColor:[UIColor whiteColor]]; | 36 | [self.view setBackgroundColor:[UIColor whiteColor]]; |
| 45 | [self initWKWebView]; | 37 | [self initWKWebView]; |
| 46 | 38 | ||
| @@ -58,15 +50,17 @@ | @@ -58,15 +50,17 @@ | ||
| 58 | 50 | ||
| 59 | 51 | ||
| 60 | self.view.backgroundColor = [UIColor whiteColor]; | 52 | self.view.backgroundColor = [UIColor whiteColor]; |
| 61 | - self.url = CNLiveBCenterCreaterUrl; | ||
| 62 | WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, KScreenHeight)]; | 53 | WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, KScreenHeight)]; |
| 63 | [self.view addSubview:webView]; | 54 | [self.view addSubview:webView]; |
| 64 | webView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; | 55 | webView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; |
| 65 | [webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil]; | 56 | [webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil]; |
| 66 | - NSURL *url = [NSURL URLWithString:self.url]; | ||
| 67 | - NSURLRequest *request = [NSURLRequest requestWithURL:url]; | ||
| 68 | - [webView loadRequest:request]; | ||
| 69 | - | 57 | + if (self.url) { |
| 58 | + NSURL *url = [NSURL URLWithString:self.url]; | ||
| 59 | + if (url) { | ||
| 60 | + NSURLRequest *request = [NSURLRequest requestWithURL:url]; | ||
| 61 | + [webView loadRequest:request]; | ||
| 62 | + } | ||
| 63 | + } | ||
| 70 | [self.view insertSubview:webView belowSubview:progress]; | 64 | [self.view insertSubview:webView belowSubview:progress]; |
| 71 | 65 | ||
| 72 | } | 66 | } |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Controller/CNLiveBServiceCenterController.m
| @@ -27,10 +27,18 @@ | @@ -27,10 +27,18 @@ | ||
| 27 | #import "CNLiveBCreatorViewController.h" | 27 | #import "CNLiveBCreatorViewController.h" |
| 28 | #import "CNLiveBServiceLiveSelectedView.h" | 28 | #import "CNLiveBServiceLiveSelectedView.h" |
| 29 | 29 | ||
| 30 | +/// 认证状态 | ||
| 30 | #define CNLiveBGetServiceStatusUrl cn_API_OpenApi2(@"/user/readWJJBStatusById") | 31 | #define CNLiveBGetServiceStatusUrl cn_API_OpenApi2(@"/user/readWJJBStatusById") |
| 32 | +/// 机构认证 | ||
| 31 | #define CNLiveBOrganizationValidattionStatusUrl cn_API_OpenApi2(@"/auser/getAccount.action") | 33 | #define CNLiveBOrganizationValidattionStatusUrl cn_API_OpenApi2(@"/auser/getAccount.action") |
| 34 | +/// 个人认证 | ||
| 32 | #define CNLiveBOrganizationPersonStatusUrl cn_API_Host(@"/Daren/buser/getBUserInfo.action") | 35 | #define CNLiveBOrganizationPersonStatusUrl cn_API_Host(@"/Daren/buser/getBUserInfo.action") |
| 33 | 36 | ||
| 37 | +//http://wjjh5.cnlive.com/cnBCzzxy.html | ||
| 38 | +//http://wjjh5test.cnlive.com/cnBCzzxy.html | ||
| 39 | +/// 创建者url | ||
| 40 | +#define CNLiveBCenterCreaterUrl cn_WjjH5_Host(@"/cnBCzzxy.html") | ||
| 41 | + | ||
| 34 | @interface CNLiveBServiceCenterController ()<UITableViewDataSource,UITableViewDelegate> | 42 | @interface CNLiveBServiceCenterController ()<UITableViewDataSource,UITableViewDelegate> |
| 35 | 43 | ||
| 36 | /** 头部*/ | 44 | /** 头部*/ |
| @@ -207,6 +215,11 @@ | @@ -207,6 +215,11 @@ | ||
| 207 | }else { | 215 | }else { |
| 208 | [certificationCell configUI:self.centerModel type:CNLiveBServiceCertificationCellTypeInstitutions]; | 216 | [certificationCell configUI:self.centerModel type:CNLiveBServiceCertificationCellTypeInstitutions]; |
| 209 | } | 217 | } |
| 218 | + __weak typeof(self) weakSelf = self; | ||
| 219 | + certificationCell.clickWebViewBlock = ^(CNLiveBServiceCertificationCell * _Nonnull cell, NSString * _Nonnull webUrl) { | ||
| 220 | + | ||
| 221 | + [weakSelf jumpWebViewForUrl:webUrl]; | ||
| 222 | + }; | ||
| 210 | return certificationCell; | 223 | return certificationCell; |
| 211 | }else if (indexPath.row == 2){ | 224 | }else if (indexPath.row == 2){ |
| 212 | CNLiveBServiceHelpLearnCell *helpLearnCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBServiceHelpLearnCell forIndexPath:indexPath]; | 225 | CNLiveBServiceHelpLearnCell *helpLearnCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBServiceHelpLearnCell forIndexPath:indexPath]; |
| @@ -340,6 +353,8 @@ | @@ -340,6 +353,8 @@ | ||
| 340 | ///跳转创作者 | 353 | ///跳转创作者 |
| 341 | - (void)jumpCreaterVC { | 354 | - (void)jumpCreaterVC { |
| 342 | CNLiveBCreatorViewController *vc = [[CNLiveBCreatorViewController alloc]init]; | 355 | CNLiveBCreatorViewController *vc = [[CNLiveBCreatorViewController alloc]init]; |
| 356 | + vc.title = @"创作者学院"; | ||
| 357 | + vc.url = CNLiveBCenterCreaterUrl; | ||
| 343 | vc.hidesBottomBarWhenPushed = YES; | 358 | vc.hidesBottomBarWhenPushed = YES; |
| 344 | [self.navigationController pushViewController:vc animated:YES]; | 359 | [self.navigationController pushViewController:vc animated:YES]; |
| 345 | } | 360 | } |
| @@ -352,6 +367,17 @@ | @@ -352,6 +367,17 @@ | ||
| 352 | 367 | ||
| 353 | } | 368 | } |
| 354 | 369 | ||
| 370 | +/// 跳转网页 | ||
| 371 | +- (void)jumpWebViewForUrl:(NSString *)url{ | ||
| 372 | + CNLiveBCreatorViewController *vc = [[CNLiveBCreatorViewController alloc]init]; | ||
| 373 | + vc.title = @"视讯云"; | ||
| 374 | + vc.url = url; | ||
| 375 | + vc.hidesBottomBarWhenPushed = YES; | ||
| 376 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 377 | + | ||
| 378 | + | ||
| 379 | +} | ||
| 380 | + | ||
| 355 | 381 | ||
| 356 | 382 | ||
| 357 | 383 |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCertificationCell.h
| @@ -24,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN | @@ -24,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 24 | 24 | ||
| 25 | - (void)configUI:(CNLiveBServiceCenterModel *)model type:(CNLiveBServiceCertificationCellType)type; | 25 | - (void)configUI:(CNLiveBServiceCenterModel *)model type:(CNLiveBServiceCertificationCellType)type; |
| 26 | 26 | ||
| 27 | +/** 点击按钮l回调 */ | ||
| 28 | +@property (nonatomic, copy) void(^clickWebViewBlock)(CNLiveBServiceCertificationCell *cell,NSString *webUrl); | ||
| 29 | + | ||
| 27 | @end | 30 | @end |
| 28 | 31 | ||
| 29 | NS_ASSUME_NONNULL_END | 32 | NS_ASSUME_NONNULL_END |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCertificationCell.m
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | #import <Masonry/Masonry.h> | 10 | #import <Masonry/Masonry.h> |
| 11 | #import "UIImage+Service.h" | 11 | #import "UIImage+Service.h" |
| 12 | #import <CNLiveBaseKit/CNLiveBaseKit.h> | 12 | #import <CNLiveBaseKit/CNLiveBaseKit.h> |
| 13 | +#import <YYKit/YYKit.h> | ||
| 13 | 14 | ||
| 14 | @interface CNLiveBServiceCertificationCell() | 15 | @interface CNLiveBServiceCertificationCell() |
| 15 | /** 背景*/ | 16 | /** 背景*/ |
| @@ -17,7 +18,7 @@ | @@ -17,7 +18,7 @@ | ||
| 17 | /** 头部*/ | 18 | /** 头部*/ |
| 18 | @property (nonatomic, strong) UILabel *titleL; | 19 | @property (nonatomic, strong) UILabel *titleL; |
| 19 | /** 内容*/ | 20 | /** 内容*/ |
| 20 | -@property (nonatomic, strong) UILabel *contentL; | 21 | +@property (nonatomic, strong) YYLabel *contentL; |
| 21 | /** 认证*/ | 22 | /** 认证*/ |
| 22 | @property (nonatomic, strong) UIButton *certificationBtn; | 23 | @property (nonatomic, strong) UIButton *certificationBtn; |
| 23 | /** 认证Log*/ | 24 | /** 认证Log*/ |
| @@ -55,7 +56,7 @@ | @@ -55,7 +56,7 @@ | ||
| 55 | #pragma mark - ***setupUI*** | 56 | #pragma mark - ***setupUI*** |
| 56 | - (void)setupUI { | 57 | - (void)setupUI { |
| 57 | 58 | ||
| 58 | - self.selectionStyle = UITableViewCellSelectionStyleNone; | 59 | + self.selectionStyle = UITableViewCellSelectionStyleNone; |
| 59 | 60 | ||
| 60 | [self setBackgroundColor:[UIColor whiteColor]]; | 61 | [self setBackgroundColor:[UIColor whiteColor]]; |
| 61 | [self addSubview:self.cellBGimageV]; | 62 | [self addSubview:self.cellBGimageV]; |
| @@ -79,14 +80,14 @@ | @@ -79,14 +80,14 @@ | ||
| 79 | make.right.equalTo(weakSelf.mas_right).offset(0); | 80 | make.right.equalTo(weakSelf.mas_right).offset(0); |
| 80 | make.bottom.equalTo(weakSelf.mas_bottom).offset(0); | 81 | make.bottom.equalTo(weakSelf.mas_bottom).offset(0); |
| 81 | }]; | 82 | }]; |
| 82 | - | 83 | + |
| 83 | [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) { | 84 | [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) { |
| 84 | make.left.equalTo(weakSelf.mas_left).offset(20.5); | 85 | make.left.equalTo(weakSelf.mas_left).offset(20.5); |
| 85 | make.top.equalTo(weakSelf.mas_top).offset(26.5); | 86 | make.top.equalTo(weakSelf.mas_top).offset(26.5); |
| 86 | make.width.mas_equalTo(100); | 87 | make.width.mas_equalTo(100); |
| 87 | make.height.mas_equalTo(17); | 88 | make.height.mas_equalTo(17); |
| 88 | }]; | 89 | }]; |
| 89 | - | 90 | + |
| 90 | [self.contentL mas_makeConstraints:^(MASConstraintMaker *make) { | 91 | [self.contentL mas_makeConstraints:^(MASConstraintMaker *make) { |
| 91 | make.left.equalTo(weakSelf.titleL.mas_left).offset(0); | 92 | make.left.equalTo(weakSelf.titleL.mas_left).offset(0); |
| 92 | make.top.equalTo(weakSelf.titleL.mas_bottom).offset(13); | 93 | make.top.equalTo(weakSelf.titleL.mas_bottom).offset(13); |
| @@ -101,7 +102,7 @@ | @@ -101,7 +102,7 @@ | ||
| 101 | make.height.mas_equalTo(25); | 102 | make.height.mas_equalTo(25); |
| 102 | }]; | 103 | }]; |
| 103 | 104 | ||
| 104 | - | 105 | + |
| 105 | 106 | ||
| 106 | } | 107 | } |
| 107 | 108 | ||
| @@ -132,7 +133,29 @@ | @@ -132,7 +133,29 @@ | ||
| 132 | }else { | 133 | }else { |
| 133 | self.titleL.text = @"机构认证"; | 134 | self.titleL.text = @"机构认证"; |
| 134 | self.titleL.textColor = RGBOF(0xe7a010); | 135 | self.titleL.textColor = RGBOF(0xe7a010); |
| 135 | - self.contentL.text = @"适合企业、媒体、国家机构和其他知名机构申请。\n申请方式:在B端申请或在电脑打开链接:http://open.cnlive.com/操作申请。"; | 136 | + NSString *contentText = @"适合企业、媒体、国家机构和其他知名机构申请。\n申请方式:在B端申请或在电脑打开链接:http://open.cnlive.com/操作申请。"; |
| 137 | + NSString *tipText = @"http://open.cnlive.com/"; | ||
| 138 | + NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:contentText]; | ||
| 139 | + | ||
| 140 | + NSRange range = [contentText rangeOfString:tipText]; | ||
| 141 | + // 2. 将属性设置为文本,可以使用几乎所有的CoreText属性。 | ||
| 142 | + text.font = [UIFont systemFontOfSize:12]; | ||
| 143 | + text.color = RGBOF(0x7b7b7b); | ||
| 144 | + __weak typeof(self) weakSelf = self; | ||
| 145 | + [text setTextHighlightRange:range | ||
| 146 | + color:[UIColor colorWithRed:0.093 green:0.492 blue:1.000 alpha:1.000] | ||
| 147 | + backgroundColor:[UIColor whiteColor] | ||
| 148 | + tapAction:^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { | ||
| 149 | + //点击文本的操作 | ||
| 150 | + NSLog(@"输出内容"); | ||
| 151 | + if (weakSelf.clickWebViewBlock) { | ||
| 152 | + weakSelf.clickWebViewBlock(weakSelf, tipText); | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + }]; | ||
| 156 | + | ||
| 157 | + | ||
| 158 | + self.contentL.attributedText = text; | ||
| 136 | 159 | ||
| 137 | if (model) { | 160 | if (model) { |
| 138 | if ([model.institutionStatus isEqualToString:@"1"]) { | 161 | if ([model.institutionStatus isEqualToString:@"1"]) { |
| @@ -154,10 +177,10 @@ | @@ -154,10 +177,10 @@ | ||
| 154 | #pragma mark - ***事件实现*** | 177 | #pragma mark - ***事件实现*** |
| 155 | - (void)attentionBtnAction:(UIButton *)sender { | 178 | - (void)attentionBtnAction:(UIButton *)sender { |
| 156 | 179 | ||
| 157 | -// if (self.clickAttentionBtnBlock) { | ||
| 158 | -// self.clickAttentionBtnBlock(self, sender); | ||
| 159 | -// } | ||
| 160 | -// | 180 | + // if (self.clickAttentionBtnBlock) { |
| 181 | + // self.clickAttentionBtnBlock(self, sender); | ||
| 182 | + // } | ||
| 183 | + // | ||
| 161 | } | 184 | } |
| 162 | 185 | ||
| 163 | 186 | ||
| @@ -187,10 +210,10 @@ | @@ -187,10 +210,10 @@ | ||
| 187 | } | 210 | } |
| 188 | 211 | ||
| 189 | /*** 内容 ***/ | 212 | /*** 内容 ***/ |
| 190 | -- (UILabel *)contentL { | 213 | +- (YYLabel *)contentL { |
| 191 | 214 | ||
| 192 | if (!_contentL) { | 215 | if (!_contentL) { |
| 193 | - _contentL = [[UILabel alloc]init]; | 216 | + _contentL = [[YYLabel alloc]init]; |
| 194 | _contentL.font = [UIFont systemFontOfSize:12]; | 217 | _contentL.font = [UIFont systemFontOfSize:12]; |
| 195 | _contentL.textAlignment = NSTextAlignmentLeft; | 218 | _contentL.textAlignment = NSTextAlignmentLeft; |
| 196 | //让内容置顶 | 219 | //让内容置顶 |
| @@ -236,7 +259,7 @@ | @@ -236,7 +259,7 @@ | ||
| 236 | 259 | ||
| 237 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { | 260 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { |
| 238 | [super setSelected:selected animated:animated]; | 261 | [super setSelected:selected animated:animated]; |
| 239 | - | 262 | + |
| 240 | // Configure the view for the selected state | 263 | // Configure the view for the selected state |
| 241 | } | 264 | } |
| 242 | 265 |
Example/Podfile
| @@ -14,6 +14,12 @@ target 'CNLiveServiceCenterModule_Example' do | @@ -14,6 +14,12 @@ target 'CNLiveServiceCenterModule_Example' do | ||
| 14 | 14 | ||
| 15 | target 'CNLiveServiceCenterModule_Tests' do | 15 | target 'CNLiveServiceCenterModule_Tests' do |
| 16 | inherit! :search_paths | 16 | inherit! :search_paths |
| 17 | + | ||
| 18 | + #TODO:后面都注释掉直接在主工程导入 | ||
| 19 | + #认证模块 | ||
| 20 | + pod 'CNLiveOrganizationValidationModule' | ||
| 21 | + #用户认证模块 | ||
| 22 | + pod 'CNLiveBPersonalVerificationModule' | ||
| 17 | 23 | ||
| 18 | 24 | ||
| 19 | end | 25 | end |