add files

This commit is contained in:
lianxiang
2018-08-31 18:23:25 +08:00
parent 3efde8e0ea
commit e64e011d8f
26 changed files with 496 additions and 256 deletions
@@ -49,9 +49,9 @@
NC_ADD_TARGET_NAME_OBJECT(self, @selector(WeiXinLongIn:), kWeiXinAuthrization_Success, nil)
NC_ADD_TARGET_NAME_OBJECT(self, @selector(userRegistSuccsessNoti:), kUserRegistSucccess, nil)
if (![WXApi isWXAppInstalled]) {
self.weiXinLoginBtn.hidden = YES;
}
// if (![WXApi isWXAppInstalled]) {
// self.weiXinLoginBtn.hidden = YES;
// }
}
@@ -72,7 +72,7 @@
-(void)textFieldUI{
//self.acountTextField.attributedPlaceholder = @"";
UIView *acountView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
UIImageView *acountViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15,9, 12, 22)];
acountViewIcon.image = [UIImage imageNamed:@"ic_number"];
@@ -83,7 +83,7 @@
// NSAttributedString *passholderText = [[NSAttributedString alloc] initWithString:@"密码" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:[UIColor redColor]}];
// self.passwordTextField.attributedPlaceholder = passholderText;
UIView *passView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
UIImageView *passViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15, 9, 12, 22)];
UIImageView *passViewIcon = [[UIImageView alloc] initWithFrame:CGRectMake(15,8, 12, 22)];
passViewIcon.image = [UIImage imageNamed:@"icon_key"];
[passView addSubview:passViewIcon];
self.passwordTextField.leftView = passView;
@@ -91,8 +91,18 @@
self.loginBtn.layer.masksToBounds = YES;
self.loginBtn.layer.cornerRadius = self.loginBtn.frame.size.height / 2;
self.weiXinLoginBtn.layer.masksToBounds = YES;
self.weiXinLoginBtn.layer.cornerRadius = self.weiXinLoginBtn.frame.size.height / 2;
NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] init];
NSTextAttachment *attch = [[NSTextAttachment alloc] init];
attch.image = [UIImage imageNamed:@"ic_wechat"];
attch.bounds = CGRectMake(0,-4, 12.9, 12.5);
NSAttributedString *imastr=[NSAttributedString attributedStringWithAttachment:attch];
[attri appendAttributedString:imastr];
NSAttributedString *titleStr = [[NSAttributedString alloc] initWithString:@" 微信账号登录" attributes:@{NSFontAttributeName:[UIFont fontWithName:@"PingFangSC-Semibold" size:10],NSForegroundColorAttributeName:[UIColor colorWithRed:187/255.0 green:187/255.0 blue:187/255.0 alpha:1/1.0]}];
[attri appendAttributedString:titleStr];
[self.weiXinLoginBtn setAttributedTitle:attri forState:UIControlStateNormal];
}
@@ -106,6 +116,21 @@
[super viewWillAppear:animated];
[self.navigationController.navigationBar setClearNav];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
@@ -172,7 +197,6 @@
// }];
[self.view makeToastActivity:CSToastPositionCenter];
NSString *url = [NSString stringWithFormat:@"%@sys/v1/login",[GiGaServerConfig getMainUrl]];
[GiGaNetManager userLoginrequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) {
GILog(@"%@",resDic);
@@ -181,6 +205,7 @@
GILog(@"**登陆***\n code:%ld\n message:%@\n *******\n",result.code,result.message);
if (result.success) {
//token
[GiGaUserDefault saveToken:resDic[@"token"]];
//埋点
[MobClick endEvent:MobClick_UserLogin];
@@ -189,6 +214,8 @@
GIGA_WIndowTost(@"登录成功!");
[self dismissViewControllerAnimated:YES completion:nil];
}else{
GIGA_ShowToast(result.message);
}
}];