Commit b986563fba67810ad2eed95c87ce22b90aa6e32a

Authored by iOS-Xiaowen
1 parent ec4fdde9

no message

Showing 23 changed files with 374 additions and 357 deletions
CNLiveLoginModule.podspec
... ... @@ -72,9 +72,7 @@ TODO: 网家家-登录模块.
72 72  
73 73 # s.public_header_files = 'Pod/Classes/**/*.h'
74 74 # s.frameworks = 'UIKit', 'MapKit'
75   -
76   - s.dependency 'CNLiveServices'
77   -
  75 +
78 76 # pod
79 77 s.dependency 'CNLiveSDKs/CNLiveUserSystemSDK', '~> 0.3.1.3' #GitHub所以指定版本号
80 78 s.dependency 'CNLiveTripartiteManagement/QMUIKit'
... ... @@ -116,7 +114,7 @@ TODO: 网家家-登录模块.
116 114 s.dependency 'tingyunApp', '~>2.14.0'
117 115  
118 116 # 分享
119   - s.dependency 'CNLiveShareToolKit'
  117 +# s.dependency 'CNLiveShareToolKit'
120 118  
121 119 # 类别
122 120 s.dependency 'CNLiveCategory'
... ...
CNLiveLoginModule/Assets/CNLiveLoginModule.xcassets/login_get_code_b.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "login_get_code_b@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "login_get_code_b@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveLoginModule/Assets/CNLiveLoginModule.xcassets/login_get_code_b.imageset/login_get_code_b@2x.png 0 → 100644

7.27 KB

CNLiveLoginModule/Assets/CNLiveLoginModule.xcassets/login_get_code_b.imageset/login_get_code_b@3x.png 0 → 100644

17.9 KB

CNLiveLoginModule/Assets/CNLiveLoginModule.xcassets/login_logo_b.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "login_logo_b@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "login_logo_b@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
CNLiveLoginModule/Assets/CNLiveLoginModule.xcassets/login_logo_b.imageset/login_logo_b@2x.png 0 → 100644

24.8 KB

CNLiveLoginModule/Assets/CNLiveLoginModule.xcassets/login_logo_b.imageset/login_logo_b@3x.png 0 → 100644

48.4 KB

CNLiveLoginModule/Classes/BindingManage/CNLiveBindingManageCell.m
... ... @@ -8,6 +8,9 @@
8 8  
9 9 #import "CNLiveBindingManageCell.h"
10 10 #import <Masonry/Masonry.h>
  11 +#import "QMUIKit.h"
  12 +#import "CNLiveBaseKit.h"
  13 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
