热点连接部分bug修复
This commit is contained in:
parent
bfdf208899
commit
7157c3b0ed
|
|
@ -15410,6 +15410,7 @@
|
||||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 10.1.2;
|
||||||
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
|
|
@ -15482,6 +15483,7 @@
|
||||||
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl",
|
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl",
|
||||||
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl",
|
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl",
|
||||||
);
|
);
|
||||||
|
MARKETING_VERSION = 5.0.1;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
"-ObjC",
|
"-ObjC",
|
||||||
|
|
@ -15524,6 +15526,7 @@
|
||||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 10.1.2;
|
||||||
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
DEVELOPMENT_TEAM = WFX8GD5HFX;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
|
|
@ -15596,6 +15599,7 @@
|
||||||
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl",
|
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl",
|
||||||
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl",
|
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl",
|
||||||
);
|
);
|
||||||
|
MARKETING_VERSION = 5.0.1;
|
||||||
ONLY_ACTIVE_ARCH = NO;
|
ONLY_ACTIVE_ARCH = NO;
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
"-ObjC",
|
"-ObjC",
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>5.0.0</string>
|
<string>$(MARKETING_VERSION)</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>10.0.9</string>
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
@interface ConAquarChooseWiFiVC : BaseViewController
|
@interface ConAquarChooseWiFiVC : BaseViewController
|
||||||
Copy NSString *wifiName;
|
Copy NSString *wifiName;
|
||||||
Copy NSString *wifiPwd;
|
Copy NSString *wifiPwd;
|
||||||
|
Copy NSString *ssid;
|
||||||
|
Copy NSString *bssid;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
|
||||||
|
|
@ -105,13 +105,14 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi
|
||||||
if ([wifiName rangeOfString:@"ifish-"].location!=NSNotFound) {
|
if ([wifiName rangeOfString:@"ifish-"].location!=NSNotFound) {
|
||||||
//wifi正确,则尝试连接设备
|
//wifi正确,则尝试连接设备
|
||||||
ConnectingAquarVC *connecting = InitObject(ConnectingAquarVC);
|
ConnectingAquarVC *connecting = InitObject(ConnectingAquarVC);
|
||||||
|
connecting.ssid = self.ssid;
|
||||||
|
connecting.bssid = self.bssid;
|
||||||
connecting.wifiName = self.wifiName;
|
connecting.wifiName = self.wifiName;
|
||||||
connecting.wifiPassword = self.wifiPwd;
|
connecting.wifiPassword = self.wifiPwd;
|
||||||
[self.navigationController pushViewController:connecting animated:YES];
|
[self.navigationController pushViewController:connecting animated:YES];
|
||||||
}else{
|
}else{
|
||||||
[self.view makeToast:@"WiFi名称不匹配,请重试"];
|
[self.view makeToast:@"WiFi名称不匹配,请重试"];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
- (id)getSSIDInfo
|
- (id)getSSIDInfo
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,8 @@ Strong UIButton *nextBtn;
|
||||||
|
|
||||||
[self loadLayout];
|
[self loadLayout];
|
||||||
|
|
||||||
NSDictionary *ifs = [self getSSIDInfo];
|
[self getSSid];//获取Wifi信息
|
||||||
self.wifiNameTextField.text = [ifs objectForKey:@"SSID"];
|
|
||||||
|
|
||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
}
|
}
|
||||||
|
|
@ -96,13 +96,9 @@ Strong UIButton *nextBtn;
|
||||||
_wifiNameTextField.leftViewMode = UITextFieldViewModeAlways;
|
_wifiNameTextField.leftViewMode = UITextFieldViewModeAlways;
|
||||||
UIView *leftView = InitObject(UIView);
|
UIView *leftView = InitObject(UIView);
|
||||||
leftView.frame = RECT(0, 0, kSizeFrom750(90), kSizeFrom750(90));
|
leftView.frame = RECT(0, 0, kSizeFrom750(90), kSizeFrom750(90));
|
||||||
UIImageView *leftImage = [[UIImageView alloc] init];
|
UIImageView *leftImage = [[UIImageView alloc] initWithFrame:RECT(kSizeFrom750(20), kSizeFrom750(20), kSizeFrom750(50), kSizeFrom750(50))];
|
||||||
[leftView addSubview:leftImage];
|
[leftView addSubview:leftImage];
|
||||||
[leftImage setImage:IMAGEBYENAME(@"icons_con_wifi")];
|
[leftImage setImage:IMAGEBYENAME(@"icons_con_wifi")];
|
||||||
[leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.center.mas_equalTo(leftView);
|
|
||||||
make.width.height.mas_equalTo(kSizeFrom750(50));
|
|
||||||
}];
|
|
||||||
_wifiNameTextField.leftView = leftView;
|
_wifiNameTextField.leftView = leftView;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -122,13 +118,9 @@ Strong UIButton *nextBtn;
|
||||||
_wifiPwdTextField.leftViewMode = UITextFieldViewModeAlways;
|
_wifiPwdTextField.leftViewMode = UITextFieldViewModeAlways;
|
||||||
UIView *leftView = InitObject(UIView);
|
UIView *leftView = InitObject(UIView);
|
||||||
leftView.frame = RECT(0, 0, kSizeFrom750(90), kSizeFrom750(90));
|
leftView.frame = RECT(0, 0, kSizeFrom750(90), kSizeFrom750(90));
|
||||||
UIImageView *leftImage = [[UIImageView alloc] init];
|
UIImageView *leftImage = [[UIImageView alloc] initWithFrame:RECT(kSizeFrom750(15), kSizeFrom750(15), kSizeFrom750(60), kSizeFrom750(60))];
|
||||||
[leftView addSubview:leftImage];
|
[leftView addSubview:leftImage];
|
||||||
[leftImage setImage:IMAGEBYENAME(@"icons_con_lock")];
|
[leftImage setImage:IMAGEBYENAME(@"icons_con_lock")];
|
||||||
[leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.center.mas_equalTo(leftView);
|
|
||||||
make.width.height.mas_equalTo(kSizeFrom750(60));
|
|
||||||
}];
|
|
||||||
_wifiPwdTextField.leftView = leftView;
|
_wifiPwdTextField.leftView = leftView;
|
||||||
}
|
}
|
||||||
return _wifiPwdTextField;
|
return _wifiPwdTextField;
|
||||||
|
|
@ -189,6 +181,35 @@ Strong UIButton *nextBtn;
|
||||||
preLabel = label;
|
preLabel = label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
-(void)getSSid{
|
||||||
|
|
||||||
|
Reachability *currReach = [Reachability reachabilityForLocalWiFi];
|
||||||
|
|
||||||
|
NetworkStatus status = [currReach currentReachabilityStatus];
|
||||||
|
NSLog(@"%ld", (long)status);
|
||||||
|
|
||||||
|
if (status==AFNetworkReachabilityStatusReachableViaWiFi) {
|
||||||
|
|
||||||
|
[self connectMyWIFI];
|
||||||
|
|
||||||
|
}else{
|
||||||
|
[self showTitle:@"" messsage:@"请切换到WiFi环境下绑定"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
-(void)connectMyWIFI{
|
||||||
|
|
||||||
|
NSUserDefaults*userDefsult=[NSUserDefaults standardUserDefaults];
|
||||||
|
NSString*pass=[userDefsult objectForKey:@"wifiPass"];
|
||||||
|
NSDictionary *netInfo = [self getSSIDInfo];
|
||||||
|
_ssid = [netInfo objectForKey:@"SSID"];
|
||||||
|
_bssid = [netInfo objectForKey:@"BSSID"];
|
||||||
|
|
||||||
|
self.wifiPwdTextField.text=pass;
|
||||||
|
self.wifiNameTextField.text = [netInfo objectForKey:@"SSID"];
|
||||||
|
}
|
||||||
|
// refer to http://stackoverflow.com/questions/5198716/iphone-get-ssid-without-private-library
|
||||||
//获取WiFi信息
|
//获取WiFi信息
|
||||||
- (id)getSSIDInfo
|
- (id)getSSIDInfo
|
||||||
{
|
{
|
||||||
|
|
@ -213,9 +234,13 @@ Strong UIButton *nextBtn;
|
||||||
[self.view makeToast:@"路由器密码不能包含特殊字符,只能为数字、字母或下划线"];
|
[self.view makeToast:@"路由器密码不能包含特殊字符,只能为数字、字母或下划线"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
[self.wifiPwdTextField resignFirstResponder];
|
||||||
|
[self.wifiNameTextField resignFirstResponder];
|
||||||
ConAquarChooseWiFiVC *chooseVC = InitObject(ConAquarChooseWiFiVC);
|
ConAquarChooseWiFiVC *chooseVC = InitObject(ConAquarChooseWiFiVC);
|
||||||
chooseVC.wifiName = self.wifiNameTextField.text;
|
chooseVC.wifiName = [NSString stringWithFormat:@"%@",self.wifiNameTextField.text];
|
||||||
chooseVC.wifiPwd = self.wifiPwdTextField.text;
|
chooseVC.wifiPwd = [NSString stringWithFormat:@"%@",self.wifiPwdTextField.text];
|
||||||
|
chooseVC.ssid = [NSString stringWithFormat:@"%@",self.ssid];
|
||||||
|
chooseVC.bssid = [NSString stringWithFormat:@"%@",self.bssid];
|
||||||
[self.navigationController pushViewController:chooseVC animated:YES];
|
[self.navigationController pushViewController:chooseVC animated:YES];
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ Assign NSInteger retryTimes;
|
||||||
make.width.mas_equalTo(kSizeFrom750(700));
|
make.width.mas_equalTo(kSizeFrom750(700));
|
||||||
}];
|
}];
|
||||||
[self.progressView updatePercent:100 animation:YES];
|
[self.progressView updatePercent:100 animation:YES];
|
||||||
|
[self.progressView endProgressWithString:@"设备连接中..."];
|
||||||
//AP模式配网
|
//AP模式配网
|
||||||
// [[GWP2PDeviceLinker shareInstance] p2pAPLinkDeviceWithWiFiSSID:self.wifiName wifiPassword:self.wifiPassword devicePassword:@"123" deviceReceive:^(NSString *deviceId, BOOL isSupport) {
|
// [[GWP2PDeviceLinker shareInstance] p2pAPLinkDeviceWithWiFiSSID:self.wifiName wifiPassword:self.wifiPassword devicePassword:@"123" deviceReceive:^(NSString *deviceId, BOOL isSupport) {
|
||||||
// //
|
// //
|
||||||
|
|
@ -59,12 +60,14 @@ Assign NSInteger retryTimes;
|
||||||
// //成功
|
// //成功
|
||||||
// }];
|
// }];
|
||||||
//传入设备要连接的wifi名称和密码
|
//传入设备要连接的wifi名称和密码
|
||||||
// [self sendToDeviceWithSSIDName:self.wifiName andSSIDPWD:self.wifiPassword];
|
[self sendToDeviceWithSSIDName:self.wifiName andSSIDPWD:self.wifiPassword];
|
||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
|
|
||||||
self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
|
self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
|
||||||
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
|
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
if (!self.timer) {
|
if (!self.timer) {
|
||||||
|
|
@ -165,7 +168,11 @@ Assign NSInteger retryTimes;
|
||||||
self.HUD.mode = MBProgressHUDModeIndeterminate;
|
self.HUD.mode = MBProgressHUDModeIndeterminate;
|
||||||
self.HUD.labelText = msg;
|
self.HUD.labelText = msg;
|
||||||
}
|
}
|
||||||
|
-(void)endProgress{
|
||||||
|
[self.progressView endProgressWithString:@"连接结束"];
|
||||||
|
[self.timer invalidate];
|
||||||
|
self.timer = nil;
|
||||||
|
}
|
||||||
#pragma mark - bind
|
#pragma mark - bind
|
||||||
-(void)bindDeviceWithSsid:(NSString*)bssid{
|
-(void)bindDeviceWithSsid:(NSString*)bssid{
|
||||||
NSLog(@"设备bssid_%@",bssid);
|
NSLog(@"设备bssid_%@",bssid);
|
||||||
|
|
@ -178,14 +185,12 @@ Assign NSInteger retryTimes;
|
||||||
[self.progressView endEditing:YES];
|
[self.progressView endEditing:YES];
|
||||||
self.isBindingDevice = NO;
|
self.isBindingDevice = NO;
|
||||||
self.macAddress = nil;
|
self.macAddress = nil;
|
||||||
[self.progressView endProgressWithString:@"连接结束"];
|
|
||||||
[self.timer invalidate];
|
|
||||||
self.timer = nil;
|
|
||||||
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||||
NSLog(@"data:%@",resultDic[@"data"]);
|
NSLog(@"data:%@",resultDic[@"data"]);
|
||||||
[self appendTrakContent:[NSString stringWithFormat:@"绑定请求成功。返回数据为:%@", resultDic]];
|
[self appendTrakContent:[NSString stringWithFormat:@"绑定请求成功。返回数据为:%@", resultDic]];
|
||||||
if ([resultDic[@"result"] isEqualToString:@"100"]) {
|
if ([resultDic[@"result"] isEqualToString:@"100"]) {
|
||||||
|
[self endProgress];
|
||||||
// 保存设备信息
|
// 保存设备信息
|
||||||
NSDictionary*dataDic=resultDic[@"data"];
|
NSDictionary*dataDic=resultDic[@"data"];
|
||||||
DeviceModel*devicemodel=[[DeviceModel alloc] initWithDict:dataDic];
|
DeviceModel*devicemodel=[[DeviceModel alloc] initWithDict:dataDic];
|
||||||
|
|
@ -241,6 +246,7 @@ Assign NSInteger retryTimes;
|
||||||
[self bindDeviceWithSsid:self.macAddress];
|
[self bindDeviceWithSsid:self.macAddress];
|
||||||
self.retryTimes += 1;
|
self.retryTimes += 1;
|
||||||
} else {
|
} else {
|
||||||
|
[self endProgress];
|
||||||
self.isBindingDevice = NO;
|
self.isBindingDevice = NO;
|
||||||
self.HUD.labelText = @"请求异常";
|
self.HUD.labelText = @"请求异常";
|
||||||
[self.HUD hide:YES afterDelay:2];
|
[self.HUD hide:YES afterDelay:2];
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,11 @@
|
||||||
- (void)awakeFromNib {
|
- (void)awakeFromNib {
|
||||||
[super awakeFromNib];
|
[super awakeFromNib];
|
||||||
// Initialization code
|
// Initialization code
|
||||||
|
if (@available(iOS 13.0, *)){//iOS13之后,设置颜色的方便变更
|
||||||
|
|
||||||
|
}else{
|
||||||
[self.roomNameFiled setValue:[UIColor colorWithRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
[self.roomNameFiled setValue:[UIColor colorWithRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,11 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
|
||||||
self.wifiSecFiled.delegate=self;
|
self.wifiSecFiled.delegate=self;
|
||||||
self.wifiSecFiled.layer.masksToBounds=YES;
|
self.wifiSecFiled.layer.masksToBounds=YES;
|
||||||
self.wifiSecFiled.layer.cornerRadius=5;
|
self.wifiSecFiled.layer.cornerRadius=5;
|
||||||
|
if (@available(iOS 13.0, *)){//iOS13之后,设置颜色的方便变更
|
||||||
|
|
||||||
|
}else{
|
||||||
[self.wifiSecFiled setValue:[UIColor colorWithRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
[self.wifiSecFiled setValue:[UIColor colorWithRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
}
|
||||||
self.wifiSecFiled.borderStyle = UITextBorderStyleNone;
|
self.wifiSecFiled.borderStyle = UITextBorderStyleNone;
|
||||||
self.wifiSecFiled.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1];
|
self.wifiSecFiled.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1];
|
||||||
NSUserDefaults*userDefsult=[NSUserDefaults standardUserDefaults];
|
NSUserDefaults*userDefsult=[NSUserDefaults standardUserDefaults];
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,11 @@ extern BOOL isfromCameraView;
|
||||||
_wifiTextFiled.delegate=self;
|
_wifiTextFiled.delegate=self;
|
||||||
_wifiTextFiled.layer.masksToBounds=YES;
|
_wifiTextFiled.layer.masksToBounds=YES;
|
||||||
_wifiTextFiled.layer.cornerRadius=5;
|
_wifiTextFiled.layer.cornerRadius=5;
|
||||||
[_wifiTextFiled setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
|
if (@available(iOS 13.0, *)){//iOS13之后,设置颜色的方便变更
|
||||||
|
|
||||||
|
}else{
|
||||||
|
[_wifiTextFiled setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
}
|
||||||
UIView*phoneView=[[UIView alloc]initWithFrame:CGRectMake(0,0, 9, 10)];
|
UIView*phoneView=[[UIView alloc]initWithFrame:CGRectMake(0,0, 9, 10)];
|
||||||
self.wifiTextFiled.leftView=phoneView;
|
self.wifiTextFiled.leftView=phoneView;
|
||||||
self.wifiTextFiled.leftViewMode=UITextFieldViewModeAlways;
|
self.wifiTextFiled.leftViewMode=UITextFieldViewModeAlways;
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,7 @@
|
||||||
//#import <BaiduMapAPI_Search/BMKGeocodeSearch.h>
|
//#import <BaiduMapAPI_Search/BMKGeocodeSearch.h>
|
||||||
|
|
||||||
@interface LogInViewController : BaseViewController
|
@interface LogInViewController : BaseViewController
|
||||||
{
|
|
||||||
// BMKGeoCodeSearch*_geocodesearch;
|
|
||||||
}
|
|
||||||
@property (weak, nonatomic) IBOutlet UITextField *loginPhoneNumberTextField;
|
@property (weak, nonatomic) IBOutlet UITextField *loginPhoneNumberTextField;
|
||||||
@property (weak, nonatomic) IBOutlet UITextField *loginPasswordTextField;
|
@property (weak, nonatomic) IBOutlet UITextField *loginPasswordTextField;
|
||||||
- (IBAction)LogIn:(id)sender;
|
- (IBAction)LogIn:(id)sender;
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,12 @@
|
||||||
[self getLocation];
|
[self getLocation];
|
||||||
_logInButton.backgroundColor=COLOR_LABEL_TITLE;
|
_logInButton.backgroundColor=COLOR_LABEL_TITLE;
|
||||||
_logInButton.layer.cornerRadius = 5;
|
_logInButton.layer.cornerRadius = 5;
|
||||||
|
if (@available(iOS 13.0, *)){//iOS13之后,设置颜色的方便变更
|
||||||
[self.loginPhoneNumberTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
|
||||||
[self.loginPasswordTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
}else{
|
||||||
|
[self.loginPhoneNumberTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
[self.loginPasswordTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
}
|
||||||
|
|
||||||
[self.wangJiBtn addTarget:self action:@selector(forgetPassword:) forControlEvents:UIControlEventTouchUpInside];
|
[self.wangJiBtn addTarget:self action:@selector(forgetPassword:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
[self.wangJiBtn setTitleColor:[UIColor colorWithRed:146/255.0f green:146/255.0f blue:146/255.0f alpha:1] forState:UIControlStateNormal];
|
[self.wangJiBtn setTitleColor:[UIColor colorWithRed:146/255.0f green:146/255.0f blue:146/255.0f alpha:1] forState:UIControlStateNormal];
|
||||||
|
|
@ -133,6 +136,7 @@
|
||||||
-(void)viewWillAppear:(BOOL)animated{
|
-(void)viewWillAppear:(BOOL)animated{
|
||||||
// _geocodesearch.delegate=self;// 此处记得不用的时候需要置nil,否则影响内存的释放
|
// _geocodesearch.delegate=self;// 此处记得不用的时候需要置nil,否则影响内存的释放
|
||||||
// _locService.delegate=self;
|
// _locService.delegate=self;
|
||||||
|
[super viewWillAppear:animated];
|
||||||
if ([CLLocationManager locationServicesEnabled]) {
|
if ([CLLocationManager locationServicesEnabled]) {
|
||||||
_locationManager = [[CLLocationManager alloc]init];
|
_locationManager = [[CLLocationManager alloc]init];
|
||||||
_locationManager.delegate = self;
|
_locationManager.delegate = self;
|
||||||
|
|
@ -187,7 +191,11 @@
|
||||||
self.loginPhoneNumberTextField.leftView=phoneView;
|
self.loginPhoneNumberTextField.leftView=phoneView;
|
||||||
self.loginPhoneNumberTextField.leftViewMode=UITextFieldViewModeAlways;
|
self.loginPhoneNumberTextField.leftViewMode=UITextFieldViewModeAlways;
|
||||||
self.loginPhoneNumberTextField.layer.cornerRadius=6;
|
self.loginPhoneNumberTextField.layer.cornerRadius=6;
|
||||||
|
if (@available(iOS 13.0, *)){//iOS13之后,设置颜色的方便变更
|
||||||
|
|
||||||
|
}else{
|
||||||
[self.loginPhoneNumberTextField setValue:[UIColor colorWithRed:146.0/255.0 green:146.0/255.0 blue:146.0/255.0 alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
[self.loginPhoneNumberTextField setValue:[UIColor colorWithRed:146.0/255.0 green:146.0/255.0 blue:146.0/255.0 alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
}
|
||||||
|
|
||||||
UIView*passView=[[UIView alloc]initWithFrame:CGRectMake(0,30, 50, 30)];
|
UIView*passView=[[UIView alloc]initWithFrame:CGRectMake(0,30, 50, 30)];
|
||||||
UIImageView*passIcon=[[UIImageView alloc]initWithFrame:CGRectMake(15,5, 17, 20)];
|
UIImageView*passIcon=[[UIImageView alloc]initWithFrame:CGRectMake(15,5, 17, 20)];
|
||||||
|
|
@ -196,7 +204,11 @@
|
||||||
self.loginPasswordTextField.leftView=passView;
|
self.loginPasswordTextField.leftView=passView;
|
||||||
self.loginPasswordTextField.leftViewMode=UITextFieldViewModeAlways;
|
self.loginPasswordTextField.leftViewMode=UITextFieldViewModeAlways;
|
||||||
self.loginPasswordTextField.layer.cornerRadius=6;
|
self.loginPasswordTextField.layer.cornerRadius=6;
|
||||||
|
if (@available(iOS 13.0, *)){//iOS13之后,设置颜色的方便变更
|
||||||
|
|
||||||
|
}else{
|
||||||
[self.loginPasswordTextField setValue:[UIColor colorWithRed:146.0/255.0 green:146.0/255.0 blue:146.0/255.0 alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
[self.loginPasswordTextField setValue:[UIColor colorWithRed:146.0/255.0 green:146.0/255.0 blue:146.0/255.0 alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
}
|
||||||
// 设置用户头像
|
// 设置用户头像
|
||||||
// int i = (arc4random()%11) + 1;// 设置随机头像
|
// int i = (arc4random()%11) + 1;// 设置随机头像
|
||||||
// self.userIconImg.image=[UIImage imageNamed:[NSString stringWithFormat:@"acount%d.png",i]];
|
// self.userIconImg.image=[UIImage imageNamed:[NSString stringWithFormat:@"acount%d.png",i]];
|
||||||
|
|
|
||||||
|
|
@ -88,9 +88,14 @@ extern BOOL formLogIn;
|
||||||
|
|
||||||
self.registBtn.backgroundColor=COLOR_LABEL_TITLE;
|
self.registBtn.backgroundColor=COLOR_LABEL_TITLE;
|
||||||
self.view.backgroundColor= [UIColor colorWithPatternImage:[UIImage imageNamed:@"enter_background"]];
|
self.view.backgroundColor= [UIColor colorWithPatternImage:[UIImage imageNamed:@"enter_background"]];
|
||||||
[self.passwordTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
|
||||||
[self.phoneNumberTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
if (@available(iOS 13.0, *)){//iOS13之后,设置颜色的方便变更
|
||||||
[self.verifyTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
|
||||||
|
}else{
|
||||||
|
[self.passwordTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
[self.phoneNumberTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
[self.verifyTextField setValue:[UIColor colorWithRed:153/255.0f green:153/255.0f blue:153/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
|
||||||
|
}
|
||||||
|
|
||||||
[self addNaviItem];
|
[self addNaviItem];
|
||||||
[self setTextkeyboadType];
|
[self setTextkeyboadType];
|
||||||
|
|
@ -204,18 +209,6 @@ extern BOOL formLogIn;
|
||||||
|
|
||||||
-(void)getVerifycode{
|
-(void)getVerifycode{
|
||||||
|
|
||||||
//原来只支持香港澳门 台湾 大陆 已废弃
|
|
||||||
//BOOL isMacth=[dataContorl valiMobile:self.phoneNumberTextField.text];
|
|
||||||
|
|
||||||
//if (!isMacth) {
|
|
||||||
|
|
||||||
// [self.view makeToast:@"请输入正确手机号"];
|
|
||||||
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//NSString *zone = [dataContorl areaCode:self.phoneNumberTextField.text];
|
|
||||||
//self.areaCode = zone;
|
|
||||||
BOOL isTextCode = [[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"短信验证码"];
|
BOOL isTextCode = [[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"短信验证码"];
|
||||||
[IFISHHTTPTOOL getverifyWithTimerButton:_timeBtn addphoneNumber:self.phoneNumberTextField.text zone:self.areaCode isTextCode:isTextCode result:^(NSError *err) {
|
[IFISHHTTPTOOL getverifyWithTimerButton:_timeBtn addphoneNumber:self.phoneNumberTextField.text zone:self.areaCode isTextCode:isTextCode result:^(NSError *err) {
|
||||||
|
|
||||||
|
|
@ -291,26 +284,21 @@ extern BOOL formLogIn;
|
||||||
labe.textColor=[UIColor whiteColor];
|
labe.textColor=[UIColor whiteColor];
|
||||||
self.navigationItem.titleView=labe;
|
self.navigationItem.titleView=labe;
|
||||||
|
|
||||||
// UIButton*rightButton = [[UIButton alloc]initWithFrame:CGRectMake(25,0,60,60)];
|
UIButton*rightButton = [[UIButton alloc]initWithFrame:CGRectMake(25,0,60,60)];
|
||||||
// [rightButton setTitle:@"登录" forState:UIControlStateNormal];
|
[rightButton setTitle:@"登录" forState:UIControlStateNormal];
|
||||||
// rightButton.backgroundColor=[UIColor clearColor];
|
rightButton.backgroundColor=[UIColor clearColor];
|
||||||
// [rightButton addTarget:self action:@selector(rightItemBtn:) forControlEvents:UIControlEventTouchUpInside];
|
[rightButton.titleLabel setFont:[UIFont systemFontOfSize:14]];
|
||||||
// UIImageView*imageView=[[UIImageView alloc]initWithFrame:CGRectMake(25,0,60,60)];
|
[rightButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||||
//
|
[rightButton addTarget:self action:@selector(rightButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
// [imageView addSubview:rightButton];
|
|
||||||
// imageView.userInteractionEnabled=YES;
|
|
||||||
// UIBarButtonItem*rightItem = [[UIBarButtonItem alloc]initWithCustomView:imageView];
|
|
||||||
// self.navigationItem.rightBarButtonItem= rightItem;
|
|
||||||
|
|
||||||
UIBarButtonItem*rightItem= [[UIBarButtonItem alloc] initWithTitle:@"登录" style:UIBarButtonItemStyleDone target:self action:@selector(rightItemBtn:)];
|
UIBarButtonItem*rightItem= [[UIBarButtonItem alloc] initWithCustomView:rightButton];
|
||||||
// rightItem.tintColor=[UIColor whiteColor];
|
// rightItem.tintColor=[UIColor whiteColor];
|
||||||
// [rightItem setTintColor:[UIColor whiteColor]];
|
// [rightItem setTintColor:[UIColor whiteColor]];
|
||||||
self.navigationItem.rightBarButtonItem= rightItem;
|
self.navigationItem.rightBarButtonItem= rightItem;
|
||||||
[self.navigationItem.rightBarButtonItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:14],UITextAttributeFont, [UIColor whiteColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal];
|
// [self.navigationItem.rightBarButtonItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:14],UITextAttributeFont, [UIColor whiteColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal];
|
||||||
|
|
||||||
}
|
}
|
||||||
-(void)rightItemBtn:(id)sender{
|
-(void)rightButtonClick:(UIButton *)sender{
|
||||||
|
|
||||||
LogInViewController *login=[[LogInViewController alloc]init];
|
LogInViewController *login=[[LogInViewController alloc]init];
|
||||||
[self.navigationController pushViewController:login animated:YES];
|
[self.navigationController pushViewController:login animated:YES];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@
|
||||||
#pragma mark - CAAnimationDelegate
|
#pragma mark - CAAnimationDelegate
|
||||||
|
|
||||||
- (void)animationDidStart:(CAAnimation *)anim {
|
- (void)animationDidStart:(CAAnimation *)anim {
|
||||||
self.progressLabel.text = @"设备连接中...";
|
// self.progressLabel.text = @"设备连接中...";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue