Commit b0638694aabc78974182d510fa5d0e3247334736
1 parent
836baaad
no message
Showing
4 changed files
with
25 additions
and
54 deletions
CNLiveLoginModule.podspec
CNLiveLoginModule/Classes/Controller/CNLiveCompleteInfoController.m
| ... | ... | @@ -12,66 +12,27 @@ |
| 12 | 12 | #import "QMUIKit.h" |
| 13 | 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 | 20 | @end |
| 26 | 21 | |
| 27 | 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 | 24 | - (void)viewDidLoad { |
| 39 | 25 | [super viewDidLoad]; |
| 40 | 26 | // Do any additional setup after loading the view. |
| 41 | 27 | self.automaticallyAdjustsScrollViewInsets = NO; |
| 42 | - self.navigationController.navigationBar.translucent = NO; | |
| 43 | - self.extendedLayoutIncludesOpaqueBars = YES; | |
| 44 | - self.edgesForExtendedLayout = UIRectEdgeBottom; | |
| 45 | 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 | 38 | - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { |
| ... | ... | @@ -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 | 60 | */ |
| 96 | 61 | |
| 97 | 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 | 19 | #import "CNLiveBindingTelController.h"//绑定手机号 |
| 20 | 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 | 22 | @interface CNLiveLoginController()<CNLiveLoginViewDelegate, CNLiveThreeLoginViewDelegate> |
| 25 | 23 | @property (nonatomic, weak) CNLiveLoginView *loginView; |
| 26 | 24 | @property (nonatomic, weak) CNLiveThreeLoginView *threeLoginView; | ... | ... |
CNLiveLoginModule/Classes/View/CNLiveCompleteInfoView.h
| ... | ... | @@ -10,12 +10,12 @@ |
| 10 | 10 | |
| 11 | 11 | NS_ASSUME_NONNULL_BEGIN |
| 12 | 12 | @class CNLiveCompleteInfoView; |
| 13 | -@protocol CNLiveUserInfoViewDelegate <NSObject> | |
| 13 | +@protocol CNLiveCompleteInfoViewDelegate <NSObject> | |
| 14 | 14 | - (void)loginSuccess:(CNLiveCompleteInfoView *)view result:(id _Nonnull)result; |
| 15 | 15 | |
| 16 | 16 | @end |
| 17 | 17 | @interface CNLiveCompleteInfoView : UIView |
| 18 | -@property (nonatomic, weak) id<CNLiveUserInfoViewDelegate> delegate; | |
| 18 | +@property (nonatomic, weak) id<CNLiveCompleteInfoViewDelegate> delegate; | |
| 19 | 19 | |
| 20 | 20 | @end |
| 21 | 21 | ... | ... |