11 14  
12 15 #import "CNLiveBindingManageModel.h"
13 16 #import "CNLiveBindingManageRequest.h"
... ... @@ -31,7 +34,7 @@ static NSInteger const margin = 15;
31 34 }
32 35 return self;
33 36 }
34   -- (void)setModel:(CNBindingManageModel *)model{
  37 +- (void)setModel:(CNLiveBindingManageModel *)model{
35 38 _model = model;
36 39 _icon.image = [UIImage imageNamed:model.image];
37 40 _title.text = model.title;
... ... @@ -160,7 +163,7 @@ static NSInteger const margin = 15;
160 163 return;
161 164 }
162 165 if(![CNLiveNetworking isNetworking]){
163   - [QMUITips showError:@"无法连接网络" inView:AppKeyWindow hideAfterDelay:1.5];
  166 + [QMUITips showError:@"无法连接网络" inView:([UIApplication sharedApplication].delegate).window hideAfterDelay:1.5];
164 167 return ;
165 168 }
166 169 btn.userInteractionEnabled = NO;
... ...
CNLiveLoginModule/Classes/BindingManage/CNLiveBindingManageController.m
... ... @@ -8,6 +8,7 @@
8 8  
9 9 #import "CNLiveBindingManageController.h"
10 10 #import <Masonry/Masonry.h>
  11 +#import "CNLiveBaseKit.h"
11 12  
12 13 #import "CNLiveBindingManageHeaderView.h"
13 14 #import "CNLiveBindingManageCell.h"
... ... @@ -50,38 +51,38 @@
50 51  
51 52 }
52 53 - (void)requestBindingManage:(CNLiveBindingManageModel *)model{
53   - switch (model.type) {
54   - case CNLiveSendAuthRespWX:
55   - {
56   - if(![WXApi isWXAppInstalled]){
57   - [QMUITips showWithText:@"未安装微信" inView:self.view hideAfterDelay:1.5];
58   - return;
59   - }
60   - }
61   - break;
62   - case CNLiveSendAuthRespQQ:
63   - {
64   - if(![TencentOAuth iphoneQQInstalled]){
65   - [QMUITips showWithText:@"未安装QQ" inView:self.view hideAfterDelay:1.5];
66   - return;
67   - }
68   - }
69   - break;
70   - case CNLiveSendAuthRespWB:
71   - {
72   - if(![WeiboSDK isWeiboAppInstalled]){
73   - [QMUITips showWithText:@"未安装微博" inView:self.view hideAfterDelay:1.5];
74   - return;
75   - }
76   - }
77   - break;
78   - case CNLiveSendAuthRespApple:
79   - {
80   - }
81   - break;
82   - }
  54 +// switch (model.type) {
  55 +// case CNLiveSendAuthRespWX:
  56 +// {
  57 +// if(![WXApi isWXAppInstalled]){
  58 +// [QMUITips showWithText:@"未安装微信" inView:self.view hideAfterDelay:1.5];
  59 +// return;
  60 +// }
  61 +// }
  62 +// break;
  63 +// case CNLiveSendAuthRespQQ:
  64 +// {
  65 +// if(![TencentOAuth iphoneQQInstalled]){
  66 +// [QMUITips showWithText:@"未安装QQ" inView:self.view hideAfterDelay:1.5];
  67 +// return;
  68 +// }
  69 +// }
  70 +// break;
  71 +// case CNLiveSendAuthRespWB:
  72 +// {
  73 +// if(![WeiboSDK isWeiboAppInstalled]){
  74 +// [QMUITips showWithText:@"未安装微博" inView:self.view hideAfterDelay:1.5];
  75 +// return;
  76 +// }
  77 +// }
  78 +// break;
  79 +// case CNLiveSendAuthRespApple:
  80 +// {
  81 +// }
  82 +// break;
  83 +// }
83 84 __weak typeof(self) weakSelf = self;
84   - [CNLiveBindingManageRequest requestModel:model block:^(BOOL isSuccess, CNBindingManageModel * _Nullable model, BOOL isBinding) {
  85 + [CNLiveBindingManageRequest requestModel:model block:^(BOOL isSuccess, CNLiveBindingManageModel * _Nullable model, BOOL isBinding) {
85 86 __strong typeof(weakSelf) strongSelf = weakSelf;
86 87 if(!strongSelf) return;
87 88 if(isSuccess){
... ... @@ -161,7 +162,7 @@
161 162 }
162 163  
163 164 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
164   - CNBindingManageCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNBindingManageCell forIndexPath:indexPath];
  165 + CNLiveBindingManageCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBindingManageCell forIndexPath:indexPath];
165 166 cell.selectionStyle = UITableViewCellSelectionStyleNone;
166 167 cell.delegate = self;
167 168 if(indexPath.section == 0){
... ... @@ -189,7 +190,7 @@
189 190  
190 191 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
191 192 NSArray *array = @[@"您已绑定网家家手机号账号", @"其他绑定方式"];
192   - CNBindingManageHeaderView *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:kCNBindingManageHeaderView];
  193 + CNLiveBindingManageHeaderView *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:kCNLiveBindingManageHeaderView];
193 194 header.text = array[section];
194 195 return header;
195 196  
... ... @@ -223,8 +224,8 @@
223 224 _tableView.estimatedRowHeight = 0;
224 225 _tableView.estimatedSectionFooterHeight = 0;
225 226 _tableView.estimatedSectionHeaderHeight = 0;
226   - [_tableView registerClass:[CNBindingManageCell class] forCellReuseIdentifier:kCNBindingManageCell];
227   - [_tableView registerClass:[CNBindingManageHeaderView class] forHeaderFooterViewReuseIdentifier:kCNBindingManageHeaderView];
  227 + [_tableView registerClass:[CNLiveBindingManageCell class] forCellReuseIdentifier:kCNLiveBindingManageCell];
  228 + [_tableView registerClass:[CNLiveBindingManageHeaderView class] forHeaderFooterViewReuseIdentifier:kCNLiveBindingManageHeaderView];
228 229  
229 230 }
230 231 return _tableView;
... ...
CNLiveLoginModule/Classes/BindingManage/CNLiveBindingManageHeaderView.m
... ... @@ -19,7 +19,7 @@ static NSInteger const margin = 15;
19 19 - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
20 20 if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
21 21 //在这里向contentView添加控件
22   - self.backgroundColor = RGBOF(0xf4f4f4);
  22 + self.backgroundColor = [UIColor colorWithRed:244/255.0 green:244/255.0 blue:244/255.0 alpha:1.0];
23 23 [self createSubviews];
24 24 [self xw_layoutSubviews];
25 25  
... ... @@ -60,8 +60,8 @@ static NSInteger const margin = 15;
60 60 - (UILabel *)title {
61 61 if (!_title) {
62 62 _title = [[UILabel alloc] init];
63   - _title.textColor = RGBOF(0x999999);
64   - _title.font = UIFontCNMake(14);
  63 + _title.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
  64 + _title.font = [UIFont systemFontOfSize:14];
65 65 _title.numberOfLines = 0;
66 66 }
67 67 return _title;
... ...
CNLiveLoginModule/Classes/BindingManage/CNLiveBindingManageModel.h
... ... @@ -7,7 +7,7 @@
7 7 //
8 8  
9 9 #import <Foundation/Foundation.h>
10   -#import "CNLiveShareImageManager.h"
  10 +//#import "CNLiveShareImageManager.h"
11 11  
12 12 NS_ASSUME_NONNULL_BEGIN
13 13  
... ... @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
19 19  
20 20 @property (nonatomic, copy) NSString *thirdPartyPlat;
21 21 @property (nonatomic, copy) NSString *thirdPartyId;
22   -@property (nonatomic, assign) CNLiveSendAuthResp type;
  22 +//@property (nonatomic, assign) CNLiveSendAuthResp type;
23 23  
24 24  
25 25 @end
... ...
CNLiveLoginModule/Classes/BindingManage/CNLiveBindingManageModel.m
... ... @@ -9,24 +9,24 @@
9 9 #import "CNLiveBindingManageModel.h"
10 10  
11 11 @implementation CNLiveBindingManageModel
12   -- (CNLiveSendAuthResp)type{
13   - CNLiveSendAuthResp type = CNLiveSendAuthRespWX;
14   -
15   - if([self.thirdPartyPlat isEqualToString:@"1"]){
16   - type = CNLiveSendAuthRespWB;
17   -
18   - }else if ([self.thirdPartyPlat isEqualToString:@"2"]){
19   - type = CNLiveSendAuthRespQQ;
20   -
21   - }else if([self.thirdPartyPlat isEqualToString:@"3"]){
22   - type = CNLiveSendAuthRespWX;
23   -
24   - }else if([self.thirdPartyPlat isEqualToString:@"5"]){
25   - type = CNLiveSendAuthRespApple;
26   -
27   - }
28   - return type;
29   -
30   -}
  12 +//- (CNLiveSendAuthResp)type{
  13 +// CNLiveSendAuthResp type = CNLiveSendAuthRespWX;
  14 +//
  15 +// if([self.thirdPartyPlat isEqualToString:@"1"]){
  16 +// type = CNLiveSendAuthRespWB;
  17 +//
  18 +// }else if ([self.thirdPartyPlat isEqualToString:@"2"]){
  19 +// type = CNLiveSendAuthRespQQ;
  20 +//
  21 +// }else if([self.thirdPartyPlat isEqualToString:@"3"]){
  22 +// type = CNLiveSendAuthRespWX;
  23 +//
  24 +// }else if([self.thirdPartyPlat isEqualToString:@"5"]){
  25 +// type = CNLiveSendAuthRespApple;
  26 +//
  27 +// }
  28 +// return type;
  29 +//
  30 +//}
31 31  
32 32 @end
... ...
CNLiveLoginModule/Classes/BindingManage/CNLiveBindingManageRequest.h
... ... @@ -7,10 +7,10 @@
7 7 //
8 8  
9 9 #import <Foundation/Foundation.h>
10   -#import "CNLiveShareImageManager.h"
  10 +//#import "CNLiveShareImageManager.h"
11 11  
12 12 NS_ASSUME_NONNULL_BEGIN
13   -@class CNBindingManageModel;
  13 +@class CNLiveBindingManageModel;
14 14 @class CNThreeLoginModel;
15 15  
16 16 typedef void (^CNLiveBindingResponseBlock)(BOOL isSuccess, CNLiveBindingManageModel * _Nullable model, BOOL isBinding);
... ... @@ -40,7 +40,7 @@ typedef void (^CNLiveLoginResponseBlock)(NSURLSessionTask *requestTask, id respo
40 40 * @param model 模型
41 41 * @param block 回调
42 42 */
43   -+ (void)thirdPartyLoginWithType:(CNLiveSendAuthResp)type model:(CNThreeLoginModel *)model block:(CNLoginResponseBlock)block;
  43 +//+ (void)thirdPartyLoginWithType:(CNLiveSendAuthResp)type model:(CNThreeLoginModel *)model block:(CNLoginResponseBlock)block;
44 44  
45 45 @end
46 46  
... ...
CNLiveLoginModule/Classes/BindingManage/CNLiveBindingManageRequest.m
... ... @@ -7,124 +7,129 @@
7 7 //
8 8  
9 9 #import "CNLiveBindingManageRequest.h"
  10 +#import "QMUIKit.h"
  11 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
  12 +#import "CNUserInfoManager.h"
  13 +
10 14 #import "CNLiveBindingManageModel.h"
11   -#import "CNThreeLoginModel.h"
12   -#import "CNLiveShareImageManager.h"
  15 +
  16 +//#import "CNThreeLoginModel.h"
  17 +//#import "CNLiveShareImageManager.h"
13 18  
14 19 @implementation CNLiveBindingManageRequest
15 20 + (void)requestModel:(CNLiveBindingManageModel *)model block:(CNLiveBindingResponseBlock)block{
16 21 if([model.isBinding isEqualToString:@"1"]){
17 22 //解除绑定操作
18   - [CNLiveBindingManageRequest requestUnBindingModel:model block:^(BOOL isSuccess, CNBindingManageModel * _Nullable model, BOOL isBinding) {
  23 + [CNLiveBindingManageRequest requestUnBindingModel:model block:^(BOOL isSuccess, CNLiveBindingManageModel * _Nullable model, BOOL isBinding) {
19 24 block?block(isSuccess, model, isBinding):@"";
20 25 }];
21 26 }
22 27 else{
23 28 //绑定操作
24   - [CNLiveBindingManageRequest requestBindingModel:model block:^(BOOL isSuccess, CNBindingManageModel * _Nullable model, BOOL isBinding) {
  29 + [CNLiveBindingManageRequest requestBindingModel:model block:^(BOOL isSuccess, CNLiveBindingManageModel * _Nullable model, BOOL isBinding) {
25 30 block?block(isSuccess, model, isBinding):@"";
26 31 }];
27 32 }
28 33 }
29 34  
30 35 //绑定操作
31   -+ (void)requestBindingModel:(CNLiveBindingManageModel *)model block:(CNBindingResponseBlock)block{
  36 ++ (void)requestBindingModel:(CNLiveBindingManageModel *)model block:(CNLiveBindingResponseBlock)block{
32 37 __weak typeof(self) weakSelf = self;
33 38 // 获取第三方id
34   - [CNLiveShareImageManager send:model.type authRespBlock:^(CNLiveSendAuthResp type, CNLiveThirdPartyModel *userInfo, NSError *error) {
35   - __strong typeof(weakSelf) strongSelf = weakSelf;
36   - if(!strongSelf) return;
37   - if(error){
38   - if(error.code == 10000){
39   - //用户取消
40   - }else{
41   - [QMUITips showWithText:@"绑定失败" inView:AppKeyWindow hideAfterDelay:1.5];
42   - }
43   - return ;
44   - }
45   - if(userInfo.thirdPartyId&&![userInfo.thirdPartyId isEqualToString:@""]){
46   - // 发起绑定请求
47   - model.thirdPartyId = userInfo.thirdPartyId;
48   - [strongSelf sendBindingModel:model block:block];
49   -
50   - }else{
51   - [QMUITips showWithText:@"绑定失败" inView:AppKeyWindow hideAfterDelay:1.5];
52   -
53   - }
54   -
55   - }];
  39 +// [CNLiveShareImageManager send:model.type authRespBlock:^(CNLiveSendAuthResp type, CNLiveThirdPartyModel *userInfo, NSError *error) {
  40 +// __strong typeof(weakSelf) strongSelf = weakSelf;
  41 +// if(!strongSelf) return;
  42 +// if(error){
  43 +// if(error.code == 10000){
  44 +// //用户取消
  45 +// }else{
  46 +// [QMUITips showWithText:@"绑定失败" inView:AppKeyWindow hideAfterDelay:1.5];
  47 +// }
  48 +// return ;
  49 +// }
  50 +// if(userInfo.thirdPartyId&&![userInfo.thirdPartyId isEqualToString:@""]){
  51 +// // 发起绑定请求
  52 +// model.thirdPartyId = userInfo.thirdPartyId;
  53 +// [strongSelf sendBindingModel:model block:block];
  54 +//
  55 +// }else{
  56 +// [QMUITips showWithText:@"绑定失败" inView:AppKeyWindow hideAfterDelay:1.5];
  57 +//
  58 +// }
  59 +//
  60 +// }];
56 61  
57 62 }
58 63  
59   -+ (void)sendBindingModel:(CNBindingManageModel *)model block:(CNBindingResponseBlock)block{
60   - NSDictionary *params = @{
61   - @"uid":CNUserShareModel.uid?CNUserShareModel.uid:@"",
62   - @"thirdPartyPlat":model.thirdPartyPlat?model.thirdPartyPlat:@"",
63   - @"thirdPartyId":model.thirdPartyId?model.thirdPartyId:@"",
64   - @"token":CNUserShareModel.token?CNUserShareModel.token:@"",
65   - @"clientPlat":@"i"};
66   - [CNLiveNetworking setAllowRequestDefaultArgument:YES];
67   - [CNLiveNetworking setupShowDataResult:NO];
68   -
69   - __weak typeof(self) weakSelf = self;
70   - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNLoginBind3rdUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
71   - __strong typeof(weakSelf) strongSelf = weakSelf;
72   - if(!strongSelf) return;
73   -
74   - if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) {
75   - //绑定,并更新本地数据
76   - CNBindingManageModel *bindingModel = [strongSelf updateBindingModel:model isBinding:@"1"];
77   - block?block(YES, bindingModel, YES):@"";
78   - }
79   - else if([responseObject isKindOfClass:[NSDictionary class]]) {
80   - [QMUITips showWithText:responseObject[@"errorMessage"] inView:AppKeyWindow hideAfterDelay:1.5];
81   - block?block(NO, nil, NO):@"";
82   - }
83   - else{
84   - [QMUITips showWithText:@"绑定失败" inView:AppKeyWindow hideAfterDelay:1.5];
85   - block?block(NO, nil, NO):@"";
86   - }
87   -
88   - }];
  64 ++ (void)sendBindingModel:(CNLiveBindingManageModel *)model block:(CNLiveBindingResponseBlock)block{
  65 +// NSDictionary *params = @{
  66 +// @"uid":CNUserShareModel.uid?CNUserShareModel.uid:@"",
  67 +// @"thirdPartyPlat":model.thirdPartyPlat?model.thirdPartyPlat:@"",
  68 +// @"thirdPartyId":model.thirdPartyId?model.thirdPartyId:@"",
  69 +// @"token":CNUserShareModel.token?CNUserShareModel.token:@"",
  70 +// @"clientPlat":@"i"};
  71 +// [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  72 +// [CNLiveNetworking setupShowDataResult:NO];
  73 +//
  74 +// __weak typeof(self) weakSelf = self;
  75 +// [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNLoginBind3rdUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  76 +// __strong typeof(weakSelf) strongSelf = weakSelf;
  77 +// if(!strongSelf) return;
  78 +//
  79 +// if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) {
  80 +// //绑定,并更新本地数据
  81 +// CNBindingManageModel *bindingModel = [strongSelf updateBindingModel:model isBinding:@"1"];
  82 +// block?block(YES, bindingModel, YES):@"";
  83 +// }
  84 +// else if([responseObject isKindOfClass:[NSDictionary class]]) {
  85 +// [QMUITips showWithText:responseObject[@"errorMessage"] inView:AppKeyWindow hideAfterDelay:1.5];
  86 +// block?block(NO, nil, NO):@"";
  87 +// }
  88 +// else{
  89 +// [QMUITips showWithText:@"绑定失败" inView:AppKeyWindow hideAfterDelay:1.5];
  90 +// block?block(NO, nil, NO):@"";
  91 +// }
  92 +//
  93 +// }];
89 94 }
90 95  
91 96 //解除绑定操作
92   -+ (void)requestUnBindingModel:(CNBindingManageModel *)model block:(CNBindingResponseBlock)block{
93   - NSDictionary *params = @{
94   - @"uid":CNUserShareModel.uid?CNUserShareModel.uid:@"",
95   - @"thirdPartyPlat":model.thirdPartyPlat?model.thirdPartyPlat:@"",
96   - @"thirdPartyId":model.thirdPartyId?model.thirdPartyId:@"",
97   - @"token":CNUserShareModel.token?CNUserShareModel.token:@"",
98   - @"clientPlat":@"i"};
99   -
100   - [CNLiveNetworking setAllowRequestDefaultArgument:YES];
101   - [CNLiveNetworking setupShowDataResult:NO];
102   -
103   - __weak typeof(self) weakSelf = self;
104   - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNLoginUnBind3rdUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
105   - __strong typeof(weakSelf) strongSelf = weakSelf;
106   - if(!strongSelf) return;
107   -
108   - if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) {
109   - //解除绑定,并更新本地数据
110   - CNBindingManageModel *unbindingModel = [strongSelf updateBindingModel:model isBinding:@"0"];
111   - block?block(YES, unbindingModel, NO):@"";
112   - }
113   - else if ([responseObject isKindOfClass:[NSDictionary class]]) {
114   - [QMUITips showWithText:responseObject[@"errorMessage"] inView:AppKeyWindow hideAfterDelay:1.5];
115   - block?block(NO, nil, NO):@"";
116   - }
117   - else{
118   - [QMUITips showWithText:@"解除绑定失败" inView:AppKeyWindow hideAfterDelay:1.5];
119   - block?block(NO, nil, NO):@"";
120   - }
121   -
122   - }];
  97 ++ (void)requestUnBindingModel:(CNLiveBindingManageModel *)model block:(CNLiveBindingResponseBlock)block{
  98 +// NSDictionary *params = @{
  99 +// @"uid":CNUserShareModel.uid?CNUserShareModel.uid:@"",
  100 +// @"thirdPartyPlat":model.thirdPartyPlat?model.thirdPartyPlat:@"",
  101 +// @"thirdPartyId":model.thirdPartyId?model.thirdPartyId:@"",
  102 +// @"token":CNUserShareModel.token?CNUserShareModel.token:@"",
  103 +// @"clientPlat":@"i"};
  104 +//
  105 +// [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  106 +// [CNLiveNetworking setupShowDataResult:NO];
  107 +//
  108 +// __weak typeof(self) weakSelf = self;
  109 +// [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNLoginUnBind3rdUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  110 +// __strong typeof(weakSelf) strongSelf = weakSelf;
  111 +// if(!strongSelf) return;
  112 +//
  113 +// if ([responseObject isKindOfClass:[NSDictionary class]] && [responseObject[@"errorCode"] isEqualToString:@"0"]) {
  114 +// //解除绑定,并更新本地数据
  115 +// CNBindingManageModel *unbindingModel = [strongSelf updateBindingModel:model isBinding:@"0"];
  116 +// block?block(YES, unbindingModel, NO):@"";
  117 +// }
  118 +// else if ([responseObject isKindOfClass:[NSDictionary class]]) {
  119 +// [QMUITips showWithText:responseObject[@"errorMessage"] inView:AppKeyWindow hideAfterDelay:1.5];
  120 +// block?block(NO, nil, NO):@"";
  121 +// }
  122 +// else{
  123 +// [QMUITips showWithText:@"解除绑定失败" inView:AppKeyWindow hideAfterDelay:1.5];
  124 +// block?block(NO, nil, NO):@"";
  125 +// }
  126 +//
  127 +// }];
123 128  
124 129 }
125 130  
126 131 //改变绑定数据
127   -+ (CNBindingManageModel *)updateBindingModel:(CNBindingManageModel *)model isBinding:(NSString *)isBinding{
  132 ++ (CNLiveBindingManageModel *)updateBindingModel:(CNLiveBindingManageModel *)model isBinding:(NSString *)isBinding{
128 133 if([isBinding isEqualToString:@"0"]){
129 134 //解除绑定
130 135 model.isBinding = @"0";
... ... @@ -148,7 +153,7 @@
148 153 CNUserShareModel.appleUid = @"";
149 154  
150 155 }
151   - [QMUITips showWithText:@"解除绑定成功" inView:AppKeyWindow hideAfterDelay:1.5];
  156 + [QMUITips showWithText:@"解除绑定成功" inView:([UIApplication sharedApplication].delegate).window hideAfterDelay:1.5];
152 157 return model;
153 158 }
154 159 else if ([isBinding isEqualToString:@"1"]){
... ... @@ -174,7 +179,7 @@
174 179 CNUserShareModel.appleUid = model.thirdPartyId;
175 180  
176 181 }
177   - [QMUITips showWithText:@"绑定成功" inView:AppKeyWindow hideAfterDelay:1.5];
  182 + [QMUITips showWithText:@"绑定成功" inView:([UIApplication sharedApplication].delegate).window hideAfterDelay:1.5];
178 183 return model;
179 184  
180 185 }
... ... @@ -183,10 +188,10 @@
183 188 }
184 189  
185 190 //请求绑定数据
186   -+ (void)requestModels:(CNBindingArrayBlock)block{
  191 ++ (void)requestModels:(CNLiveBindingArrayBlock)block{
187 192 NSMutableArray *bindingData = [[NSMutableArray alloc] init];
188 193 NSMutableArray *unBindingData = [[NSMutableArray alloc] init];
189   - CNBindingManageModel *tmodel = [[CNBindingManageModel alloc]init];
  194 + CNLiveBindingManageModel *tmodel = [[CNLiveBindingManageModel alloc]init];
190 195 tmodel.title = @"手机号";
191 196 tmodel.image = @"login_telephone";
192 197 NSString *mobile = [CNUserShareModel.mobile stringByReplacingCharactersInRange:NSMakeRange(3, 4) withString:@"****"];
... ... @@ -196,7 +201,7 @@
196 201 tmodel.thirdPartyId = CNUserShareModel.uid;
197 202 [bindingData addObject:tmodel];
198 203  
199   - CNBindingManageModel *wmodel = [[CNBindingManageModel alloc]init];
  204 + CNLiveBindingManageModel *wmodel = [[CNLiveBindingManageModel alloc]init];
200 205 wmodel.title = @"微信";
201 206 wmodel.image = @"login_wechat";
202 207 wmodel.thirdPartyPlat = @"3";
... ... @@ -211,7 +216,7 @@
211 216 }
212 217 [unBindingData addObject:wmodel];
213 218  
214   - CNBindingManageModel *qmodel = [[CNBindingManageModel alloc]init];
  219 + CNLiveBindingManageModel *qmodel = [[CNLiveBindingManageModel alloc]init];
215 220 qmodel.title = @"QQ";
216 221 qmodel.image = @"login_qq";
217 222 qmodel.thirdPartyPlat = @"2";
... ... @@ -225,7 +230,7 @@
225 230 }
226 231 [unBindingData addObject:qmodel];
227 232  
228   - CNBindingManageModel *smodel = [[CNBindingManageModel alloc]init];
  233 + CNLiveBindingManageModel *smodel = [[CNLiveBindingManageModel alloc]init];
229 234 smodel.title = @"微博";
230 235 smodel.image = @"login_weibo";
231 236 smodel.thirdPartyPlat = @"1";
... ... @@ -239,7 +244,7 @@
239 244 }
240 245 [unBindingData addObject:smodel];
241 246  
242   - CNBindingManageModel *amodel = [[CNBindingManageModel alloc]init];
  247 + CNLiveBindingManageModel *amodel = [[CNLiveBindingManageModel alloc]init];
243 248 amodel.title = @"苹果账号";
244 249 amodel.image = @"login_apple_icon";
245 250 amodel.thirdPartyPlat = @"5";
... ... @@ -257,20 +262,20 @@
257 262 }
258 263  
259 264 //三方登录
260   -+ (void)thirdPartyLoginWithType:(CNLiveSendAuthResp)type model:(CNThreeLoginModel *)model block:(CNLoginResponseBlock)block{
261   - NSDictionary *params = @{@"thirdPartyPlat":model.thirdPartyPlat?model.thirdPartyPlat:@"",
262   - @"thirdPartyId":model.thirdPartyId?model.thirdPartyId:@"",
263   - @"frmId":model.frmId?model.frmId:@"",
264   - @"clientPlat":@"i"};
265   - [CNLiveNetworking setAllowRequestDefaultArgument:YES];
266   - [CNLiveNetworking setupShowDataResult:NO];
267   -
268   - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNLoginIn3rdForWJJUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
269   - block?block(requestTask, responseObject, error):@"";
270   -
271   - }];
272   -
273   -
274   -}
  265 +//+ (void)thirdPartyLoginWithType:(CNLiveSendAuthResp)type model:(CNThreeLoginModel *)model block:(CNLoginResponseBlock)block{
  266 +// NSDictionary *params = @{@"thirdPartyPlat":model.thirdPartyPlat?model.thirdPartyPlat:@"",
  267 +// @"thirdPartyId":model.thirdPartyId?model.thirdPartyId:@"",
  268 +// @"frmId":model.frmId?model.frmId:@"",
  269 +// @"clientPlat":@"i"};
  270 +// [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  271 +// [CNLiveNetworking setupShowDataResult:NO];
  272 +//
  273 +// [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNLoginIn3rdForWJJUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  274 +// block?block(requestTask, responseObject, error):@"";
  275 +//
  276 +// }];
  277 +//
  278 +//
  279 +//}
