热点连接部分bug修复

This commit is contained in:
wbzhan 2019-10-09 18:09:02 +08:00
parent bfdf208899
commit 7157c3b0ed
13 changed files with 110 additions and 62 deletions

View File

@ -15410,6 +15410,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10.1.2;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
@ -15482,6 +15483,7 @@
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl",
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl",
);
MARKETING_VERSION = 5.0.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-ObjC",
@ -15524,6 +15526,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10.1.2;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
@ -15596,6 +15599,7 @@
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrlIOS/libAVCtrl",
"$(PROJECT_DIR)/Ifish/controllers/IfishYooseeFile/IfishYsooseeNewLib/libAVCtrl",
);
MARKETING_VERSION = 5.0.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-ObjC",

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.0.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -70,7 +70,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>10.0.9</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>

View File

@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface ConAquarChooseWiFiVC : BaseViewController
Copy NSString *wifiName;
Copy NSString *wifiPwd;
Copy NSString *ssid;
Copy NSString *bssid;
@end
NS_ASSUME_NONNULL_END

View File

@ -105,13 +105,14 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi
if ([wifiName rangeOfString:@"ifish-"].location!=NSNotFound) {
//wifi
ConnectingAquarVC *connecting = InitObject(ConnectingAquarVC);
connecting.ssid = self.ssid;
connecting.bssid = self.bssid;
connecting.wifiName = self.wifiName;
connecting.wifiPassword = self.wifiPwd;
[self.navigationController pushViewController:connecting animated:YES];
}else{
[self.view makeToast:@"WiFi名称不匹配请重试"];
}
}
- (id)getSSIDInfo
{

View File

@ -44,8 +44,8 @@ Strong UIButton *nextBtn;
[self loadLayout];
NSDictionary *ifs = [self getSSIDInfo];
self.wifiNameTextField.text = [ifs objectForKey:@"SSID"];
[self getSSid];//Wifi
// Do any additional setup after loading the view.
}
@ -96,13 +96,9 @@ Strong UIButton *nextBtn;
_wifiNameTextField.leftViewMode = UITextFieldViewModeAlways;
UIView *leftView = InitObject(UIView);
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];
[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;
}
@ -122,13 +118,9 @@ Strong UIButton *nextBtn;
_wifiPwdTextField.leftViewMode = UITextFieldViewModeAlways;
UIView *leftView = InitObject(UIView);
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];
[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;
}
return _wifiPwdTextField;
@ -189,6 +181,35 @@ Strong UIButton *nextBtn;
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
- (id)getSSIDInfo
{
@ -213,9 +234,13 @@ Strong UIButton *nextBtn;
[self.view makeToast:@"路由器密码不能包含特殊字符,只能为数字、字母或下划线"];
return;
}
[self.wifiPwdTextField resignFirstResponder];
[self.wifiNameTextField resignFirstResponder];
ConAquarChooseWiFiVC *chooseVC = InitObject(ConAquarChooseWiFiVC);
chooseVC.wifiName = self.wifiNameTextField.text;
chooseVC.wifiPwd = self.wifiPwdTextField.text;
chooseVC.wifiName = [NSString stringWithFormat:@"%@",self.wifiNameTextField.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];
}
/*

View File

@ -51,6 +51,7 @@ Assign NSInteger retryTimes;
make.width.mas_equalTo(kSizeFrom750(700));
}];
[self.progressView updatePercent:100 animation:YES];
[self.progressView endProgressWithString:@"设备连接中..."];
//AP
// [[GWP2PDeviceLinker shareInstance] p2pAPLinkDeviceWithWiFiSSID:self.wifiName wifiPassword:self.wifiPassword devicePassword:@"123" deviceReceive:^(NSString *deviceId, BOOL isSupport) {
// //
@ -59,12 +60,14 @@ Assign NSInteger retryTimes;
// //
// }];
//wifi
// [self sendToDeviceWithSSIDName:self.wifiName andSSIDPWD:self.wifiPassword];
[self sendToDeviceWithSSIDName:self.wifiName andSSIDPWD:self.wifiPassword];
// Do any additional setup after loading the view.
self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}
- (void)dealloc
{
if (!self.timer) {
@ -165,7 +168,11 @@ Assign NSInteger retryTimes;
self.HUD.mode = MBProgressHUDModeIndeterminate;
self.HUD.labelText = msg;
}
-(void)endProgress{
[self.progressView endProgressWithString:@"连接结束"];
[self.timer invalidate];
self.timer = nil;
}
#pragma mark - bind
-(void)bindDeviceWithSsid:(NSString*)bssid{
NSLog(@"设备bssid_%@",bssid);
@ -178,14 +185,12 @@ Assign NSInteger retryTimes;
[self.progressView endEditing:YES];
self.isBindingDevice = NO;
self.macAddress = nil;
[self.progressView endProgressWithString:@"连接结束"];
[self.timer invalidate];
self.timer = nil;
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSLog(@"data:%@",resultDic[@"data"]);
[self appendTrakContent:[NSString stringWithFormat:@"绑定请求成功。返回数据为:%@", resultDic]];
if ([resultDic[@"result"] isEqualToString:@"100"]) {
[self endProgress];
//
NSDictionary*dataDic=resultDic[@"data"];
DeviceModel*devicemodel=[[DeviceModel alloc] initWithDict:dataDic];
@ -241,6 +246,7 @@ Assign NSInteger retryTimes;
[self bindDeviceWithSsid:self.macAddress];
self.retryTimes += 1;
} else {
[self endProgress];
self.isBindingDevice = NO;
self.HUD.labelText = @"请求异常";
[self.HUD hide:YES afterDelay:2];

View File

@ -13,7 +13,11 @@
- (void)awakeFromNib {
[super awakeFromNib];
// 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"];
}
}

View File

@ -170,7 +170,11 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
self.wifiSecFiled.delegate=self;
self.wifiSecFiled.layer.masksToBounds=YES;
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.borderStyle = UITextBorderStyleNone;
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];

View File

@ -108,7 +108,11 @@ extern BOOL isfromCameraView;
_wifiTextFiled.delegate=self;
_wifiTextFiled.layer.masksToBounds=YES;
_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)];
self.wifiTextFiled.leftView=phoneView;
self.wifiTextFiled.leftViewMode=UITextFieldViewModeAlways;

View File

@ -13,9 +13,7 @@
//#import <BaiduMapAPI_Search/BMKGeocodeSearch.h>
@interface LogInViewController : BaseViewController
{
// BMKGeoCodeSearch*_geocodesearch;
}
@property (weak, nonatomic) IBOutlet UITextField *loginPhoneNumberTextField;
@property (weak, nonatomic) IBOutlet UITextField *loginPasswordTextField;
- (IBAction)LogIn:(id)sender;

View File

@ -65,9 +65,12 @@
[self getLocation];
_logInButton.backgroundColor=COLOR_LABEL_TITLE;
_logInButton.layer.cornerRadius = 5;
[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"];
if (@available(iOS 13.0, *)){//iOS13便
}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 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{
// _geocodesearch.delegate=self;// nil
// _locService.delegate=self;
[super viewWillAppear:animated];
if ([CLLocationManager locationServicesEnabled]) {
_locationManager = [[CLLocationManager alloc]init];
_locationManager.delegate = self;
@ -187,7 +191,11 @@
self.loginPhoneNumberTextField.leftView=phoneView;
self.loginPhoneNumberTextField.leftViewMode=UITextFieldViewModeAlways;
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"];
}
UIView*passView=[[UIView alloc]initWithFrame:CGRectMake(0,30, 50, 30)];
UIImageView*passIcon=[[UIImageView alloc]initWithFrame:CGRectMake(15,5, 17, 20)];
@ -196,7 +204,11 @@
self.loginPasswordTextField.leftView=passView;
self.loginPasswordTextField.leftViewMode=UITextFieldViewModeAlways;
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"];
}
//
// int i = (arc4random()%11) + 1;//
// self.userIconImg.image=[UIImage imageNamed:[NSString stringWithFormat:@"acount%d.png",i]];

View File

@ -88,9 +88,14 @@ extern BOOL formLogIn;
self.registBtn.backgroundColor=COLOR_LABEL_TITLE;
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"];
[self.verifyTextField 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之后设置颜色的方便变更
}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 setTextkeyboadType];
@ -204,18 +209,6 @@ extern BOOL formLogIn;
-(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:@"短信验证码"];
[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];
self.navigationItem.titleView=labe;
// UIButton*rightButton = [[UIButton alloc]initWithFrame:CGRectMake(25,0,60,60)];
// [rightButton setTitle:@"登录" forState:UIControlStateNormal];
// rightButton.backgroundColor=[UIColor clearColor];
// [rightButton addTarget:self action:@selector(rightItemBtn:) forControlEvents:UIControlEventTouchUpInside];
// UIImageView*imageView=[[UIImageView alloc]initWithFrame:CGRectMake(25,0,60,60)];
//
// [imageView addSubview:rightButton];
// imageView.userInteractionEnabled=YES;
// UIBarButtonItem*rightItem = [[UIBarButtonItem alloc]initWithCustomView:imageView];
// self.navigationItem.rightBarButtonItem= rightItem;
UIButton*rightButton = [[UIButton alloc]initWithFrame:CGRectMake(25,0,60,60)];
[rightButton setTitle:@"登录" forState:UIControlStateNormal];
rightButton.backgroundColor=[UIColor clearColor];
[rightButton.titleLabel setFont:[UIFont systemFontOfSize:14]];
[rightButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[rightButton addTarget:self action:@selector(rightButtonClick:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem*rightItem= [[UIBarButtonItem alloc] initWithTitle:@"登录" style:UIBarButtonItemStyleDone target:self action:@selector(rightItemBtn:)];
UIBarButtonItem*rightItem= [[UIBarButtonItem alloc] initWithCustomView:rightButton];
// rightItem.tintColor=[UIColor whiteColor];
// [rightItem setTintColor:[UIColor whiteColor]];
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];
[self.navigationController pushViewController:login animated:YES];

View File

@ -131,7 +131,7 @@
#pragma mark - CAAnimationDelegate
- (void)animationDidStart:(CAAnimation *)anim {
self.progressLabel.text = @"设备连接中...";
// self.progressLabel.text = @"设备连接中...";
}