Commit b0638694aabc78974182d510fa5d0e3247334736

Authored by zhangxiaowen
1 parent 836baaad

no message

CNLiveLoginModule.podspec
@@ -59,6 +59,7 @@ TODO: 网家家-登录模块. @@ -59,6 +59,7 @@ TODO: 网家家-登录模块.
59 59
60 s.subspec 'ThreeLogin' do |ss| 60 s.subspec 'ThreeLogin' do |ss|
61 ss.source_files = 'CNLiveLoginModule/Classes/ThreeLogin/*.{h,m}' 61 ss.source_files = 'CNLiveLoginModule/Classes/ThreeLogin/*.{h,m}'
  62 + ss.dependency 'CNLiveLoginModule/View'
62 end 63 end
63 64
64 s.resource_bundles = { 65 s.resource_bundles = {
CNLiveLoginModule/Classes/Controller/CNLiveCompleteInfoController.m
@@ -12,66 +12,27 @@ @@ -12,66 +12,27 @@
12 #import "QMUIKit.h" 12 #import "QMUIKit.h"
13 #import "YYKit.h" 13 #import "YYKit.h"
14 14
15 -#import "CNLiveThreeLoginType.h"  
16 -#import "CNLiveBindingTelView.h" 15 +#import "CNLiveCompleteInfoView.h"
17 16
18 -#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]  
19 -  
20 -@interface CNLiveCompleteInfoController()<CNLiveBindingTelViewDelegate>  
21 -@property (nonatomic, assign) CNLiveThreeLoginType type;  
22 -@property (nonatomic, weak) CNLiveBindingTelView *bindingTelView;  
23 -@property (nonatomic, weak) YYLabel *protocol; 17 +@interface CNLiveCompleteInfoController()<CNLiveCompleteInfoViewDelegate>
  18 +@property (nonatomic, strong) CNLiveCompleteInfoView *infoView;
24 19
25 @end 20 @end
26 21
27 @implementation CNLiveCompleteInfoController 22 @implementation CNLiveCompleteInfoController
28 -- (instancetype)initWithType:(CNLiveThreeLoginType)type{  
29 - self = [super init];  
30 - if (self) {  
31 - self.type = type;  
32 -  
33 - }  
34 - return self;  
35 -  
36 -}  
37 23
38 - (void)viewDidLoad { 24 - (void)viewDidLoad {
39 [super viewDidLoad]; 25 [super viewDidLoad];
40 // Do any additional setup after loading the view. 26 // Do any additional setup after loading the view.
41 self.automaticallyAdjustsScrollViewInsets = NO; 27 self.automaticallyAdjustsScrollViewInsets = NO;
42 - self.navigationController.navigationBar.translucent = NO;  
43 - self.extendedLayoutIncludesOpaqueBars = YES;  
44 - self.edgesForExtendedLayout = UIRectEdgeBottom;  
45 self.view.backgroundColor = [UIColor whiteColor]; 28 self.view.backgroundColor = [UIColor whiteColor];
46 - self.title = @"绑定手机号";  
47 -  
48 - CNLiveBindingTelView *bindingTelView = [[CNLiveBindingTelView alloc] initWithFrame:CGRectMake(self.view.frame.size.width/8.0, NavigationContentTop, self.view.frame.size.width*3/4.0, 400) type:self.type];  
49 - bindingTelView.delegate = self;  
50 - [self.view addSubview:bindingTelView];  
51 - self.bindingTelView = bindingTelView; 29 + self.title = @"完善信息";
  30 + [self createUI];
52 31
53 - YYLabel *protocol = [[YYLabel alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height-30-NavigationContentTop-SafeAreaInsetsConstantForDeviceWithNotch.bottom, self.view.frame.size.width, 30)];  
54 - protocol.textAlignment = NSTextAlignmentCenter;  
55 - protocol.textColor = HexColor(0xadadad);  
56 - protocol.font = [UIFont systemFontOfSize:14.0];  
57 - NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:@"已阅读并同意《账户绑定确认书(网家家)》"];  
58 - NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];  
59 - style.alignment = NSTextAlignmentCenter;//对齐方式  
60 - [text addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, text.length)];  
61 - text.color = HexColor(0xadadad);  
62 - text.font = [UIFont systemFontOfSize:14.0];  
63 - __weak typeof(self) weakSelf = self;  
64 - [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) {  
65 - __strong typeof(weakSelf) strongSelf = weakSelf;  
66 - if(!strongSelf) return;  
67 - [strongSelf.view endEditing:YES];  
68 -// [XWAgreementManager jumpToAgreementH5WithType:XWAgreementTypeBindingLogin]; 32 +}
69 33
70 - }];  
71 - protocol.attributedText = text;  
72 - [self.view addSubview:protocol];  
73 - self.protocol = protocol;  
74 - 34 +- (void)createUI{
  35 + [self.view addSubview:self.infoView];
75 } 36 }
76 37
77 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { 38 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
@@ -79,9 +40,13 @@ @@ -79,9 +40,13 @@
79 40
80 } 41 }
81 42
82 -#pragma mark - CNLiveBindingTelViewDelegate  
83 -- (void)bindingSuccess:(CNLiveBindingTelView *)view type:(CNLiveThreeLoginType)type{  
84 - 43 +#pragma mark - CNLiveCompleteInfoViewDelegate
  44 +- (void)loginSuccess:(CNLiveCompleteInfoView *)view result:(id _Nonnull)result{
  45 + // 新用户 -> home
  46 +// [XWAlertView alertSucceedViewWithTextMessage:@"登录成功" block:^{
  47 +// [XWLoginNotification postUserLoginNotification:result];
  48 +// }];
  49 +
85 } 50 }
86 51
87 /* 52 /*
@@ -95,6 +60,13 @@ @@ -95,6 +60,13 @@
95 */ 60 */
96 61
97 #pragma mark - 懒加载 62 #pragma mark - 懒加载
  63 +- (CNLiveCompleteInfoView *)infoView{
  64 + if(!_infoView){
  65 + _infoView = [[CNLiveCompleteInfoView alloc] initWithFrame:CGRectMake(self.view.frame.size.width/8.0, NavigationContentTop, self.view.frame.size.width*3/4.0, 250)];
  66 + _infoView.delegate = self;
  67 + }
  68 + return _infoView;
  69 +}