275 280  
276 281 @end
... ...
CNLiveLoginModule/Classes/Controller/CNLiveLoginController.m
... ... @@ -15,6 +15,7 @@
15 15 #import "CNLiveUserAgreementManager.h"
16 16 #import "CNLiveCategory.h"
17 17 #import "CNUserInfoManager.h"
  18 +#import "CNLiveEnvironment.h"
18 19  
19 20 #import "CNLiveLoginView.h"
20 21 #import "CNLiveThreeLoginView.h"
... ... @@ -66,11 +67,12 @@
66 67 text.color = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0];
67 68 text.font = [UIFont systemFontOfSize:14.0];
68 69 __weak typeof(self) weakSelf = self;
69   - [text setTextHighlightRange:NSMakeRange(11, 4) color:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0] backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
  70 + UIColor *color = Business?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0];
  71 + [text setTextHighlightRange:NSMakeRange(11, 4) color:color backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
70 72 [weakSelf.view endEditing:YES];
71 73 [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementUser];
72 74 }];
73   - [text setTextHighlightRange:NSMakeRange(text.length-5, 4) color:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0] backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
  75 + [text setTextHighlightRange:NSMakeRange(text.length-5, 4) color:color backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
74 76 [weakSelf.view endEditing:YES];
75 77 [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementPrivacy];
76 78 }];
... ...
CNLiveLoginModule/Classes/ThreeLogin/CNLiveBindingTelController.m
... ... @@ -11,6 +11,8 @@
11 11 #import "YYKit.h"
12 12 #import "NSAttributedString+YYText.h"
13 13 #import "QMUIKit.h"
  14 +#import "CNLiveEnvironment.h"
  15 +#import "CNLiveUserAgreementManager.h"
