微信登陆,bug修改
This commit is contained in:
@@ -34,7 +34,8 @@
|
||||
#import "AccountResult.h"
|
||||
#import "LoginResult.h"
|
||||
#import "RegisterResult.h"
|
||||
|
||||
#import "WXApi.h"
|
||||
#import "WXApiManager.h"
|
||||
#import "UIView+Toast.h"
|
||||
#import "IfishNewsModel.h"
|
||||
//#import <BaiduMapAPI_Location/BMKLocationService.h>
|
||||
@@ -42,7 +43,7 @@
|
||||
//#import <BaiduMapAPI_Utils/BMKUtilsComponent.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
#import "IfishUserDataUnity.h"
|
||||
@interface LogInViewController ()<UITextFieldDelegate,CLLocationManagerDelegate>
|
||||
@interface LogInViewController ()<UITextFieldDelegate,CLLocationManagerDelegate,WXApiManagerDelegate>
|
||||
@property (weak, nonatomic) IBOutlet UIButton *logInButton;
|
||||
@property(nonatomic,strong)UIActivityIndicatorView*indicatorView;
|
||||
//@property(nonatomic)BMKLocationService*locService;
|
||||
@@ -51,6 +52,10 @@
|
||||
@property(nonatomic,copy) NSString *adderss;
|
||||
@property (nonatomic,strong ) CLLocationManager *locationManager;//定位服务
|
||||
@property (nonatomic,copy) NSString *currentCity;//城市
|
||||
@property (nonatomic,copy) NSDictionary *expara;//城市
|
||||
@property (weak, nonatomic) IBOutlet UIView *styleView;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *wechatCons;
|
||||
|
||||
@end
|
||||
extern BOOL firstLogIn;
|
||||
BOOL formLogIn;// //连接页面是否来自登录界面初始化
|
||||
@@ -112,6 +117,14 @@
|
||||
self.loginPhoneNumberTextField.text = name;
|
||||
|
||||
}
|
||||
if ([WXApi isWXAppInstalled])
|
||||
{
|
||||
self.styleView.hidden=NO;
|
||||
if ([CommonUtils isIphoneX])
|
||||
{
|
||||
//self.wechatCons.constant=-30;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -255,8 +268,12 @@
|
||||
btn.userInteractionEnabled = NO;
|
||||
btn.backgroundColor = [UIColor lightGrayColor];
|
||||
[_indicatorView startAnimating];
|
||||
|
||||
NSString*tokenStr=[MyMD5 md5:self.loginPasswordTextField.text ];
|
||||
NSString*tokenStr;
|
||||
if (self.loginPasswordTextField.text.length)
|
||||
{
|
||||
tokenStr=[MyMD5 md5:self.loginPasswordTextField.text ];
|
||||
}
|
||||
|
||||
if (!self.adderss) {
|
||||
NSLog(@"addressnil");
|
||||
self.adderss = @"暂时未获取到地址信息";
|
||||
@@ -272,7 +289,7 @@
|
||||
}
|
||||
|
||||
__weak typeof (self) weakSelf=self;
|
||||
[AFHttpTool userLogInWithPhoneNumber:self.loginPhoneNumberTextField.text password:tokenStr phoneType:@"ios" address:self.adderss
|
||||
[AFHttpTool userLogInWithPhoneNumber:[CommonUtils getNotNilStr:self.loginPhoneNumberTextField.text] password:tokenStr phoneType:@"ios" address:self.adderss
|
||||
longitude:self.longitude
|
||||
latitude:self.latitude
|
||||
success:^(id response) {
|
||||
@@ -326,9 +343,19 @@
|
||||
NSString *errstr = [NSString stringWithFormat:@"%@",err];
|
||||
BLYLog(BuglyLogLevelWarn, errstr);
|
||||
|
||||
}];
|
||||
} expara:self.expara];
|
||||
|
||||
}
|
||||
- (IBAction)wechatAuthority:(UIButton *)sender {
|
||||
AppDelegate*del=(AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||
del.isWechatLogin=YES;
|
||||
[WXApiManager sharedManager].delegate=self;
|
||||
SendAuthReq* req =[[SendAuthReq alloc]init];
|
||||
req.scope = @"snsapi_userinfo";
|
||||
req.state = @"ifish7";
|
||||
|
||||
[WXApi sendReq:req];
|
||||
}
|
||||
|
||||
- (void)tagsAliasCallback:(int)iResCode tags:(NSSet*)tags alias:(NSString*)alias {
|
||||
|
||||
@@ -336,6 +363,17 @@
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - WXApiManagerDelegate
|
||||
- (void)managerDidRecvAuthResponse:(SendAuthResp *)response
|
||||
{
|
||||
if (response.errCode==0)
|
||||
{
|
||||
self.expara=@{@"code":response.code};
|
||||
[self LogIn:nil];
|
||||
}
|
||||
AppDelegate*del=(AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||
del.isWechatLogin=NO;
|
||||
}
|
||||
#pragma mark - 注册摄像头成功后 登陆摄像头服务器 已去
|
||||
|
||||
-(void)logInYooseeServerWith:(NSString*)email addpassword:(NSString*)password{
|
||||
@@ -444,7 +482,7 @@
|
||||
|
||||
//视图下沉恢复原状
|
||||
[UIView animateWithDuration:duration animations:^{
|
||||
self.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
|
||||
self.view.frame = CGRectMake(0, NavigationBarHeight, self.view.frame.size.width, self.view.frame.size.height);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user