98 70
99 /** 71 /**
100 * 创建图片 72 * 创建图片
CNLiveLoginModule/Classes/Controller/CNLiveLoginController.m
@@ -19,8 +19,6 @@ @@ -19,8 +19,6 @@
19 #import "CNLiveBindingTelController.h"//绑定手机号 19 #import "CNLiveBindingTelController.h"//绑定手机号
20 #import "CNLiveCompleteInfoController.h"//修改昵称 20 #import "CNLiveCompleteInfoController.h"//修改昵称
21 21
22 -#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]  
23 -  
24 @interface CNLiveLoginController()<CNLiveLoginViewDelegate, CNLiveThreeLoginViewDelegate> 22 @interface CNLiveLoginController()<CNLiveLoginViewDelegate, CNLiveThreeLoginViewDelegate>
25 @property (nonatomic, weak) CNLiveLoginView *loginView; 23 @property (nonatomic, weak) CNLiveLoginView *loginView;
26 @property (nonatomic, weak) CNLiveThreeLoginView *threeLoginView; 24 @property (nonatomic, weak) CNLiveThreeLoginView *threeLoginView;
CNLiveLoginModule/Classes/View/CNLiveCompleteInfoView.h
@@ -10,12 +10,12 @@ @@ -10,12 +10,12 @@
10 10
11 NS_ASSUME_NONNULL_BEGIN 11 NS_ASSUME_NONNULL_BEGIN
12 @class CNLiveCompleteInfoView; 12 @class CNLiveCompleteInfoView;
13 -@protocol CNLiveUserInfoViewDelegate <NSObject> 13 +@protocol CNLiveCompleteInfoViewDelegate <NSObject>
14 - (void)loginSuccess:(CNLiveCompleteInfoView *)view result:(id _Nonnull)result; 14 - (void)loginSuccess:(CNLiveCompleteInfoView *)view result:(id _Nonnull)result;
15 15
16 @end 16 @end
17 @interface CNLiveCompleteInfoView : UIView 17 @interface CNLiveCompleteInfoView : UIView
18 -@property (nonatomic, weak) id<CNLiveUserInfoViewDelegate> delegate; 18 +@property (nonatomic, weak) id<CNLiveCompleteInfoViewDelegate> delegate;
19 19
20 @end 20 @end
21 21