14 16  
15 17 #import "CNLiveNavigationBar.h"
16 18 #import "CNLiveBindingTelView.h"
... ... @@ -109,11 +111,12 @@
109 111 text.color = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0];
110 112 text.font = [UIFont systemFontOfSize:14.0];
111 113 __weak typeof(self) weakSelf = self;
112   - [text setTextHighlightRange:NSMakeRange(7, 12) color:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0] backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
  114 + UIColor *color = Business?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0];
  115 + [text setTextHighlightRange:NSMakeRange(7, 12) color:color backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
113 116 __strong typeof(weakSelf) strongSelf = weakSelf;
114 117 if(!strongSelf) return;
115 118 [strongSelf.view endEditing:YES];
116   - // [XWAgreementManager jumpToAgreementH5WithType:XWAgreementTypeBindingLogin];
  119 + [CNLiveUserAgreementManager jumpToAgreementH5WithType:CNLiveUserAgreementUser];
117 120  
118 121 }];
119 122 _protocol.attributedText = text;
... ...
CNLiveLoginModule/Classes/ThreeLogin/CNLiveBindingTelView.m
... ... @@ -10,6 +10,7 @@
10 10 #import "YYKit.h"
11 11 #import "QMUIKit.h"
12 12 #import "CNLiveCategory.h"
  13 +#import "CNLiveEnvironment.h"
