提交
This commit is contained in:
16
QXLive/Login(登录)/Controlller/QXAccountListViewController.h
Normal file
16
QXLive/Login(登录)/Controlller/QXAccountListViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXAccountListViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/19.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXAccountListViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSArray *accountList;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
90
QXLive/Login(登录)/Controlller/QXAccountListViewController.m
Normal file
90
QXLive/Login(登录)/Controlller/QXAccountListViewController.m
Normal file
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// QXAccountListViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/19.
|
||||
//
|
||||
|
||||
#import "QXAccountListViewController.h"
|
||||
#import "QXBlackListCell.h"
|
||||
#import "QXLoginNetwork.h"
|
||||
#import "AppDelegate+Login.h"
|
||||
#import "QXFillUserInfoViewController.h"
|
||||
|
||||
@interface QXAccountListViewController ()<UITableViewDelegate,UITableViewDataSource,QXBlackListCellDelegate>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@end
|
||||
|
||||
@implementation QXAccountListViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"选择账号");
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.accountList.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXBlackListCell *cell = [QXBlackListCell cellWithTableView:tableView];
|
||||
cell.cellType = QXBlackListCellTypeLogin;
|
||||
cell.loginModel = self.accountList[indexPath.row];
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - QXBlackListCellDelegate
|
||||
-(void)didClickLoginWithModel:(QXLoginModel *)model{
|
||||
__block QXLoginModel *loginModel = model;
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork loginAccountWithUser_login:model.user_id successBlock:^(id _Nonnull responseObject) {
|
||||
hideLoadingInView(self.view);
|
||||
[[QXGlobal shareGlobal] saveLoginData:[loginModel yy_modelToJSONString]];
|
||||
AppDelegate *delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||
[delegate tencentLogin];
|
||||
if ([loginModel.sex isEqualToString:@"0"]) {
|
||||
// 没有完善个人信息
|
||||
QXFillUserInfoViewController *fillVC = [[QXFillUserInfoViewController alloc] init];
|
||||
[weakSelf.navigationController pushViewController:fillVC animated:YES];
|
||||
}else{
|
||||
[weakSelf.navigationController dismissViewControllerAnimated:YES completion:^{
|
||||
|
||||
}];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStylePlain)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.rowHeight = 62;
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
31
QXLive/Login(登录)/Controlller/QXFillUserInfoViewController.h
Executable file
31
QXLive/Login(登录)/Controlller/QXFillUserInfoViewController.h
Executable file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// QXFillUserInfoViewController.h
|
||||
// SoundRiver
|
||||
//
|
||||
// Created by Reyna on 2020/10/27.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXFillUserInfoViewController : QXBaseViewController
|
||||
|
||||
/**
|
||||
默认用户昵称
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *defaultUserName;
|
||||
|
||||
/**
|
||||
user_code
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *user_code;
|
||||
|
||||
/**
|
||||
默认用户的邀请人的邀请码
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *defaultUser_no_parent;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
350
QXLive/Login(登录)/Controlller/QXFillUserInfoViewController.m
Executable file
350
QXLive/Login(登录)/Controlller/QXFillUserInfoViewController.m
Executable file
@@ -0,0 +1,350 @@
|
||||
//
|
||||
// QXFillUserInfoViewController.m
|
||||
// SoundRiver
|
||||
//
|
||||
// Created by Reyna on 2020/10/27.
|
||||
//
|
||||
|
||||
#import "QXFillUserInfoViewController.h"
|
||||
#import "BRDatePickerView.h"
|
||||
#import "NSDate+BRPickerView.h"
|
||||
#import <TZImagePickerController/TZImageManager.h>
|
||||
#import <TZImagePickerController/TZImagePickerController.h>
|
||||
#import "UIImage+QX.h"
|
||||
#import "NSString+QX.h"
|
||||
#import "QXApi.h"
|
||||
#import "QXOSSManager.h"
|
||||
#import "QXLoginNetwork.h"
|
||||
#import "AppDelegate.h"
|
||||
//#import <ImSDK_Plus/V2TIMManager.h>
|
||||
#import <ImSDK_Plus/ImSDK_Plus.h>
|
||||
|
||||
@interface QXFillUserInfoViewController ()<UITextFieldDelegate,TZImagePickerControllerDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UITextField *userNameTF; //用户昵称TF
|
||||
@property (weak, nonatomic) IBOutlet UITextField *codeTF; //邀请码TF
|
||||
@property (weak, nonatomic) IBOutlet UIButton *girlBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *boyBtn;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *yearLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *monthLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *dayLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *headerBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *randomBtn;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *comitUserInfoBtn;
|
||||
|
||||
@property (nonatomic, assign) NSInteger mSex;
|
||||
|
||||
@property (nonatomic, strong) NSString *birthday;
|
||||
@property (nonatomic, strong) NSString *avartar;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nickTitleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *sexTitleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *birthdayTitleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *invitTitleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *yearTitleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *monthTitleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *dayTitleLabel;
|
||||
@property (nonatomic, assign) BOOL isPhoto;
|
||||
@property (nonatomic,strong)UIButton *backBtn;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation QXFillUserInfoViewController
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
}
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[super viewWillDisappear:animated];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)initSubViews {
|
||||
self.headerBtn.layer.masksToBounds = YES;
|
||||
self.headerBtn.layer.cornerRadius = 47.5;
|
||||
self.headerBtn.imageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop+5, 40, 40)];
|
||||
[self.backBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
[self.backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.backBtn];
|
||||
if ([[QXGlobal shareGlobal].getKeyWindow.rootViewController isKindOfClass:[self class]]) {
|
||||
self.backBtn.hidden = YES;
|
||||
}
|
||||
[self getRandomUsername];
|
||||
[self configLanguage];
|
||||
}
|
||||
|
||||
-(void)configLanguage{
|
||||
[self.comitUserInfoBtn setTitle:QXText(@"进入羽声") forState:(UIControlStateNormal)];
|
||||
[self.comitUserInfoBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
self.comitUserInfoBtn.backgroundColor = QXConfig.themeColor;
|
||||
self.nickTitleLabel.text = QXText(@"希望大家怎么称呼你");
|
||||
NSString *noChangeText = [NSString stringWithFormat:@"(%@)",QXText(@"注册成功,不可更改")];
|
||||
NSString *str = [NSString stringWithFormat:@"%@%@",QXText(@"选择您的性别"),noChangeText];
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
|
||||
[attr yy_setFont:[UIFont boldSystemFontOfSize:16] range:NSMakeRange(0, str.length)];
|
||||
[attr yy_setFont:[UIFont systemFontOfSize:12] range:[noChangeText rangeOfString:str]];
|
||||
[attr yy_setColor:RGB16(0x333333) range:NSMakeRange(0, str.length)];
|
||||
[attr yy_setColor:RGB16(0x666666) range:[noChangeText rangeOfString:str]];
|
||||
self.sexTitleLabel.attributedText = attr;
|
||||
self.birthdayTitleLabel.text = QXText(@"您的生日");
|
||||
|
||||
NSString *noChangeText1 = [NSString stringWithFormat:@"(%@)",QXText(@"选填")];
|
||||
NSString *str1 = [NSString stringWithFormat:@"%@%@",QXText(@"邀请码"),noChangeText1];
|
||||
NSMutableAttributedString *attr1 = [[NSMutableAttributedString alloc] initWithString:str1];
|
||||
[attr1 yy_setFont:[UIFont boldSystemFontOfSize:16] range:NSMakeRange(0, str1.length)];
|
||||
[attr1 yy_setFont:[UIFont systemFontOfSize:12] range:[noChangeText1 rangeOfString:str1]];
|
||||
[attr1 yy_setColor:RGB16(0x333333) range:NSMakeRange(0, str1.length)];
|
||||
[attr1 yy_setColor:RGB16(0x666666) range:[noChangeText rangeOfString:str1]];
|
||||
self.invitTitleLabel.attributedText = attr1;
|
||||
|
||||
[self.randomBtn setTitle:QXText(@"随机") forState:(UIControlStateNormal)];
|
||||
}
|
||||
-(void)getRandomUsername{
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getRandomNickNameSuccessBlock:^(NSString * _Nonnull nickName) {
|
||||
weakSelf.userNameTF.text = nickName;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)getAvartarWithSex:(NSString*)sex{
|
||||
/// 从相册选中后选择性别不再重新生成头像
|
||||
if (self.isPhoto) {
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getHeaderImageWithSex:sex successBlock:^(NSString * _Nonnull imageUrl) {
|
||||
weakSelf.avartar = imageUrl;
|
||||
[weakSelf.headerBtn sd_setBackgroundImageWithURL:[NSURL URLWithString:imageUrl] forState:(UIControlStateNormal)];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
- (IBAction)clearNickName:(id)sender {
|
||||
self.userNameTF.text = @"";
|
||||
}
|
||||
- (IBAction)randomAction:(id)sender {
|
||||
[self getRandomUsername];
|
||||
}
|
||||
|
||||
-(void)selectAlbumPhoto {
|
||||
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:nil];
|
||||
imagePickerVc.maxImagesCount = 1;
|
||||
imagePickerVc.allowCameraLocation = NO;
|
||||
imagePickerVc.allowPickingOriginalPhoto = NO;
|
||||
|
||||
imagePickerVc.allowTakeVideo = NO;
|
||||
imagePickerVc.allowPickingVideo = NO;
|
||||
imagePickerVc.showSelectBtn = NO;
|
||||
imagePickerVc.allowCrop = NO;
|
||||
MJWeakSelf
|
||||
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
|
||||
if (photos.count) {
|
||||
NSData *imageData = [photos.firstObject qx_compressImageQualityWithToByte:(SCREEN_WIDTH*SCREEN_HEIGHT*2)];
|
||||
|
||||
[weakSelf OSSUploadPhotoWithFileData:imageData contentType:[NSString contentTypeWithImageData:imageData]];
|
||||
}
|
||||
}];
|
||||
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[imagePickerVc.navigationBar setBackgroundImage:[UIImage qx_imageWithColor:RGB16(0x333333)] forBarMetrics:UIBarMetricsDefault];
|
||||
[self presentViewController:imagePickerVc animated:YES completion:nil];
|
||||
}
|
||||
- (void)OSSUploadPhotoWithFileData:(NSData *)fileData contentType:(NSString *)contentType {
|
||||
[self OSSUploadPhotoWithFileData:fileData contentType:contentType isVideoCover:NO];
|
||||
}
|
||||
- (void)OSSUploadPhotoWithFileData:(NSData *)fileData contentType:(NSString *)contentType isVideoCover:(BOOL)isVideoCover {
|
||||
if (!fileData || !contentType) {
|
||||
showToastInView(QXText(@"资源加载错误"), self.view);
|
||||
return;
|
||||
}
|
||||
if (fileData.length > 1024*1024 && [contentType isEqualToString:IMG_FILE_BASE_PATH]) {
|
||||
showToastInView(QXText(@"请不要上传超过1M的头像"), self.view);
|
||||
return;
|
||||
}
|
||||
NSMutableArray *files = [[NSMutableArray alloc] initWithObjects:fileData, nil];
|
||||
|
||||
NSString *fileBasePath = IMG_FILE_BASE_PATH;// 默认图片上传
|
||||
NSString *fileName = [NSString stringWithFormat:@"%@%@/%@.%@",fileBasePath,[[QXOSSManager sharedInstance] currentDate],[NSUUID UUID].UUIDString,contentType];
|
||||
NSMutableArray *fileNames = [[NSMutableArray alloc] initWithObjects:fileName, nil];
|
||||
__weak typeof(self)weakSelf = self;
|
||||
showLoadingInView(self.view);
|
||||
[[QXOSSManager sharedInstance] uploadFile:files withObjectKey:fileNames isAsync:YES complete:^(NSArray<NSString *> *names, UploadImageState state) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
hideLoadingInView(weakSelf.view);
|
||||
});
|
||||
if (state == UploadImageSuccess) {
|
||||
NSString *fileName = [names lastObject];
|
||||
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,fileName];
|
||||
weakSelf.avartar = fileUrl;
|
||||
[weakSelf.headerBtn sd_setImageWithURL:[NSURL URLWithString:fileUrl] forState:(UIControlStateNormal)];
|
||||
weakSelf.isPhoto = YES;
|
||||
}else{
|
||||
showToastInView(QXText(@"文件上传失败,请重新尝试"), self.view);
|
||||
}
|
||||
}];
|
||||
}
|
||||
-(void)backAction{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - Request
|
||||
- (void)isGoToRoomRequest {
|
||||
// [self.adapter fetchTabBarRandomHotRoomDataWithCompletionHandler:^(int64_t roomId, NSString * _Nullable error) {
|
||||
// if (roomId > 0) {
|
||||
// SRUserManager.shared.isNeedTurnToRoom = YES;
|
||||
// }
|
||||
// }];
|
||||
if ([[QXGlobal shareGlobal].getKeyWindow.rootViewController isKindOfClass:[self class]]) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UITextFieldDelegate
|
||||
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
|
||||
NSString *nameStr = textField.text;
|
||||
if (string.length == 0 && nameStr.length>0) {
|
||||
[nameStr substringToIndex:nameStr.length - 1];
|
||||
}
|
||||
nameStr = [nameStr stringByReplacingCharactersInRange:range withString:string];
|
||||
if (nameStr.length > 10) {
|
||||
showToastInView(QXText(@"昵称过长"), self.view);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - TouchEvent
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[super touchesBegan:touches withEvent:event];
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Action
|
||||
- (IBAction)girlAction:(id)sender {
|
||||
self.girlBtn.selected = YES;
|
||||
self.boyBtn.selected = NO;
|
||||
[self getAvartarWithSex:@"2"];
|
||||
}
|
||||
- (IBAction)birthdatyAction:(id)sender {
|
||||
BRDatePickerView *piker = [[BRDatePickerView alloc] initWithPickerMode:(BRDatePickerModeYMD)];
|
||||
NSDate *minDate = [NSDate br_setYear:1900 month:1 day:1];
|
||||
piker.minDate = minDate;
|
||||
piker.maxDate = [NSDate date];
|
||||
piker.selectDate = [NSDate date];
|
||||
piker.isAutoSelect = YES;
|
||||
MJWeakSelf
|
||||
piker.resultBlock = ^(NSDate * _Nullable selectDate, NSString * _Nullable selectValue) {
|
||||
weakSelf.yearLabel.text = [NSString stringWithFormat:@"%ld",selectDate.br_year];
|
||||
weakSelf.monthLabel.text = [NSString stringWithFormat:@"%ld",selectDate.br_month];
|
||||
weakSelf.dayLabel.text = [NSString stringWithFormat:@"%ld",selectDate.br_day];
|
||||
weakSelf.birthday = selectValue;
|
||||
};
|
||||
[piker show];
|
||||
}
|
||||
- (IBAction)boyAction:(id)sender {
|
||||
self.boyBtn.selected = YES;
|
||||
self.girlBtn.selected = NO;
|
||||
[self getAvartarWithSex:@"1"];
|
||||
}
|
||||
- (IBAction)headerAction:(id)sender {
|
||||
[self selectAlbumPhoto];
|
||||
}
|
||||
|
||||
- (IBAction)comitUserInfoBtnAction:(id)sender {
|
||||
//提交信息
|
||||
if (_userNameTF.text.length == 0) {
|
||||
showToastInView(QXText(@"请填写昵称"), self.view);
|
||||
return;
|
||||
}
|
||||
if (self.girlBtn.selected == NO && self.boyBtn.selected == NO) {
|
||||
showToastInView(QXText(@"请选择性别"), self.view);
|
||||
return;
|
||||
}
|
||||
if (self.birthday.length == 0) {
|
||||
showToastInView(QXText(@"请选择生日"), self.view);
|
||||
return;
|
||||
}
|
||||
[self beginSoundriver];
|
||||
|
||||
}
|
||||
|
||||
- (void)beginSoundriver {
|
||||
__block NSString* sex;
|
||||
if (self.girlBtn.selected) {
|
||||
sex = @"2";
|
||||
}else {
|
||||
sex = @"1";
|
||||
}
|
||||
// [LoginAnalyticsManager analyticsClickWechatLoginWith:[NSString stringWithFormat:@"%ld",sex] nick_name:self.userNameTF.text invitation_code:self.codeTF.text];
|
||||
// NSDictionary *requestDic = @{@"nickname":_userNameTF.text,@"sex":[NSString stringWithFormat:@"%ld",sex]};
|
||||
// NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:requestDic];
|
||||
// if ([self.codeTF.text isNotBlank]) {
|
||||
// [params setObject:self.codeTF.text forKey:@"user_no"];
|
||||
// }
|
||||
// [params setObject:self.birthday forKey:@"birthday"];
|
||||
// [params setObject:self.avartar forKey:@"head_picture"];
|
||||
// [SRToastTool showIndicatorInView:self.view];
|
||||
// AppDelegate *delegate = [AppDelegate shareAppDelegate];
|
||||
// SRWeakSelf
|
||||
// [SRLoginAdapter qx_updateUserInfoWithParams:params completion:^(BOOL success, NSString * _Nullable error) {
|
||||
// [SRToastTool hideHUDForView:self.view];
|
||||
// if (success) {
|
||||
// if (delegate.window.rootViewController && [delegate.window.rootViewController isKindOfClass:[SRTabBarController class]]) {
|
||||
// [weakSelf.navigationController dismissViewControllerAnimated:YES completion:^{
|
||||
// //用户注册成功后调用
|
||||
// [[SRTabBarController sharedInstance] registUserGotoHotRoom];
|
||||
// }];
|
||||
// }else {
|
||||
// [delegate setupMainViewController];
|
||||
// //用户注册成功后调用
|
||||
// [[SRTabBarController sharedInstance] registUserGotoHotRoom];
|
||||
// }
|
||||
// }else{
|
||||
// [SRToastTool showError:error toView:weakSelf.view];
|
||||
// }
|
||||
// }];
|
||||
MJWeakSelf
|
||||
QXLoginModel *loginModel = [QXGlobal shareGlobal].loginModel;
|
||||
[QXLoginNetwork fillUserInfoWithNickname:_userNameTF.text
|
||||
birthday:self.birthday
|
||||
sex:sex
|
||||
avatar:self.avartar
|
||||
init_code:self.codeTF.text
|
||||
user_id:[QXGlobal shareGlobal].loginModel.user_id
|
||||
successBlock:^(id _Nonnull responseObject) {
|
||||
V2TIMUserFullInfo *info = [[V2TIMUserFullInfo alloc] init];
|
||||
info.faceURL = weakSelf.avartar;
|
||||
info.nickName = weakSelf.userNameTF.text;
|
||||
[[V2TIMManager sharedInstance] setSelfInfo:info succ:^{
|
||||
QXLOG(@"腾讯IM同步个人信息成功");
|
||||
} fail:^(int code, NSString * _Nullable desc) {
|
||||
QXLOG(@"腾讯IM同步个人信息失败-code-%d,desc-%@",code,desc);
|
||||
}];
|
||||
loginModel.sex = sex;
|
||||
loginModel.avatar = weakSelf.avartar;
|
||||
loginModel.nickname = weakSelf.userNameTF.text;
|
||||
loginModel.birthday = weakSelf.birthday;
|
||||
[[QXGlobal shareGlobal] updateUserInfoWithMolde:loginModel];
|
||||
if ([[QXGlobal shareGlobal].getKeyWindow.rootViewController isKindOfClass:[self class]]) {
|
||||
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
[delegate changeRootViewControllerIsTabbar];
|
||||
}else{
|
||||
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
422
QXLive/Login(登录)/Controlller/QXFillUserInfoViewController.xib
Executable file
422
QXLive/Login(登录)/Controlller/QXFillUserInfoViewController.xib
Executable file
@@ -0,0 +1,422 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="QXFillUserInfoViewController">
|
||||
<connections>
|
||||
<outlet property="birthdayTitleLabel" destination="m33-I3-e3t" id="cMP-Zf-LHC"/>
|
||||
<outlet property="boyBtn" destination="ij4-1N-0BV" id="MBp-jR-94t"/>
|
||||
<outlet property="codeTF" destination="HhQ-8r-qtJ" id="zmJ-S1-1T2"/>
|
||||
<outlet property="comitUserInfoBtn" destination="GuU-b0-9BY" id="jKb-VY-EJq"/>
|
||||
<outlet property="dayLabel" destination="hJf-t3-dDM" id="7j2-TN-V67"/>
|
||||
<outlet property="dayTitleLabel" destination="HH0-GT-YMQ" id="vtE-eH-GMx"/>
|
||||
<outlet property="girlBtn" destination="00d-00-Cba" id="nXh-bp-SkG"/>
|
||||
<outlet property="headerBtn" destination="2cZ-D5-6Hl" id="Njv-o0-R6f"/>
|
||||
<outlet property="invitTitleLabel" destination="9Qo-ST-Hra" id="3uS-hV-Bl5"/>
|
||||
<outlet property="monthLabel" destination="IdC-ao-2uy" id="X9H-3O-Xri"/>
|
||||
<outlet property="monthTitleLabel" destination="aXB-DB-CmS" id="G8p-Bd-ONQ"/>
|
||||
<outlet property="nickTitleLabel" destination="K6o-ay-pNF" id="rqv-sn-pPU"/>
|
||||
<outlet property="randomBtn" destination="18Z-Qm-Tls" id="477-k1-dqY"/>
|
||||
<outlet property="sexTitleLabel" destination="Yl8-1m-ydh" id="x5x-Ui-2kX"/>
|
||||
<outlet property="userNameTF" destination="tPx-V6-flb" id="rb1-Do-JYO"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
<outlet property="yearLabel" destination="QLP-jb-2xt" id="fzv-aS-6iO"/>
|
||||
<outlet property="yearTitleLabel" destination="PiP-Sf-MR5" id="lcb-M4-NCq"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="app_bg" translatesAutoresizingMaskIntoConstraints="NO" id="c9G-Gk-N38">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="818"/>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7ME-m0-gvR" userLabel="UserNameView">
|
||||
<rect key="frame" x="17" y="238.66666666666663" width="294" height="55"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g55-bD-buN">
|
||||
<rect key="frame" x="12" y="27.666666666666657" width="0.0" height="0.0"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入昵称" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="tPx-V6-flb">
|
||||
<rect key="frame" x="12" y="0.0" width="272" height="55"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="placeholderLabel.textColor">
|
||||
<color key="value" red="0.80000000000000004" green="0.80000000000000004" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textField>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MjX-Zz-zRf">
|
||||
<rect key="frame" x="249" y="0.0" width="45" height="55"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="45" id="jC2-zo-Ewz"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="Plus Circle"/>
|
||||
<connections>
|
||||
<action selector="clearNickName:" destination="-1" eventType="touchUpInside" id="b99-gX-61K"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.93725490196078431" green="0.94901960784313721" blue="0.97254901960784312" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="tPx-V6-flb" firstAttribute="leading" secondItem="g55-bD-buN" secondAttribute="trailing" id="0A5-n5-ewx"/>
|
||||
<constraint firstAttribute="bottom" secondItem="MjX-Zz-zRf" secondAttribute="bottom" id="36P-K1-wdQ"/>
|
||||
<constraint firstItem="tPx-V6-flb" firstAttribute="top" secondItem="7ME-m0-gvR" secondAttribute="top" id="8vu-JG-y3d"/>
|
||||
<constraint firstItem="g55-bD-buN" firstAttribute="leading" secondItem="7ME-m0-gvR" secondAttribute="leading" constant="12" id="MoA-3B-OfL"/>
|
||||
<constraint firstItem="MjX-Zz-zRf" firstAttribute="top" secondItem="7ME-m0-gvR" secondAttribute="top" id="WfN-NF-B9S"/>
|
||||
<constraint firstAttribute="trailing" secondItem="MjX-Zz-zRf" secondAttribute="trailing" id="YBB-VP-tfm"/>
|
||||
<constraint firstAttribute="bottom" secondItem="tPx-V6-flb" secondAttribute="bottom" id="cNg-zE-Mim"/>
|
||||
<constraint firstItem="g55-bD-buN" firstAttribute="centerY" secondItem="7ME-m0-gvR" secondAttribute="centerY" id="fRX-bs-C0L"/>
|
||||
<constraint firstAttribute="trailing" secondItem="tPx-V6-flb" secondAttribute="trailing" constant="10" id="ipl-Y8-V2I"/>
|
||||
<constraint firstAttribute="height" constant="55" id="nDg-VI-UXD"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="11"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="18Z-Qm-Tls">
|
||||
<rect key="frame" x="317" y="238.66666666666663" width="60" height="55"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="随机">
|
||||
<color key="titleColor" red="1" green="0.54117647058823526" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="randomAction:" destination="-1" eventType="touchUpInside" id="3Yc-LB-baH"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rwk-8l-Fr0" userLabel="View1">
|
||||
<rect key="frame" x="17" y="345.66666666666669" width="172" height="77"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="00d-00-Cba">
|
||||
<rect key="frame" x="0.0" y="0.0" width="172" height="77"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" backgroundImage="login_sex_girl_nor"/>
|
||||
<state key="selected" backgroundImage="login_sex_girl_sel">
|
||||
<color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="girlAction:" destination="-1" eventType="touchUpInside" id="Lkh-Bc-yg3"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="00d-00-Cba" secondAttribute="trailing" id="8pT-GO-EDd"/>
|
||||
<constraint firstItem="00d-00-Cba" firstAttribute="top" secondItem="rwk-8l-Fr0" secondAttribute="top" id="CgM-hi-eIZ"/>
|
||||
<constraint firstItem="00d-00-Cba" firstAttribute="leading" secondItem="rwk-8l-Fr0" secondAttribute="leading" id="dWg-az-QSQ"/>
|
||||
<constraint firstAttribute="height" constant="77" id="gR8-Rg-QJI"/>
|
||||
<constraint firstAttribute="bottom" secondItem="00d-00-Cba" secondAttribute="bottom" id="v6K-Lk-bJ2"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8K8-1E-c7A" userLabel="View2">
|
||||
<rect key="frame" x="204" y="345.66666666666669" width="172" height="77"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ij4-1N-0BV">
|
||||
<rect key="frame" x="0.0" y="0.0" width="172" height="77"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" backgroundImage="login_sex_boy_nor"/>
|
||||
<state key="selected" backgroundImage="login_sex_boy_sel">
|
||||
<color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="boyAction:" destination="-1" eventType="touchUpInside" id="3dZ-xF-c8T"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="ij4-1N-0BV" firstAttribute="leading" secondItem="8K8-1E-c7A" secondAttribute="leading" id="GrA-Q1-aie"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ij4-1N-0BV" secondAttribute="bottom" id="iVZ-Oh-tVb"/>
|
||||
<constraint firstAttribute="height" constant="77" id="n4c-zJ-Cmx"/>
|
||||
<constraint firstItem="ij4-1N-0BV" firstAttribute="top" secondItem="8K8-1E-c7A" secondAttribute="top" id="rpw-Rw-1zJ"/>
|
||||
<constraint firstAttribute="trailing" secondItem="ij4-1N-0BV" secondAttribute="trailing" id="uG7-Zn-wUO"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DoH-16-gCV" userLabel="FillCode">
|
||||
<rect key="frame" x="17" y="570.66666666666663" width="359" height="55"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="选填" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="HhQ-8r-qtJ">
|
||||
<rect key="frame" x="12" y="0.0" width="337" height="55"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="16"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="placeholderLabel.textColor">
|
||||
<color key="value" red="0.80000000000000004" green="0.80000000000000004" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textField>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.93725490199999995" green="0.94901960780000005" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="HhQ-8r-qtJ" firstAttribute="top" secondItem="DoH-16-gCV" secondAttribute="top" id="6XB-gm-v2C"/>
|
||||
<constraint firstAttribute="trailing" secondItem="HhQ-8r-qtJ" secondAttribute="trailing" constant="10" id="8DA-Px-fk8"/>
|
||||
<constraint firstItem="HhQ-8r-qtJ" firstAttribute="leading" secondItem="DoH-16-gCV" secondAttribute="leading" constant="12" id="BQi-xk-hck"/>
|
||||
<constraint firstAttribute="bottom" secondItem="HhQ-8r-qtJ" secondAttribute="bottom" id="sdt-Px-r25"/>
|
||||
<constraint firstAttribute="height" constant="55" id="xIT-Kc-gBX"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="11"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GuU-b0-9BY">
|
||||
<rect key="frame" x="17" y="688" width="359" height="55"/>
|
||||
<color key="backgroundColor" red="0.87450980389999999" green="0.99607843139999996" blue="0.34901960780000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="55" id="1L5-ba-06n"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<state key="normal" title="开启初梦之旅">
|
||||
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<real key="value" value="27.5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="comitUserInfoBtnAction:" destination="-1" eventType="touchUpInside" id="B6x-Yf-l4O"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="希望大家怎么称呼你" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="K6o-ay-pNF">
|
||||
<rect key="frame" x="17" y="203" width="144" height="22.666666666666657"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yl8-1m-ydh">
|
||||
<rect key="frame" x="17" y="309.66666666666669" width="296" height="23"/>
|
||||
<attributedString key="attributedText">
|
||||
<fragment content="选择您的性别">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" size="16" name="PingFangSC-Semibold"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
<fragment content="(注册成功,不可更改)">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" size="13" name="PingFangSC-Regular"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="您的生日" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m33-I3-e3t">
|
||||
<rect key="frame" x="17" y="438.66666666666669" width="64" height="23"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Qo-ST-Hra">
|
||||
<rect key="frame" x="17" y="534.66666666666663" width="86" height="23"/>
|
||||
<attributedString key="attributedText">
|
||||
<fragment content="邀请码">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" size="16" name="PingFangSC-Semibold"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
<fragment content="(选填)">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" size="14" name="PingFangSC-Semibold"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleAspectFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2cZ-D5-6Hl">
|
||||
<rect key="frame" x="149" y="92" width="95" height="95"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="95" id="E0s-s9-Z6c"/>
|
||||
<constraint firstAttribute="height" constant="95" id="ovf-44-Own"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<connections>
|
||||
<action selector="headerAction:" destination="-1" eventType="touchUpInside" id="e4n-2q-lEd"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZfF-HQ-Th2">
|
||||
<rect key="frame" x="16" y="473.66666666666669" width="361" height="45.000000000000057"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QLP-jb-2xt">
|
||||
<rect key="frame" x="0.0" y="0.0" width="94" height="45"/>
|
||||
<color key="backgroundColor" red="0.93725490196078431" green="0.94901960784313721" blue="0.97254901960784312" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="94" id="wTN-zV-bKq"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="11"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="年" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PiP-Sf-MR5">
|
||||
<rect key="frame" x="101" y="0.0" width="16" height="45"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IdC-ao-2uy">
|
||||
<rect key="frame" x="124" y="0.0" width="67" height="45"/>
|
||||
<color key="backgroundColor" red="0.93725490199999995" green="0.94901960780000005" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="67" id="erN-vS-Nf8"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="11"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hJf-t3-dDM">
|
||||
<rect key="frame" x="221" y="0.0" width="67" height="45"/>
|
||||
<color key="backgroundColor" red="0.93725490199999995" green="0.94901960780000005" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="67" id="6nL-F2-7Rh"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="11"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="月" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aXB-DB-CmS">
|
||||
<rect key="frame" x="198" y="0.0" width="16" height="45"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="日" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HH0-GT-YMQ">
|
||||
<rect key="frame" x="295" y="0.0" width="16" height="45"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1kD-ZW-dUX">
|
||||
<rect key="frame" x="0.0" y="0.0" width="361" height="45"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<connections>
|
||||
<action selector="birthdatyAction:" destination="-1" eventType="touchUpInside" id="YMH-Kb-4wA"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="QLP-jb-2xt" firstAttribute="top" secondItem="ZfF-HQ-Th2" secondAttribute="top" id="0oB-Hh-CyN"/>
|
||||
<constraint firstItem="aXB-DB-CmS" firstAttribute="top" secondItem="ZfF-HQ-Th2" secondAttribute="top" id="1h4-Cc-mCx"/>
|
||||
<constraint firstAttribute="height" constant="45" id="42m-1v-hYj"/>
|
||||
<constraint firstItem="HH0-GT-YMQ" firstAttribute="leading" secondItem="hJf-t3-dDM" secondAttribute="trailing" constant="7" id="AaI-T3-N3k"/>
|
||||
<constraint firstItem="IdC-ao-2uy" firstAttribute="top" secondItem="ZfF-HQ-Th2" secondAttribute="top" id="CWZ-jx-e4u"/>
|
||||
<constraint firstAttribute="bottom" secondItem="QLP-jb-2xt" secondAttribute="bottom" id="FVP-Yt-wnc"/>
|
||||
<constraint firstAttribute="bottom" secondItem="1kD-ZW-dUX" secondAttribute="bottom" id="MVr-8q-rzC"/>
|
||||
<constraint firstItem="PiP-Sf-MR5" firstAttribute="leading" secondItem="QLP-jb-2xt" secondAttribute="trailing" constant="7" id="Mk5-hy-swL"/>
|
||||
<constraint firstItem="QLP-jb-2xt" firstAttribute="leading" secondItem="ZfF-HQ-Th2" secondAttribute="leading" id="Ppd-fu-a3Y"/>
|
||||
<constraint firstItem="hJf-t3-dDM" firstAttribute="leading" secondItem="aXB-DB-CmS" secondAttribute="trailing" constant="7" id="U5c-rh-NES"/>
|
||||
<constraint firstAttribute="bottom" secondItem="aXB-DB-CmS" secondAttribute="bottom" id="Uov-cy-62B"/>
|
||||
<constraint firstItem="HH0-GT-YMQ" firstAttribute="top" secondItem="ZfF-HQ-Th2" secondAttribute="top" id="ZuZ-SA-UCM"/>
|
||||
<constraint firstItem="1kD-ZW-dUX" firstAttribute="leading" secondItem="ZfF-HQ-Th2" secondAttribute="leading" id="alf-ud-Gfw"/>
|
||||
<constraint firstAttribute="trailing" secondItem="1kD-ZW-dUX" secondAttribute="trailing" id="d2e-fH-3mj"/>
|
||||
<constraint firstItem="IdC-ao-2uy" firstAttribute="leading" secondItem="PiP-Sf-MR5" secondAttribute="trailing" constant="7" id="fLD-XV-n4h"/>
|
||||
<constraint firstItem="1kD-ZW-dUX" firstAttribute="top" secondItem="ZfF-HQ-Th2" secondAttribute="top" id="hf4-Sr-eVZ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="hJf-t3-dDM" secondAttribute="bottom" id="iQt-7v-LvP"/>
|
||||
<constraint firstItem="PiP-Sf-MR5" firstAttribute="top" secondItem="ZfF-HQ-Th2" secondAttribute="top" id="iTm-KL-yKb"/>
|
||||
<constraint firstItem="hJf-t3-dDM" firstAttribute="top" secondItem="ZfF-HQ-Th2" secondAttribute="top" id="nGF-qp-izZ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="PiP-Sf-MR5" secondAttribute="bottom" id="qTQ-QE-IGZ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="HH0-GT-YMQ" secondAttribute="bottom" id="qfc-DJ-nxn"/>
|
||||
<constraint firstAttribute="bottom" secondItem="IdC-ao-2uy" secondAttribute="bottom" id="uMA-Sw-F9I"/>
|
||||
<constraint firstItem="aXB-DB-CmS" firstAttribute="leading" secondItem="IdC-ao-2uy" secondAttribute="trailing" constant="7" id="vZz-ho-etR"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="8K8-1E-c7A" secondAttribute="trailing" constant="17" id="4VM-Nd-qpw"/>
|
||||
<constraint firstItem="GuU-b0-9BY" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="17" id="6W6-zg-lk3"/>
|
||||
<constraint firstItem="rwk-8l-Fr0" firstAttribute="top" secondItem="Yl8-1m-ydh" secondAttribute="bottom" constant="13" id="7sO-Ma-r5a"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="c9G-Gk-N38" secondAttribute="bottom" id="9PC-34-Jrj"/>
|
||||
<constraint firstAttribute="top" secondItem="c9G-Gk-N38" secondAttribute="top" id="BvD-Ec-GXh"/>
|
||||
<constraint firstItem="18Z-Qm-Tls" firstAttribute="bottom" secondItem="7ME-m0-gvR" secondAttribute="bottom" id="E2I-Ep-G4y"/>
|
||||
<constraint firstItem="DoH-16-gCV" firstAttribute="top" secondItem="9Qo-ST-Hra" secondAttribute="bottom" constant="13" id="F1a-ov-Dzk"/>
|
||||
<constraint firstItem="c9G-Gk-N38" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="GiY-yF-XuD"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="c9G-Gk-N38" secondAttribute="trailing" id="Kv4-j1-CFp"/>
|
||||
<constraint firstItem="18Z-Qm-Tls" firstAttribute="leading" secondItem="7ME-m0-gvR" secondAttribute="trailing" constant="6" id="Ky5-S6-HnY"/>
|
||||
<constraint firstItem="DoH-16-gCV" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="17" id="MKB-f1-ACW"/>
|
||||
<constraint firstItem="ZfF-HQ-Th2" firstAttribute="top" secondItem="m33-I3-e3t" secondAttribute="bottom" constant="12" id="PIn-FH-T1G"/>
|
||||
<constraint firstItem="m33-I3-e3t" firstAttribute="leading" secondItem="Yl8-1m-ydh" secondAttribute="leading" id="Pni-gR-VnK"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="DoH-16-gCV" secondAttribute="trailing" constant="17" id="Q78-YE-s3n"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="ZfF-HQ-Th2" secondAttribute="trailing" constant="16" id="QwQ-hl-ZHm"/>
|
||||
<constraint firstItem="18Z-Qm-Tls" firstAttribute="top" secondItem="7ME-m0-gvR" secondAttribute="top" id="Sng-rv-4fq"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="GuU-b0-9BY" secondAttribute="trailing" constant="17" id="V6z-cY-UKl"/>
|
||||
<constraint firstItem="Yl8-1m-ydh" firstAttribute="leading" secondItem="K6o-ay-pNF" secondAttribute="leading" id="W1r-4i-Gsl"/>
|
||||
<constraint firstItem="9Qo-ST-Hra" firstAttribute="top" secondItem="ZfF-HQ-Th2" secondAttribute="bottom" constant="16" id="W89-fh-zW1"/>
|
||||
<constraint firstItem="K6o-ay-pNF" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="17" id="X49-ZJ-S7g"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="7ME-m0-gvR" secondAttribute="trailing" constant="82" id="YSd-ml-JpW"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="Yl8-1m-ydh" secondAttribute="trailing" constant="80" id="aKD-H4-XfQ"/>
|
||||
<constraint firstItem="7ME-m0-gvR" firstAttribute="top" secondItem="K6o-ay-pNF" secondAttribute="bottom" constant="13" id="bzZ-DI-2Xy"/>
|
||||
<constraint firstItem="18Z-Qm-Tls" firstAttribute="centerY" secondItem="7ME-m0-gvR" secondAttribute="centerY" id="cni-UK-ZFW"/>
|
||||
<constraint firstItem="K6o-ay-pNF" firstAttribute="top" secondItem="2cZ-D5-6Hl" secondAttribute="bottom" constant="16" id="feg-oL-aLR"/>
|
||||
<constraint firstItem="8K8-1E-c7A" firstAttribute="width" secondItem="rwk-8l-Fr0" secondAttribute="width" id="lFy-gE-YdQ"/>
|
||||
<constraint firstItem="m33-I3-e3t" firstAttribute="top" secondItem="rwk-8l-Fr0" secondAttribute="bottom" constant="16" id="mt4-Xu-F5V"/>
|
||||
<constraint firstItem="2cZ-D5-6Hl" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="33" id="nCY-XC-XvW"/>
|
||||
<constraint firstItem="9Qo-ST-Hra" firstAttribute="leading" secondItem="Yl8-1m-ydh" secondAttribute="leading" id="nZ1-DM-iKI"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="GuU-b0-9BY" secondAttribute="bottom" constant="75" id="oA1-bK-ldJ"/>
|
||||
<constraint firstItem="8K8-1E-c7A" firstAttribute="top" secondItem="rwk-8l-Fr0" secondAttribute="top" id="oO7-Wc-FX5"/>
|
||||
<constraint firstItem="8K8-1E-c7A" firstAttribute="leading" secondItem="rwk-8l-Fr0" secondAttribute="trailing" constant="15" id="rou-Rp-2am"/>
|
||||
<constraint firstItem="2cZ-D5-6Hl" firstAttribute="centerX" secondItem="Q5M-cg-NOt" secondAttribute="centerX" id="sDr-FK-3Dg"/>
|
||||
<constraint firstItem="ZfF-HQ-Th2" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="16" id="sWS-vn-OZ6"/>
|
||||
<constraint firstItem="7ME-m0-gvR" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="17" id="wBT-Pi-H7k"/>
|
||||
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="18Z-Qm-Tls" secondAttribute="trailing" constant="16" id="xfw-xJ-gaS"/>
|
||||
<constraint firstItem="Yl8-1m-ydh" firstAttribute="top" secondItem="7ME-m0-gvR" secondAttribute="bottom" constant="16" id="zXO-XI-4hT"/>
|
||||
<constraint firstItem="rwk-8l-Fr0" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="17" id="zwx-KM-hFJ"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="130.53435114503816" y="81.690140845070431"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="Plus Circle" width="24" height="24"/>
|
||||
<image name="app_bg" width="375" height="465"/>
|
||||
<image name="login_sex_boy_nor" width="160" height="77"/>
|
||||
<image name="login_sex_boy_sel" width="160" height="77"/>
|
||||
<image name="login_sex_girl_nor" width="160" height="77"/>
|
||||
<image name="login_sex_girl_sel" width="160" height="77"/>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
16
QXLive/Login(登录)/Controlller/QXForgotPwdViewController.h
Normal file
16
QXLive/Login(登录)/Controlller/QXForgotPwdViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXForgotPwdViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/7.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXForgotPwdViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
184
QXLive/Login(登录)/Controlller/QXForgotPwdViewController.m
Normal file
184
QXLive/Login(登录)/Controlller/QXForgotPwdViewController.m
Normal file
@@ -0,0 +1,184 @@
|
||||
//
|
||||
// QXForgotPwdViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/7.
|
||||
//
|
||||
|
||||
#import "QXForgotPwdViewController.h"
|
||||
#import "QXLoginTextField.h"
|
||||
#import "UIButton+QX.h"
|
||||
#import "QXLoginNetwork.h"
|
||||
@interface QXForgotPwdViewController ()<QXLoginTextFieldDelegate>
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *backBtn;
|
||||
@property (nonatomic,strong)UIButton *firstBtn;
|
||||
@property (nonatomic,strong)UIButton *secondBtn;
|
||||
@property (nonatomic,strong)UIView *topView;
|
||||
|
||||
@property (nonatomic,strong)UIScrollView *scrollView;
|
||||
@property (nonatomic,strong)QXLoginTextField *accountTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *codeTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *passwordTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *repasswordTextField;
|
||||
@property (nonatomic,strong)UIButton *firstCommitBtn;
|
||||
@property (nonatomic,strong)UIButton *secondCommitBtn;
|
||||
@end
|
||||
|
||||
@implementation QXForgotPwdViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
- (void)initSubViews{
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, kSafeAreaTop, SCREEN_WIDTH-140, 40)];
|
||||
self.titleLabel.text = QXText(@"忘记密码");
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||
self.titleLabel.textColor = RGB16(0x333333);
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self.view addSubview:self.titleLabel];
|
||||
|
||||
self.backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, 40, 40)];
|
||||
[self.backBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
[self.backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.backBtn];
|
||||
|
||||
// self.topView = [[UIView alloc] initWithFrame:CGRectMake(16, NavContentHeight+5, SCREEN_WIDTH-32, 70)];
|
||||
// self.topView.backgroundColor = [UIColor whiteColor];
|
||||
// [self.topView addRoundedCornersWithRadius:9];
|
||||
// [self.view addSubview:self.topView];
|
||||
//
|
||||
// self.firstBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.topView.width/2, self.topView.height)];
|
||||
// [self.firstBtn setImage:[UIImage imageNamed:@"forgot_first_nor"] forState:(UIControlStateNormal)];
|
||||
// [self.firstBtn setImage:[UIImage imageNamed:@"forgot_first_sel"] forState:(UIControlStateSelected)];
|
||||
// [self.firstBtn setTitle:QXText(@"验证手机号") forState:(UIControlStateNormal)];
|
||||
// self.firstBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
// [self.firstBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateSelected)];
|
||||
// [self.firstBtn setTitleColor:RGB16(0x949494) forState:(UIControlStateNormal)];
|
||||
// self.firstBtn.userInteractionEnabled = NO;
|
||||
// [self.firstBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleTop) imageTitleSpace:9];
|
||||
// self.firstBtn.selected = YES;
|
||||
// [self.topView addSubview:self.firstBtn];
|
||||
//
|
||||
// UIView *line = [[UIView alloc] initWithFrame:CGRectMake((self.topView.width-74)/2, 19, 74, 1.5)];
|
||||
// line.backgroundColor = RGB16(0x949494);
|
||||
// [self.topView addSubview:line];
|
||||
//
|
||||
// self.secondBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.firstBtn.right, 0, self.topView.width/2, self.topView.height)];
|
||||
// [self.secondBtn setImage:[UIImage imageNamed:@"forgot_second_nor"] forState:(UIControlStateNormal)];
|
||||
// [self.secondBtn setImage:[UIImage imageNamed:@"forgot_second_sel"] forState:(UIControlStateSelected)];
|
||||
// [self.secondBtn setTitle:QXText(@"设置新密码") forState:(UIControlStateNormal)];
|
||||
// self.secondBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
// [self.secondBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateSelected)];
|
||||
// [self.secondBtn setTitleColor:RGB16(0x949494) forState:(UIControlStateNormal)];
|
||||
// self.secondBtn.userInteractionEnabled = NO;
|
||||
// [self.secondBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleTop) imageTitleSpace:9];
|
||||
// [self.topView addSubview:self.secondBtn];
|
||||
|
||||
// self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, self.topView.bottom+17, SCREEN_WIDTH, SCREEN_HEIGHT-self.topView.bottom)];
|
||||
// self.scrollView.contentSize = CGSizeMake(SCREEN_WIDTH*2, self.scrollView.height);
|
||||
// self.scrollView.scrollEnabled = NO;
|
||||
// self.scrollView.backgroundColor = [UIColor clearColor];
|
||||
// [self.view addSubview:self.scrollView];
|
||||
|
||||
/// 获取验证码
|
||||
self.accountTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+15, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAccount)];
|
||||
self.accountTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.accountTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.accountTextField];
|
||||
|
||||
self.codeTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(self.accountTextField.left, self.accountTextField.bottom+16, SCREEN_WIDTH-32, 44) type:(LoginTextTypeCode)];
|
||||
self.codeTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
self.codeTextField.delegate = self;
|
||||
[self.codeTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.codeTextField];
|
||||
|
||||
// 修改新密码
|
||||
self.passwordTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(self.accountTextField.left, self.codeTextField.bottom+16, SCREEN_WIDTH-32, 44) type:(LoginTextTypePassword)];
|
||||
self.passwordTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.passwordTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.passwordTextField];
|
||||
|
||||
self.repasswordTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(self.accountTextField.left, self.passwordTextField.bottom+16, SCREEN_WIDTH-32, 44) type:(LoginTextTypeRepassword)];
|
||||
self.repasswordTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.repasswordTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.repasswordTextField];
|
||||
|
||||
// self.firstCommitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.codeTextField.bottom+20, SCREEN_WIDTH-38*2, 42)];
|
||||
// [self.firstCommitBtn setTitle:QXText(@"下一步") forState:(UIControlStateNormal)];
|
||||
// self.firstCommitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
// self.firstCommitBtn.backgroundColor = QXConfig.themeColor;
|
||||
// [self.firstCommitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
// [self.firstCommitBtn addRoundedCornersWithRadius:21];
|
||||
// [self.firstCommitBtn addTarget:self action:@selector(nextAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
// [self.scrollView addSubview:self.firstCommitBtn];
|
||||
|
||||
self.secondCommitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.repasswordTextField.bottom+20, SCREEN_WIDTH-38*2, 42)];
|
||||
[self.secondCommitBtn setTitle:QXText(@"提交") forState:(UIControlStateNormal)];
|
||||
self.secondCommitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.secondCommitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.secondCommitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.secondCommitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.secondCommitBtn addRoundedCornersWithRadius:21];
|
||||
[self.view addSubview:self.secondCommitBtn];
|
||||
}
|
||||
|
||||
//-(void)nextAction{
|
||||
// self.firstBtn.selected = NO;
|
||||
// self.secondBtn.selected = YES;
|
||||
// [self.scrollView setContentOffset:CGPointMake(SCREEN_WIDTH, 0) animated:YES];
|
||||
//}
|
||||
-(void)didClickSendCode:(UIButton *)sender{
|
||||
if (self.accountTextField.textField.text.length < 11) {
|
||||
showToast(QXText(@"请输入正确的手机号码"));
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getSmscodeWithMobile:self.accountTextField.textField.text
|
||||
type:(GetSmscodeTypeFindPassword)
|
||||
successBlock:^(id _Nonnull responseObject) {
|
||||
[weakSelf.codeTextField startTimeDown];
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)commitAction{
|
||||
if (self.accountTextField.textField.text.length < 11) {
|
||||
showToast(QXText(@"请输入正确的手机号码"));
|
||||
return;
|
||||
}
|
||||
if (self.codeTextField.textField.text.length == 0) {
|
||||
showToast(QXText(@"请输入验证码"));
|
||||
return;
|
||||
}
|
||||
if (self.passwordTextField.textField.text.length == 0) {
|
||||
showToast(QXText(@"请输入密码"));
|
||||
return;
|
||||
}
|
||||
if (![self.passwordTextField.textField.text isEqualToString:self.repasswordTextField.textField.text]) {
|
||||
showToast(QXText(@"两次密码输入不一致"));
|
||||
return;
|
||||
}
|
||||
showLoadingInView(self.view);
|
||||
[QXLoginNetwork changPasswordWithMobile:self.accountTextField.textField.text
|
||||
new_password:self.passwordTextField.textField.text
|
||||
sms_code:self.codeTextField.textField.text
|
||||
user_id:[QXGlobal shareGlobal].loginModel.user_id
|
||||
successBlock:^(id _Nonnull responseObject) {
|
||||
hideLoadingInView(self.view);
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
hideLoadingInView(self.view);
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)backAction{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
17
QXLive/Login(登录)/Controlller/QXLoginProtocolViewController.h
Normal file
17
QXLive/Login(登录)/Controlller/QXLoginProtocolViewController.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXLoginProtocolViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/30.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXLoginProtocolViewController : QXBaseViewController
|
||||
/// 4 隐私协议 6 用户协议
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
129
QXLive/Login(登录)/Controlller/QXLoginProtocolViewController.m
Normal file
129
QXLive/Login(登录)/Controlller/QXLoginProtocolViewController.m
Normal file
@@ -0,0 +1,129 @@
|
||||
//
|
||||
// QXLoginProtocolViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/30.
|
||||
//
|
||||
|
||||
#import "QXLoginProtocolViewController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
static void *WKWebBrowserContext = &WKWebBrowserContext;
|
||||
@interface QXLoginProtocolViewController ()<WKNavigationDelegate>
|
||||
@property(nonatomic,strong)WKWebView *contentWebView;
|
||||
@property(nonatomic,strong)UIProgressView *progressView;
|
||||
@end
|
||||
|
||||
@implementation QXLoginProtocolViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
NSString *title = @"";
|
||||
if (self.type == 4) {
|
||||
title = QXText(@"隐私政策");
|
||||
}else if (self.type == 6) {
|
||||
title = QXText(@"用户使用协议");
|
||||
}
|
||||
self.navigationItem.title = title;
|
||||
}
|
||||
- (void)initSubViews{
|
||||
[self.view addSubview:self.contentWebView];
|
||||
[self.view addSubview:self.progressView];
|
||||
[self layoutConstraints];
|
||||
NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@%@?id=%ld",ServerUrl,QXAppProtocol,self.type]];
|
||||
NSURLRequest *request =[NSURLRequest requestWithURL:url];
|
||||
[self.contentWebView loadRequest:request];
|
||||
}
|
||||
- (void)layoutConstraints {
|
||||
[self.contentWebView setFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-(NavContentHeight))];
|
||||
[self.progressView setFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, 2)];
|
||||
}
|
||||
#pragma mark - WKNavigationDelegate
|
||||
//开始加载
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
||||
//开始加载的时候,让加载进度条显示
|
||||
self.progressView.hidden = NO;
|
||||
}
|
||||
|
||||
|
||||
//KVO监听进度条
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
|
||||
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.contentWebView) {
|
||||
[self.progressView setAlpha:1.0f];
|
||||
BOOL animated = self.contentWebView.estimatedProgress > self.progressView.progress;
|
||||
[self.progressView setProgress:self.contentWebView.estimatedProgress animated:animated];
|
||||
|
||||
// Once complete, fade out UIProgressView
|
||||
if(self.contentWebView.estimatedProgress >= 1.0f) {
|
||||
[UIView animateWithDuration:0.3f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
[self.progressView setAlpha:0.0f];
|
||||
} completion:^(BOOL finished) {
|
||||
[self.progressView setProgress:0.0f animated:NO];
|
||||
}];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
- (WKWebView *)contentWebView {
|
||||
if (!_contentWebView) {
|
||||
//设置网页的配置文件
|
||||
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
|
||||
// 允许可以与网页交互,选择视图
|
||||
configuration.selectionGranularity = YES;
|
||||
// web内容处理池pr
|
||||
configuration.processPool = [[WKProcessPool alloc] init];
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = YES;
|
||||
// 允许用户更改网页的设置
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.userContentController = UserContentController;
|
||||
// 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
|
||||
//允许视频播放
|
||||
configuration.allowsAirPlayForMediaPlayback = YES;
|
||||
// 允许在线播放
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
//开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃
|
||||
_contentWebView.allowsBackForwardNavigationGestures = YES;
|
||||
}
|
||||
_contentWebView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
|
||||
_contentWebView.backgroundColor = [UIColor whiteColor];
|
||||
_contentWebView.opaque = YES;
|
||||
//适应你设定的尺寸
|
||||
[_contentWebView sizeToFit];
|
||||
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
|
||||
// 设置代理
|
||||
_contentWebView.navigationDelegate = self;
|
||||
//kvo 添加进度监控
|
||||
[_contentWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WKWebBrowserContext];
|
||||
}
|
||||
return _contentWebView;
|
||||
}
|
||||
|
||||
- (UIProgressView *)progressView {
|
||||
if (!_progressView) {
|
||||
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
[_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
|
||||
_progressView.progressTintColor = QXConfig.themeColor;
|
||||
}
|
||||
return _progressView;
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Login(登录)/Controlller/QXLoginViewController.h
Normal file
16
QXLive/Login(登录)/Controlller/QXLoginViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXLoginViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/4/24.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXLoginViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
527
QXLive/Login(登录)/Controlller/QXLoginViewController.m
Normal file
527
QXLive/Login(登录)/Controlller/QXLoginViewController.m
Normal file
@@ -0,0 +1,527 @@
|
||||
//
|
||||
// QXLoginViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/4/24.
|
||||
//
|
||||
|
||||
#import "QXLoginViewController.h"
|
||||
#import "QXLoginTextField.h"
|
||||
#import "QXLoginBottomView.h"
|
||||
#import "QXFillUserInfoViewController.h"
|
||||
#import "QXForgotPwdViewController.h"
|
||||
#import <WXApi.h>
|
||||
#import <AlipaySDK//AlipaySDK.h>
|
||||
#import "ATAuthSDK/TXCommonHandler.h"
|
||||
#import "ATAuthSDK/PNSReturnCode.h"
|
||||
#import "QXLoginNetwork.h"
|
||||
#import "QXAccountListViewController.h" // 多账号
|
||||
#import "AppDelegate+Login.h"
|
||||
#import "QXLoginProtocolViewController.h"
|
||||
|
||||
@interface QXLoginViewController ()<UIGestureRecognizerDelegate,QXLoginBottomViewDelegate,WXApiDelegate,QXLoginTextFieldDelegate>
|
||||
@property (nonatomic,strong)UIImageView *logoImageView;
|
||||
@property (nonatomic,strong)UILabel *welcomeLabel;
|
||||
@property (nonatomic,strong)UILabel *subTitleLabel;
|
||||
@property (nonatomic,strong)QXLoginTextField *accountTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *codeTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *passwordTextField;
|
||||
/// 是否为验证码登录 默认为验证码登录
|
||||
@property (nonatomic,assign)BOOL isCodeLogin;
|
||||
/// 是否同意用户协议和隐私政策
|
||||
@property (nonatomic,assign)BOOL isAgree;
|
||||
@property (nonatomic,strong)UIButton *changeTypeBtn;
|
||||
@property (nonatomic,strong)UIButton *loginBtn;
|
||||
@property (nonatomic,strong)UIButton *forgotBtn;
|
||||
@property (nonatomic,strong)UIButton *backBtn;
|
||||
|
||||
@property (nonatomic,strong)QXLoginBottomView *thirdLoginView;
|
||||
|
||||
//微信登录
|
||||
@property (nonatomic,strong)NSString *wechatOpenId;
|
||||
@property (nonatomic,strong)NSString *wxaccess_token;
|
||||
@end
|
||||
|
||||
@implementation QXLoginViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
|
||||
}
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appleLogin:) name:noticeAppleLogin object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wechatLoginAction:) name:noticeWeChatLogin object:nil];
|
||||
}
|
||||
-(void)viewDidDisappear:(BOOL)animated{
|
||||
[super viewDidDisappear:animated];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
-(void)viewWillDisappear:(BOOL)animated{
|
||||
[super viewWillDisappear:animated];
|
||||
// [self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
// self.logoImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]];
|
||||
// [self.view addSubview:self.logoImageView];
|
||||
self.backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop+5, 40, 40)];
|
||||
[self.backBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
[self.backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.backBtn];
|
||||
|
||||
self.isCodeLogin = YES;
|
||||
self.welcomeLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, kSafeAreaTop+86, SCREEN_WIDTH-32, 36)];
|
||||
self.welcomeLabel.font = [UIFont boldSystemFontOfSize:24];
|
||||
self.welcomeLabel.text = QXText(@"欢迎来到羽声");
|
||||
self.welcomeLabel.textColor = QXConfig.textColor;
|
||||
[self.view addSubview:self.welcomeLabel];
|
||||
|
||||
self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, self.welcomeLabel.bottom+20, SCREEN_WIDTH-32, 27)];
|
||||
self.subTitleLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||
self.subTitleLabel.text = QXText(@"验证码登录");
|
||||
self.subTitleLabel.textColor = QXConfig.textColor;
|
||||
[self.view addSubview:self.subTitleLabel];
|
||||
|
||||
|
||||
self.accountTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.subTitleLabel.bottom+16, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAccount)];
|
||||
self.accountTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.accountTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.accountTextField];
|
||||
|
||||
self.codeTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.accountTextField.bottom+16, SCREEN_WIDTH-32, 44) type:(LoginTextTypeCode)];
|
||||
self.codeTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.codeTextField addRoundedCornersWithRadius:11];
|
||||
self.codeTextField.delegate = self;
|
||||
[self.view addSubview:self.codeTextField];
|
||||
|
||||
self.passwordTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.accountTextField.bottom+16, SCREEN_WIDTH-32, 44) type:(LoginTextTypePassword)];
|
||||
self.passwordTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.passwordTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.passwordTextField];
|
||||
self.passwordTextField.hidden = YES;
|
||||
|
||||
self.changeTypeBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-16-145, self.codeTextField.bottom, 145, 40)];
|
||||
[self.changeTypeBtn setImage:[UIImage imageNamed:@"login_exchanged"] forState:(UIControlStateNormal)];
|
||||
[self.changeTypeBtn setTitle:QXText(@"切换为密码登录") forState:(UIControlStateNormal)];
|
||||
[self.changeTypeBtn setTitle:QXText(@"切换为验证码登录") forState:(UIControlStateSelected)];
|
||||
[self.changeTypeBtn setTitleColor:QXConfig.textColor forState:(UIControlStateNormal)];
|
||||
self.changeTypeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.changeTypeBtn addTarget:self action:@selector(changeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.changeTypeBtn];
|
||||
|
||||
self.loginBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.codeTextField.bottom+55, SCREEN_WIDTH-38*2, 42)];
|
||||
[self.loginBtn setTitle:QXText(@"验证并登录") forState:(UIControlStateNormal)];
|
||||
[self.loginBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.loginBtn addTarget:self action:@selector(loginAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.loginBtn addRoundedCornersWithRadius:21];
|
||||
self.loginBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.loginBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.view addSubview:self.loginBtn];
|
||||
|
||||
self.forgotBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-38-75, self.loginBtn.bottom, 75, 33)];
|
||||
[self.forgotBtn setTitle:[NSString stringWithFormat:@"%@?",QXText(@"忘记密码")] forState:(UIControlStateNormal)];
|
||||
[self.forgotBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
|
||||
self.forgotBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentTrailing;
|
||||
[self.forgotBtn addTarget:self action:@selector(forgotAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.forgotBtn.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||
[self.view addSubview:self.forgotBtn];
|
||||
|
||||
|
||||
self.thirdLoginView = [[QXLoginBottomView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT-200, SCREEN_WIDTH, 200)];
|
||||
NSArray *thirdArray = @[
|
||||
@{@"type":@(1),@"icon":@"third_login_wechat"},
|
||||
@{@"type":@(2),@"icon":@"third_login_alipay"},
|
||||
@{@"type":@(3),@"icon":@"third_login_apple"},
|
||||
];
|
||||
self.thirdLoginView.thirdArray = thirdArray;
|
||||
self.thirdLoginView.delegate = self;
|
||||
self.thirdLoginView.isDefaultAgree = YES;
|
||||
self.isAgree = YES;
|
||||
[self.view addSubview:self.thirdLoginView];
|
||||
|
||||
[self checkEnvAvailableLogin];
|
||||
}
|
||||
|
||||
- (void)checkEnvAvailableLogin {
|
||||
TXCustomModel *model = [self setLoginModel];
|
||||
MJWeakSelf
|
||||
//检测当前环境是否支持一键登录
|
||||
if ([QXGlobal shareGlobal].canOneLogin) {
|
||||
[[TXCommonHandler sharedInstance] checkEnvAvailableWithAuthType:PNSAuthTypeLoginToken complete:^(NSDictionary * _Nullable resultDic) {
|
||||
if ([PNSCodeSuccess isEqualToString:[resultDic objectForKey:@"resultCode"]]) {
|
||||
//success
|
||||
[weakSelf startLoginWithModel:model complete:^{
|
||||
|
||||
}];
|
||||
}else{
|
||||
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
- (void)startLoginWithModel:(TXCustomModel *)model complete:(void (^)(void))completion {
|
||||
MJWeakSelf
|
||||
//调用取号接口,加速授权页的弹起
|
||||
[[TXCommonHandler sharedInstance] accelerateLoginPageWithTimeout:5 complete:^(NSDictionary * _Nonnull resultDic) {
|
||||
if ([PNSCodeSuccess isEqualToString:[resultDic objectForKey:@"resultCode"]] == NO) {
|
||||
completion();
|
||||
return ;
|
||||
}
|
||||
//调用获取登录Token接口,可以立马弹起授权页
|
||||
[[TXCommonHandler sharedInstance] getLoginTokenWithTimeout:5 controller:weakSelf model:model complete:^(NSDictionary * _Nonnull resultDic) {
|
||||
completion();
|
||||
NSString *code = [resultDic objectForKey:@"resultCode"];
|
||||
if ([PNSCodeLoginControllerPresentFailed isEqualToString:code]) {
|
||||
return;
|
||||
}
|
||||
if ([PNSCodeLoginControllerPresentSuccess isEqualToString:code]) {
|
||||
// [SRToastTool showSuccess:@"弹起授权页成功"];
|
||||
} else if ([PNSCodeLoginControllerClickCancel isEqualToString:code]) {
|
||||
// [SRToastTool showSuccess:@"点击了授权页的返回"];
|
||||
} else if ([PNSCodeLoginControllerClickChangeBtn isEqualToString:code]) {
|
||||
// [SRToastTool showSuccess:@"点击切换其他登录方式按钮"];
|
||||
// [LoginAnalyticsManager analyticsOneClickOtherLogin];
|
||||
[[TXCommonHandler sharedInstance] cancelLoginVCAnimated:YES complete:nil];
|
||||
|
||||
} else if ([PNSCodeLoginControllerClickLoginBtn isEqualToString:code]) {
|
||||
// [SRToastTool showSuccess:@"点击了登录按钮,checkbox关闭(不必选中),SDK内部接着会去获取登陆Token"];
|
||||
|
||||
} else if ([PNSCodeLoginControllerClickCheckBoxBtn isEqualToString:code]) {
|
||||
// [SRToastTool showSuccess:@"点击check box"];
|
||||
} else if ([PNSCodeLoginControllerClickProtocol isEqualToString:code]) {
|
||||
// [SRToastTool showSuccess:@"点击了协议富文本"];
|
||||
} else if ([PNSCodeSuccess isEqualToString:code]) {
|
||||
//点击登录按钮获取登录Token成功回调
|
||||
NSString *token = [resultDic objectForKey:@"token"];
|
||||
if (!token || token.length == 0) {
|
||||
showToast(QXText(@"暂不支持一键登录"));
|
||||
[[TXCommonHandler sharedInstance] cancelLoginVCAnimated:YES complete:nil];
|
||||
return;
|
||||
}else{
|
||||
[self loginAndGetAccountListWithType:LoginTypeOne
|
||||
user_login:@""
|
||||
sms_code:@""
|
||||
password:@""
|
||||
code:@""
|
||||
login_token:token
|
||||
auth_code:@""];
|
||||
}
|
||||
} else {
|
||||
// [SRToastTool showError:@"获取登录Token失败"];
|
||||
[[TXCommonHandler sharedInstance] cancelLoginVCAnimated:YES complete:nil];
|
||||
}
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 配置登录对象
|
||||
- (TXCustomModel *)setLoginModel {
|
||||
TXCustomModel *model = [TXCustomModel new];
|
||||
// model.contentViewFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
|
||||
// return CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
// };
|
||||
// UIImageView *bgImage = [[UIImageView alloc] initWithImage:Image(@"app_bg")];
|
||||
// bgImage.contentMode = UIViewContentModeScaleAspectFill;
|
||||
// bgImage.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
|
||||
model.customViewBlock = ^(UIView * _Nonnull superCustomView) {
|
||||
// bgImage.frame = superCustomView.frame;
|
||||
// [superCustomView insertSubview:bgImage atIndex:0];
|
||||
};
|
||||
model.backgroundImage = [UIImage imageNamed:@"app_bg"];
|
||||
model.navColor = [UIColor clearColor];
|
||||
model.backgroundColor = [UIColor clearColor];
|
||||
// model.preferredStatusBarStyle = UIStatusBarStyleLightContent;
|
||||
model.supportedInterfaceOrientations = UIInterfaceOrientationMaskPortrait;
|
||||
|
||||
model.navIsHidden = YES;
|
||||
model.preferredStatusBarStyle = UIStatusBarStyleDarkContent;
|
||||
model.logoImage = [UIImage imageNamed:@"login_logo"];
|
||||
model.logoFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
|
||||
frame.origin = CGPointMake((SCREEN_WIDTH - 240) * .5, 75 + kSafeAreaTop);
|
||||
frame.size = CGSizeMake(240, 170);
|
||||
return frame;
|
||||
};
|
||||
model.sloganText = [[NSAttributedString alloc] initWithString:@"本机号码" attributes:@{NSForegroundColorAttributeName : RGB16(0x666666),NSFontAttributeName : [UIFont systemFontOfSize:12]}];
|
||||
model.sloganFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
|
||||
frame.origin.y = 329+kSafeAreaTop+40;
|
||||
return frame;
|
||||
};
|
||||
model.numberColor = QXConfig.textColor;
|
||||
model.numberFont = [UIFont boldSystemFontOfSize:30];
|
||||
model.numberFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
|
||||
frame.origin.y = kSafeAreaTop+329;
|
||||
return frame;
|
||||
};
|
||||
model.loginBtnText = [[NSAttributedString alloc] initWithString:@"一键登录" attributes:@{NSForegroundColorAttributeName : QXConfig.textColor,NSFontAttributeName : [UIFont systemFontOfSize:15]}];
|
||||
model.loginBtnFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
|
||||
frame.origin.y = 427+kSafeAreaTop;
|
||||
frame.origin.x = 38;
|
||||
frame.size = CGSizeMake(SCREEN_WIDTH-76, 42);
|
||||
return frame;
|
||||
};
|
||||
model.loginBtnBgImgs = @[[UIImage imageNamed:@"login_btn_bg"],[UIImage imageNamed:@"login_btn_bg"],[UIImage imageNamed:@"login_btn_bg"]];
|
||||
|
||||
model.changeBtnTitle = [[NSAttributedString alloc] initWithString:@"其他手机号登录" attributes:@{NSForegroundColorAttributeName : QXConfig.textColor,NSFontAttributeName : [UIFont systemFontOfSize:15]}];
|
||||
model.changeBtnFrameBlock = ^CGRect(CGSize screenSize, CGSize superViewSize, CGRect frame) {
|
||||
frame.origin.y = 427+kSafeAreaTop+12+42;
|
||||
frame.origin.x = 38;
|
||||
frame.size = CGSizeMake(SCREEN_WIDTH-76, 42);
|
||||
return frame;
|
||||
};
|
||||
|
||||
model.checkBoxImages = @[[UIImage imageNamed:@"login_agreement_nor"],[UIImage imageNamed:@"login_agreement_sel"]];
|
||||
model.checkBoxWH = 30;
|
||||
model.privacyNavBackImage = [UIImage imageNamed:@"back"];
|
||||
model.checkBoxIsChecked = YES;
|
||||
model.privacyOne = @[[NSString stringWithFormat:@"%@",QXText(@"《用户使用协议》")],[NSString stringWithFormat:@"%@%@?id=6",ServerUrl,QXAppProtocol]];
|
||||
model.privacyTwo = @[[NSString stringWithFormat:@"%@",QXText(@"《隐私政策》")],[NSString stringWithFormat:@"%@%@?id=4",ServerUrl,QXAppProtocol]];
|
||||
model.privacyOperatorPreText = @"《";
|
||||
model.privacyOperatorSufText = @"》";
|
||||
model.privacyColors = @[RGB16(0x333333),RGB16(0xFF8ACC)];
|
||||
model.privacyAlignment = NSTextAlignmentCenter;
|
||||
|
||||
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
-(void)wechatLoginAction:(NSNotification*)notice{
|
||||
MJWeakSelf
|
||||
SendAuthResp *response = (SendAuthResp *)notice.object;
|
||||
_wechatOpenId = response.code;
|
||||
// NSString *url = [NSString stringWithFormat:@"https://api.weixin.qq.com/sns/oauth2/access_token?appid=%@&secret=%@&code=%@&grant_type=authorization_code",WechatAppId ,WechatAppSecret,_wechatOpenId];
|
||||
// [[QXRequset shareInstance] getWithUrl:url parameters:@{} needCache:NO success:^(id responseObject) {
|
||||
// QXLOG(@"%@",responseObject);
|
||||
// self->_wxaccess_token = [NSString stringWithFormat:@"%@",responseObject[@"access_token"]];
|
||||
[weakSelf loginAndGetAccountListWithType:LoginTypeWechat
|
||||
user_login:@""
|
||||
sms_code:@""
|
||||
password:@""
|
||||
code:_wechatOpenId
|
||||
login_token:@""
|
||||
auth_code:@""];
|
||||
// } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
//
|
||||
// }];
|
||||
}
|
||||
#pragma mark - QXThirdLoginViewDelegate
|
||||
-(void)thirdLoginWithType:(NSInteger)type{
|
||||
switch (type) {
|
||||
case 1:{
|
||||
QXLOG(@"微信登录");
|
||||
[self jumpWechat];
|
||||
// [self loginSuccess];
|
||||
}
|
||||
break;
|
||||
case 2:{
|
||||
QXLOG(@"支付宝登录");
|
||||
// [self loginSuccess];
|
||||
[self jumpAli];
|
||||
}
|
||||
break;
|
||||
case 3:{
|
||||
QXLOG(@"苹果登录");
|
||||
// [self loginSuccess];
|
||||
AppDelegate *appdelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||
[appdelegate authorizationAppleID];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(void)appleLogin:(NSNotification*)notice{
|
||||
NSString *token = notice.object;
|
||||
[self loginAndGetAccountListWithType:(LoginTypeApple) user_login:@"" sms_code:@"" password:@"" code:token login_token:@"" auth_code:@""];
|
||||
}
|
||||
-(void)jumpWechat{
|
||||
SendAuthReq *req = [[SendAuthReq alloc] init];
|
||||
req.state = @"wx_oauth_authorization_state";
|
||||
req.scope = @"snsapi_userinfo";
|
||||
[WXApi sendAuthReq:req viewController:self delegate:self completion:^(BOOL success) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)jumpAli{
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getAliAuthInfosuccessBlock:^(NSString * _Nonnull authStr) {
|
||||
[AlipaySDK startLogWithBlock:^(NSString *log) {
|
||||
QXLOG(@"alilog-----%@",log);
|
||||
}];
|
||||
[[AlipaySDK defaultService] auth_V2WithInfo:authStr fromScheme:@"QXLive" callback:^(NSDictionary *resultDic) {
|
||||
NSString *result = resultDic[@"result"];
|
||||
NSString *authCode = nil;
|
||||
if (result.length>0) {
|
||||
NSArray *resultArr = [result componentsSeparatedByString:@"&"];
|
||||
for (NSString *subResult in resultArr) {
|
||||
if (subResult.length > 10 && [subResult hasPrefix:@"auth_code="]) {
|
||||
authCode = [subResult substringFromIndex:10];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
QXLOG(@"authcode = %@",authCode);
|
||||
[weakSelf loginAndGetAccountListWithType:LoginTypeAli
|
||||
user_login:@""
|
||||
sms_code:@""
|
||||
password:@""
|
||||
code:@""
|
||||
login_token:@""
|
||||
auth_code:authCode];
|
||||
}];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
-(void)didClickAgree:(BOOL)isAgree{
|
||||
self.isAgree = isAgree;
|
||||
}
|
||||
|
||||
-(void)didClickAgreementLoginWithUrl:(NSString *)url type:(NSInteger)type{
|
||||
QXLOG(type==1?@"点击了用户协议":@"点击了隐私政策");
|
||||
if (type == 1) {
|
||||
QXLoginProtocolViewController *vc = [[QXLoginProtocolViewController alloc] init];
|
||||
vc.type = 6;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
QXLoginProtocolViewController *vc = [[QXLoginProtocolViewController alloc] init];
|
||||
vc.type = 4;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
#pragma mark - action
|
||||
-(void)backAction{
|
||||
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
|
||||
QXGlobal.shareGlobal.isShowLoginVC = NO;
|
||||
}
|
||||
|
||||
-(void)changeAction:(UIButton*)sender{
|
||||
sender.selected = !sender.selected;
|
||||
self.isCodeLogin = !sender.selected;
|
||||
self.passwordTextField.hidden = !sender.selected;
|
||||
self.codeTextField.hidden = sender.selected;
|
||||
self.passwordTextField.textField.text = @"";
|
||||
self.codeTextField.textField.text = @"";
|
||||
self.subTitleLabel.text = sender.selected?QXText(@"密码登录"):QXText(@"验证码登录");
|
||||
[self.loginBtn setTitle:sender.selected?QXText(@"登录"):QXText(@"验证并登录") forState:(UIControlStateNormal)];
|
||||
}
|
||||
|
||||
-(void)forgotAction:(UIButton*)sender{
|
||||
QXForgotPwdViewController *vc = [[QXForgotPwdViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)loginAction:(UIButton*)sender{
|
||||
if (!self.isAgree) {
|
||||
NSString *str = [NSString stringWithFormat:@"%@%@%@%@",QXText(@"请先阅读并同意"),QXText(@"《用户使用协议》"),QXText(@"和"),QXText(@"《隐私政策》")];
|
||||
showToast(str);
|
||||
return;
|
||||
}
|
||||
NSString *account = self.accountTextField.textField.text;
|
||||
NSString *password = self.passwordTextField.textField.text;
|
||||
NSString *code = self.codeTextField.textField.text;
|
||||
|
||||
if (self.accountTextField.textField.text.length < 11) {
|
||||
showToast(QXText(@"请输入正确的手机号码"));
|
||||
return;
|
||||
}
|
||||
LoginType loginType = LoginTypePhoneCode;
|
||||
if (self.isCodeLogin) {
|
||||
loginType = LoginTypePhoneCode;
|
||||
if (code.length == 0) {
|
||||
showToast(QXText(@"请输入验证码"));
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
loginType = LoginTypePassword;
|
||||
if (password.length == 0) {
|
||||
showToast(QXText(@"请输入密码"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
[self loginAndGetAccountListWithType:loginType
|
||||
user_login:account
|
||||
sms_code:code
|
||||
password:password
|
||||
code:@""
|
||||
login_token:@""
|
||||
auth_code:@""];
|
||||
}
|
||||
-(void)loginAndGetAccountListWithType:(LoginType)type
|
||||
user_login:(NSString*)user_login
|
||||
sms_code:(NSString*)sms_code
|
||||
password:(NSString*)password
|
||||
code:(NSString*)code
|
||||
login_token:(NSString*)login_token
|
||||
auth_code:(NSString*)auth_code{
|
||||
if (type == LoginTypeOne) {
|
||||
[[TXCommonHandler sharedInstance] cancelLoginVCAnimated:YES complete:nil];
|
||||
}
|
||||
MJWeakSelf
|
||||
showLoadingInView(self.view);
|
||||
[QXLoginNetwork loginGetAccountWithType:type user_login:user_login sms_code:sms_code password:password code:code login_token:login_token auth_code:auth_code successBlock:^(NSArray<QXLoginModel *> * _Nonnull accountList) {
|
||||
if (accountList.count > 1) {
|
||||
hideLoadingInView(self.view);
|
||||
QXAccountListViewController *vc = [[QXAccountListViewController alloc] init];
|
||||
vc.accountList = accountList;
|
||||
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
QXLoginModel *model = accountList.firstObject;
|
||||
[weakSelf accountLoginWithUser_login:model.user_id];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
hideLoadingInView(self.view);
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)accountLoginWithUser_login:(NSString*)user_login{
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork loginAccountWithUser_login:user_login successBlock:^(QXLoginModel * _Nonnull loginModel) {
|
||||
hideLoadingInView(self.view);
|
||||
[[QXGlobal shareGlobal] saveLoginData:[loginModel yy_modelToJSONString]];
|
||||
AppDelegate *delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||
[delegate tencentLogin];
|
||||
if ([loginModel.sex isEqualToString:@"0"]) {
|
||||
// 没有完善个人信息
|
||||
QXFillUserInfoViewController *fillVC = [[QXFillUserInfoViewController alloc] init];
|
||||
[weakSelf.navigationController pushViewController:fillVC animated:YES];
|
||||
}else{
|
||||
[weakSelf.navigationController dismissViewControllerAnimated:YES completion:^{
|
||||
QXGlobal.shareGlobal.isShowLoginVC = NO;
|
||||
}];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
hideLoadingInView(self.view);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - QXLoginTextFieldDelegate
|
||||
-(void)didClickSendCode:(UIButton *)sender{
|
||||
if (self.accountTextField.textField.text.length < 11) {
|
||||
showToast(QXText(@"请输入正确的手机号码"));
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getSmscodeWithMobile:self.accountTextField.textField.text type:GetSmscodeTypeLogin successBlock:^(id _Nonnull responseObject) {
|
||||
[weakSelf.codeTextField startTimeDown];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user