13 14  
14 15 #import "CNLiveLoginCountryView.h"
15 16 #import "CNLiveLoginTextField.h"
... ... @@ -79,7 +80,7 @@ static const NSInteger timeValue = 1.5;
79 80 countDown.dataSource = self;
80 81 countDown.delegate = self;
81 82 countDown.frame = CGRectMake(frame.size.width-80, account.bottom+space+10, 80, rowHeight-10);
82   - UIImage *image2 = [self getImageWithImageName:@"login_get_code" bundleName:@"CNLiveLoginModule" targetClass:[self class]];
  83 + UIImage *image2 = [self getImageWithImageName:Business?@"login_get_code_b":@"login_get_code" bundleName:@"CNLiveLoginModule" targetClass:[self class]];
83 84 [countDown setImage:image2 forState:UIControlStateNormal];
84 85 countDown.adjustsImageWhenHighlighted = NO;
85 86 [countDown setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
... ... @@ -94,7 +95,8 @@ static const NSInteger timeValue = 1.5;
94 95 [binding setTitle:@"确认手机绑定并同意协议" forState:UIControlStateNormal];
95 96 [binding setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
96 97 binding.titleLabel.font = [UIFont systemFontOfSize:15.0];
97   - binding.backgroundColor = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0];
  98 + UIColor *color = Business?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0];
  99 + binding.backgroundColor = color;
98 100 binding.layer.cornerRadius = 20;
99 101 binding.layer.masksToBounds = YES;
100 102 binding.adjustsImageWhenHighlighted = NO;
... ... @@ -108,7 +110,6 @@ static const NSInteger timeValue = 1.5;
108 110 - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
109 111 if ([textField isEqual:_account] || [textField isEqual:_code]) {
110 112 return YES;
111   -
112 113 }
113 114 else {
114 115 return YES;
... ...
CNLiveLoginModule/Classes/ThreeLogin/CNLiveThreeLoginView.h
... ... @@ -7,13 +7,13 @@
7 7 //
8 8  
9 9 #import <UIKit/UIKit.h>
10   -#import "CNLiveShareImageManager.h"
  10 +//#import "CNLiveShareImageManager.h"
11 11  
12 12 NS_ASSUME_NONNULL_BEGIN
13 13  
14 14 @class CNLiveThreeLoginView;
15 15 @protocol CNLiveThreeLoginViewDelegate <NSObject>
16   -- (void)clickedButton:(CNLiveThreeLoginView *)view type:(CNLiveSendAuthResp)type;
  16 +//- (void)clickedButton:(CNLiveThreeLoginView *)view type:(CNLiveSendAuthResp)type;
17 17  
18 18 @end
19 19 @interface CNLiveThreeLoginView : UIView
... ...
CNLiveLoginModule/Classes/ThreeLogin/CNLiveThreeLoginView.m
... ... @@ -9,106 +9,106 @@
9 9 #import "CNLiveThreeLoginView.h"
10 10 #import "YYKit.h"
11 11 #import "CNLiveCategory.h"
12   -#import "CNLiveShareManager.h"
13   -#import "WXApi.h"
  12 +//#import "CNLiveShareManager.h"
  13 +//#import "WXApi.h"
14 14  
15 15 @interface CNLiveThreeLoginView()
16 16  
17 17 @end
18 18 @implementation CNLiveThreeLoginView
19 19 static NSInteger const rowHeight = 60;
20   -- (instancetype)initWithFrame:(CGRect)frame{
21   - self = [super initWithFrame:frame];
22   - if (self) {
23   - [self createSubviews:frame];
24   -
25   - }
26   - return self;
27   -
28   -}
29   -- (void)createSubviews:(CGRect)frame{
30   - CGFloat width = frame.size.width;
31   - CGFloat nameWidth = width/3.0;
32   - CGFloat lineLeft = 15;
33   - CGFloat lineWidth = nameWidth - lineLeft*2;
34   -
35   - UIView *leftLine = [[UIView alloc] initWithFrame:CGRectMake(lineLeft, (rowHeight/3.0-1)/2.0, lineWidth, 1)];
36   - leftLine.backgroundColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0];
37   - [self addSubview:leftLine];
38   -
39   - UILabel *name = [[UILabel alloc] initWithFrame:CGRectMake(nameWidth, 0, nameWidth, rowHeight/3.0)];
40   - name.textColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0];
41   - name.font = [UIFont systemFontOfSize:14];
42   - name.textAlignment = NSTextAlignmentCenter;
43   - name.text = @"第三方账号登录";
44   - [self addSubview:name];
45   -
46   - UILabel *rightLine = [[UILabel alloc] initWithFrame:CGRectMake(name.right+15, leftLine.top, leftLine.width, 1)];
47   - rightLine.backgroundColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0];
48   - [self addSubview:rightLine];
49   -
50   - NSMutableArray *pics = [NSMutableArray arrayWithArray:@[@"login_qq",@"login_weibo"]];
51   - if([WXApi isWXAppInstalled]||[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"wechat://"]]){
52   - [pics insertObject:@"login_wechat" atIndex:0];
53   - }
54   - NSUInteger number = pics.count;
55   - if (@available(iOS 13, *)) {
56   - [pics addObject:@"login_apple"];
57   - number = pics.count + 1;
58   - }
59   - CGFloat btnWidth = width/number*1.0;
60   -
61   - for(int i = 0; i < pics.count; i++){
62   - UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
63   - btn.tag = 10000+i;
64   - btn.frame = CGRectMake(btnWidth*i, name.bottom, btnWidth, rowHeight);
65   - if (@available(iOS 13, *)) {
66   - if (i == pics.count-1) {
67   - btn.frame = CGRectMake(btnWidth*i, name.bottom, 2*btnWidth, rowHeight);
68   - }
69   - }
70   - UIImage *image = [self getImageWithImageName:pics[i] bundleName:@"CNLiveLoginModule" targetClass:[self class]];
71   - [btn setImage:image forState:UIControlStateNormal];
72   - btn.adjustsImageWhenHighlighted = NO;
73   - [btn addTarget:self action:@selector(btnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
74   - [self addSubview:btn];
75   -
76   - }
77   -
78   -}
79   -- (void)btnDidClicked:(UIButton *)btn{
80   - if([WXApi isWXAppInstalled]||[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"wechat://"]]){
81   - if (self.delegate && [self.delegate respondsToSelector:@selector(clickedButton:type:)]) {
82   - if(btn.tag == 10000){
83   - [self.delegate clickedButton:self type:CNLiveSendAuthRespWX];
84   -
85   - }else if (btn.tag == 10001){
86   - [self.delegate clickedButton:self type:CNLiveSendAuthRespQQ];
87   -
88   - }else if(btn.tag == 10002){
89   - [self.delegate clickedButton:self type:CNLiveSendAuthRespWB];
90   -
91   - }else if(btn.tag == 10003){
92   - [self.delegate clickedButton:self type:CNLiveSendAuthRespApple];
93   -
94   - }
95   - }
96   - }else{
97   - if (self.delegate && [self.delegate respondsToSelector:@selector(clickedButton:type:)]) {
98   - if(btn.tag == 10000){
99   - [self.delegate clickedButton:self type:CNLiveSendAuthRespQQ];
100   -
101   - }else if(btn.tag == 10001){
102   - [self.delegate clickedButton:self type:CNLiveSendAuthRespWB];
103   -
104   - }else if(btn.tag == 10002){
105   - [self.delegate clickedButton:self type:CNLiveSendAuthRespApple];
106   -
107   - }
108   - }
109   - }
110   -
111   -}
  20 +//- (instancetype)initWithFrame:(CGRect)frame{
  21 +// self = [super initWithFrame:frame];
  22 +// if (self) {
  23 +// [self createSubviews:frame];
  24 +//
  25 +// }
  26 +// return self;
  27 +//
  28 +//}
  29 +//- (void)createSubviews:(CGRect)frame{
  30 +// CGFloat width = frame.size.width;
  31 +// CGFloat nameWidth = width/3.0;
  32 +// CGFloat lineLeft = 15;
  33 +// CGFloat lineWidth = nameWidth - lineLeft*2;
  34 +//
  35 +// UIView *leftLine = [[UIView alloc] initWithFrame:CGRectMake(lineLeft, (rowHeight/3.0-1)/2.0, lineWidth, 1)];
  36 +// leftLine.backgroundColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0];
  37 +// [self addSubview:leftLine];
  38 +//
  39 +// UILabel *name = [[UILabel alloc] initWithFrame:CGRectMake(nameWidth, 0, nameWidth, rowHeight/3.0)];
  40 +// name.textColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0];
  41 +// name.font = [UIFont systemFontOfSize:14];
  42 +// name.textAlignment = NSTextAlignmentCenter;
  43 +// name.text = @"第三方账号登录";
  44 +// [self addSubview:name];
  45 +//
  46 +// UILabel *rightLine = [[UILabel alloc] initWithFrame:CGRectMake(name.right+15, leftLine.top, leftLine.width, 1)];
  47 +// rightLine.backgroundColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1.0];
  48 +// [self addSubview:rightLine];
  49 +//
  50 +// NSMutableArray *pics = [NSMutableArray arrayWithArray:@[@"login_qq",@"login_weibo"]];
  51 +// if([WXApi isWXAppInstalled]||[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"wechat://"]]){
  52 +// [pics insertObject:@"login_wechat" atIndex:0];
  53 +// }
  54 +// NSUInteger number = pics.count;
  55 +// if (@available(iOS 13, *)) {
  56 +// [pics addObject:@"login_apple"];
  57 +// number = pics.count + 1;
  58 +// }
  59 +// CGFloat btnWidth = width/number*1.0;
  60 +//
  61 +// for(int i = 0; i < pics.count; i++){
  62 +// UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  63 +// btn.tag = 10000+i;
  64 +// btn.frame = CGRectMake(btnWidth*i, name.bottom, btnWidth, rowHeight);
  65 +// if (@available(iOS 13, *)) {
  66 +// if (i == pics.count-1) {
  67 +// btn.frame = CGRectMake(btnWidth*i, name.bottom, 2*btnWidth, rowHeight);
  68 +// }
  69 +// }
  70 +// UIImage *image = [self getImageWithImageName:pics[i] bundleName:@"CNLiveLoginModule" targetClass:[self class]];
  71 +// [btn setImage:image forState:UIControlStateNormal];
  72 +// btn.adjustsImageWhenHighlighted = NO;
  73 +// [btn addTarget:self action:@selector(btnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
  74 +// [self addSubview:btn];
  75 +//
  76 +// }
  77 +//
  78 +//}
  79 +//- (void)btnDidClicked:(UIButton *)btn{
  80 +// if([WXApi isWXAppInstalled]||[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"wechat://"]]){
  81 +// if (self.delegate && [self.delegate respondsToSelector:@selector(clickedButton:type:)]) {
  82 +// if(btn.tag == 10000){
  83 +// [self.delegate clickedButton:self type:CNLiveSendAuthRespWX];
  84 +//
  85 +// }else if (btn.tag == 10001){
  86 +// [self.delegate clickedButton:self type:CNLiveSendAuthRespQQ];
  87 +//
  88 +// }else if(btn.tag == 10002){
  89 +// [self.delegate clickedButton:self type:CNLiveSendAuthRespWB];
  90 +//
  91 +// }else if(btn.tag == 10003){
  92 +// [self.delegate clickedButton:self type:CNLiveSendAuthRespApple];
  93 +//
  94 +// }
  95 +// }
  96 +// }else{
  97 +// if (self.delegate && [self.delegate respondsToSelector:@selector(clickedButton:type:)]) {
  98 +// if(btn.tag == 10000){
  99 +// [self.delegate clickedButton:self type:CNLiveSendAuthRespQQ];
  100 +//
  101 +// }else if(btn.tag == 10001){
  102 +// [self.delegate clickedButton:self type:CNLiveSendAuthRespWB];
  103 +//
  104 +// }else if(btn.tag == 10002){
  105 +// [self.delegate clickedButton:self type:CNLiveSendAuthRespApple];
  106 +//
  107 +// }
  108 +// }
  109 +// }
  110 +//
  111 +//}
112 112  
113 113 /*
114 114 // Only override drawRect: if you perform custom drawing.
... ...
CNLiveLoginModule/Classes/View/CNLiveLoginView.m
... ... @@ -63,7 +63,7 @@ static const NSInteger timeValue = 1.5;
63 63 }
64 64 - (void)createSubviews:(CGRect)frame{
65 65 UIImageView *logo = [[UIImageView alloc] initWithFrame:CGRectMake((frame.size.width-75)/2.0, 0, 75, 100)];
66   - UIImage *image = [self getImageWithImageName:@"login_logo" bundleName:@"CNLiveLoginModule" targetClass:[self class]];
  66 + UIImage *image = [self getImageWithImageName:Business?@"login_logo_b":@"login_logo" bundleName:@"CNLiveLoginModule" targetClass:[self class]];
67 67 logo.image = image;
68 68 [self addSubview:logo];
69 69 self.logo = logo;
... ... @@ -103,7 +103,7 @@ static const NSInteger timeValue = 1.5;
103 103 countDown.dataSource = self;
104 104 countDown.delegate = self;
105 105 countDown.frame = CGRectMake(frame.size.width-80, account.bottom+space+10, 80, rowHeight-10);
106   - UIImage *image2 = [self getImageWithImageName:@"login_get_code" bundleName:@"CNLiveLoginModule" targetClass:[self class]];
  106 + UIImage *image2 = [self getImageWithImageName:Business?@"login_get_code_b":@"login_get_code" bundleName:@"CNLiveLoginModule" targetClass:[self class]];
107 107 [countDown setImage:image2 forState:UIControlStateNormal];
108 108 countDown.adjustsImageWhenHighlighted = NO;
109 109 [countDown setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
... ... @@ -126,7 +126,8 @@ static const NSInteger timeValue = 1.5;
126 126 [login setTitle:@"登录" forState:UIControlStateNormal];
127 127 [login setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
128 128 login.titleLabel.font = [UIFont systemFontOfSize:15.0];
129   - login.backgroundColor = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0];
  129 + UIColor *color = Business?[UIColor colorWithRed:72/255.0 green:168/255.0 blue:249/255.0 alpha:1.0]:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0];
  130 + login.backgroundColor = color;
130 131 login.layer.cornerRadius = 20;
131 132 login.layer.masksToBounds = YES;
132 133 login.adjustsImageWhenHighlighted = NO;
... ...
Example/CNLiveLoginModule.xcodeproj/project.pbxproj
... ... @@ -7,7 +7,6 @@
7 7 objects = {
8 8  
9 9 /* Begin PBXBuildFile section */
10   - 189005ABD3FBFD70B45716F6 /* Pods_CNLiveLoginModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7C96919DD346F50DF8A1AAA /* Pods_CNLiveLoginModule_Tests.framework */; };
11 10 43B0A716F319E6A31EEE1337 /* Pods_CNLiveLoginModule_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F12ACEE9993DD0CAD05BA1B /* Pods_CNLiveLoginModule_Example.framework */; };
12 11 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
13 12 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
... ... @@ -38,7 +37,6 @@
38 37  
39 38 /* Begin PBXFileReference section */
40 39 11F04E11320E8360C5B3A0D7 /* Pods-CNLiveLoginModule_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveLoginModule_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveLoginModule_Example/Pods-CNLiveLoginModule_Example.release.xcconfig"; sourceTree = "<group>"; };
41   - 3457C6EFE3087351070CCD15 /* Pods-CNLiveLoginModule_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveLoginModule_Tests.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveLoginModule_Tests/Pods-CNLiveLoginModule_Tests.debug.xcconfig"; sourceTree = "<group>"; };
42 40 4B28CE499406DB37965D8485 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
43 41 6003F58A195388D20070C39A /* 登录模块.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "登录模块.app"; sourceTree = BUILT_PRODUCTS_DIR; };
44 42 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
... ... @@ -65,8 +63,6 @@
65 63 9F12ACEE9993DD0CAD05BA1B /* Pods_CNLiveLoginModule_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveLoginModule_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
66 64 A4A673B3F8A472F9BAB33C1C /* CNLiveLoginModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveLoginModule.podspec; path = ../CNLiveLoginModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
67 65 C494A15D22758133566EFE1A /* Pods-CNLiveLoginModule_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveLoginModule_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveLoginModule_Example/Pods-CNLiveLoginModule_Example.debug.xcconfig"; sourceTree = "<group>"; };
68   - E860C0C69E66BE81E9B35501 /* Pods-CNLiveLoginModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveLoginModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveLoginModule_Tests/Pods-CNLiveLoginModule_Tests.release.xcconfig"; sourceTree = "<group>"; };
69   - F7C96919DD346F50DF8A1AAA /* Pods_CNLiveLoginModule_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveLoginModule_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
70 66 /* End PBXFileReference section */
71 67  
72 68 /* Begin PBXFrameworksBuildPhase section */
... ... @@ -88,7 +84,6 @@
88 84 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
89 85 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
90 86 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
91   - 189005ABD3FBFD70B45716F6 /* Pods_CNLiveLoginModule_Tests.framework in Frameworks */,
92 87 );
93 88 runOnlyForDeploymentPostprocessing = 0;
94 89 };
... ... @@ -100,8 +95,6 @@
100 95 children = (
101 96 C494A15D22758133566EFE1A /* Pods-CNLiveLoginModule_Example.debug.xcconfig */,
102 97 11F04E11320E8360C5B3A0D7 /* Pods-CNLiveLoginModule_Example.release.xcconfig */,
103   - 3457C6EFE3087351070CCD15 /* Pods-CNLiveLoginModule_Tests.debug.xcconfig */,
104   - E860C0C69E66BE81E9B35501 /* Pods-CNLiveLoginModule_Tests.release.xcconfig */,
105 98 );
106 99 path = Pods;
107 100 sourceTree = "<group>";
... ... @@ -135,7 +128,6 @@
135 128 6003F591195388D20070C39A /* UIKit.framework */,
136 129 6003F5AF195388D20070C39A /* XCTest.framework */,
137 130 9F12ACEE9993DD0CAD05BA1B /* Pods_CNLiveLoginModule_Example.framework */,
138   - F7C96919DD346F50DF8A1AAA /* Pods_CNLiveLoginModule_Tests.framework */,
139 131 );
140 132 name = Frameworks;
141 133 sourceTree = "<group>";
... ... @@ -207,8 +199,8 @@
207 199 6003F586195388D20070C39A /* Sources */,
208 200 6003F587195388D20070C39A /* Frameworks */,
209 201 6003F588195388D20070C39A /* Resources */,
210   - 057461B17BCCE0389584B0ED /* [CP] Embed Pods Frameworks */,
211   - 2A7FDE4BAF3533B61B4D4BF2 /* [CP] Copy Pods Resources */,
  202 + 44B31241C1F55E9F61B32BA2 /* [CP] Embed Pods Frameworks */,
  203 + 00C9B333E974D90048CC8A26 /* [CP] Copy Pods Resources */,
212 204 );
213 205 buildRules = (
214 206 );
... ... @@ -223,7 +215,6 @@
223 215 isa = PBXNativeTarget;
224 216 buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CNLiveLoginModule_Tests" */;
225 217 buildPhases = (
226   - 479B71CB631FBB2745B895A0 /* [CP] Check Pods Manifest.lock */,
227 218 6003F5AA195388D20070C39A /* Sources */,
228 219 6003F5AB195388D20070C39A /* Frameworks */,
229 220 6003F5AC195388D20070C39A /* Resources */,
... ... @@ -299,7 +290,25 @@
299 290 /* End PBXResourcesBuildPhase section */
300 291  
301 292 /* Begin PBXShellScriptBuildPhase section */
302   - 057461B17BCCE0389584B0ED /* [CP] Embed Pods Frameworks */ = {
  293 + 00C9B333E974D90048CC8A26 /* [CP] Copy Pods Resources */ = {
  294 + isa = PBXShellScriptBuildPhase;
  295 + buildActionMask = 2147483647;
  296 + files = (
  297 + );
  298 + inputPaths = (
  299 + "${PODS_ROOT}/Target Support Files/Pods-CNLiveLoginModule_Example/Pods-CNLiveLoginModule_Example-resources.sh",
  300 + "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveLoginModule/CNLiveLoginModule.bundle",
  301 + );
  302 + name = "[CP] Copy Pods Resources";
  303 + outputPaths = (
  304 + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveLoginModule.bundle",
  305 + );
  306 + runOnlyForDeploymentPostprocessing = 0;
  307 + shellPath = /bin/sh;
  308 + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveLoginModule_Example/Pods-CNLiveLoginModule_Example-resources.sh\"\n";
  309 + showEnvVarsInLog = 0;
  310 + };
  311 + 44B31241C1F55E9F61B32BA2 /* [CP] Embed Pods Frameworks */ = {
303 312 isa = PBXShellScriptBuildPhase;
304 313 buildActionMask = 2147483647;
305 314 files = (
... ... @@ -312,6 +321,7 @@
312 321 "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework",
313 322 "${BUILT_PRODUCTS_DIR}/CNLiveBaseTools/CNLiveBaseTools.framework",
314 323 "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework",
  324 + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessBaseModule/CNLiveBusinessBaseModule.framework",
315 325 "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework",
316 326 "${BUILT_PRODUCTS_DIR}/CNLiveCacheManagerKit/CNLiveCacheManagerKit.framework",
317 327 "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework",
... ... @@ -346,6 +356,7 @@
346 356 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework",
347 357 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseTools.framework",
348 358 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework",
  359 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessBaseModule.framework",
349 360 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework",
350 361 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCacheManagerKit.framework",
351 362 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework",
... ... @@ -377,50 +388,6 @@
377 388 shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveLoginModule_Example/Pods-CNLiveLoginModule_Example-frameworks.sh\"\n";
378 389 showEnvVarsInLog = 0;
379 390 };
380   - 2A7FDE4BAF3533B61B4D4BF2 /* [CP] Copy Pods Resources */ = {
381   - isa = PBXShellScriptBuildPhase;
382   - buildActionMask = 2147483647;
383   - files = (
384   - );
385   - inputPaths = (
386   - "${PODS_ROOT}/Target Support Files/Pods-CNLiveLoginModule_Example/Pods-CNLiveLoginModule_Example-resources.sh",
387   - "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveLoginModule/CNLiveLoginModule.bundle",
388   - "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveShareToolKit/CNLiveShareToolKit.bundle",
389   - "${PODS_ROOT}/WeiboSDK/libWeiboSDK/WeiboSDK.bundle",
390   - );
391   - name = "[CP] Copy Pods Resources";
392   - outputPaths = (
393   - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveLoginModule.bundle",
394   - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveShareToolKit.bundle",
395   - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/WeiboSDK.bundle",
396   - );
397   - runOnlyForDeploymentPostprocessing = 0;
398   - shellPath = /bin/sh;
399   - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveLoginModule_Example/Pods-CNLiveLoginModule_Example-resources.sh\"\n";
400   - showEnvVarsInLog = 0;
401   - };
402   - 479B71CB631FBB2745B895A0 /* [CP] Check Pods Manifest.lock */ = {
403   - isa = PBXShellScriptBuildPhase;
404   - buildActionMask = 2147483647;
405   - files = (
406   - );
407   - inputFileListPaths = (
408   - );
409   - inputPaths = (
410   - "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
411   - "${PODS_ROOT}/Manifest.lock",
412   - );
413   - name = "[CP] Check Pods Manifest.lock";
414   - outputFileListPaths = (
415   - );
416   - outputPaths = (
417   - "$(DERIVED_FILE_DIR)/Pods-CNLiveLoginModule_Tests-checkManifestLockResult.txt",
418   - );
419   - runOnlyForDeploymentPostprocessing = 0;
420   - shellPath = /bin/sh;
421   - 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";
422   - showEnvVarsInLog = 0;
423   - };
424 391 C744CFA8914B761288845DE6 /* [CP] Check Pods Manifest.lock */ = {
425 392 isa = PBXShellScriptBuildPhase;
426 393 buildActionMask = 2147483647;
... ... @@ -615,7 +582,6 @@
615 582 };
616 583 6003F5C3195388D20070C39A /* Debug */ = {
617 584 isa = XCBuildConfiguration;
618   - baseConfigurationReference = 3457C6EFE3087351070CCD15 /* Pods-CNLiveLoginModule_Tests.debug.xcconfig */;
619 585 buildSettings = {
620 586 BUNDLE_LOADER = "$(TEST_HOST)";
621 587 FRAMEWORK_SEARCH_PATHS = (
... ... @@ -640,7 +606,6 @@
640 606 };
641 607 6003F5C4195388D20070C39A /* Release */ = {
642 608 isa = XCBuildConfiguration;
643   - baseConfigurationReference = E860C0C69E66BE81E9B35501 /* Pods-CNLiveLoginModule_Tests.release.xcconfig */;
644 609 buildSettings = {
645 610 BUNDLE_LOADER = "$(TEST_HOST)";
646 611 FRAMEWORK_SEARCH_PATHS = (
... ...
Example/CNLiveLoginModule/CNLIVEAppDelegate.m
... ... @@ -22,6 +22,7 @@
22 22 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];//UIScreen mainScreen].bounds个人理解获取屏幕的硬件信息然后设置尺寸大小
23 23  
24 24 [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore];
  25 + [CNLiveEnvironmentManager setAppType:CNLiveAppTypeBusiness];
25 26 [CNLiveUserSystemCenter setAppId:AppId appKey:APPKey appSecret:AppSecret isTestEnvironment:TestEnvironment];
26 27 if ([CNUserShareManager isLogin]) {
27 28 [CNLiveUserSystemCenter setUserId:CNUserShareModel.uid];
... ...
Example/Podfile
... ... @@ -6,23 +6,16 @@ platform :ios, &#39;9.0&#39;
6 6  
7 7 target 'CNLiveLoginModule_Example' do
8 8 pod 'CNLiveLoginModule', :path => '../'
9   -
10   - #依赖三方私有库,如果里面有.a的时候加上这个
11 9 pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
12 10 end
13   - post_install do |installer_representation|
14   - installer_representation.pods_project.targets.each do |target|
  11 +
  12 + post_install do |installer|
  13 + installer.pods_project.targets.each do |target|
15 14 target.build_configurations.each do |config|
16   - #share使用pod库时,pod中包含[UIApplication sharedApplication]的代码,需要下面的配置
17   - config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
18   - config.build_settings['ENABLE_BITCODE'] = false
  15 + if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 8.0
  16 + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
  17 + end
19 18 end
20 19 end
21 20 end
22   -
23   - target 'CNLiveLoginModule_Tests' do
24   - inherit! :search_paths
25   -
26   -
27   - end
28 21 end
... ...