diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj
index 47e9054..25ff259 100644
--- a/Ifish.xcodeproj/project.pbxproj
+++ b/Ifish.xcodeproj/project.pbxproj
@@ -16101,7 +16101,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
+ CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
@@ -16221,7 +16221,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
+ CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
diff --git a/Ifish/controllers/leftcontrollers/ConfigWifiViewController.m b/Ifish/controllers/leftcontrollers/ConfigWifiViewController.m
index c9b8a1e..0ec20fa 100644
--- a/Ifish/controllers/leftcontrollers/ConfigWifiViewController.m
+++ b/Ifish/controllers/leftcontrollers/ConfigWifiViewController.m
@@ -121,7 +121,7 @@ extern BOOL isfromCameraView;
// self.wifiTextFiled.textColor = RGB_51;
self.wifiTextFiled.leftViewMode=UITextFieldViewModeAlways;
- [self addTitleViewWithTitle:self.vcTitle];
+ // [self addTitleViewWithTitle:self.vcTitle];
self.rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -170,6 +170,11 @@ extern BOOL isfromCameraView;
-(void)connectTypeClick:(UIButton *)btn
{
+ if(self.indicator.isAnimating)
+ {
+ [self.view makeToast:@"绑定中..."];
+ return;
+ }
WEAK_SELF;
NSString*airkisTitle = @"一键联网";
NSString*smartTitle = @"快捷联网";
@@ -179,6 +184,7 @@ extern BOOL isfromCameraView;
NSString*apTips = @"1、插座仅支持2.4G的WiFi网络,不支持5G 及 双频合一的网络(需在路由器设置中分开)\n2、先长按插座复位键13秒左右,松手后红灯绿灯同时熄灭,只有绿灯偶尔闪烁,再点下一步。";
SPAlertController*alert =[SPAlertController alertControllerWithTitle:nil message:nil preferredStyle:SPAlertControllerStyleActionSheet animationType:SPAlertAnimationTypeDefault];
SPAlertAction*airkiss =[SPAlertAction actionWithTitle:airkisTitle style:SPAlertActionStyleDefault handler:^(SPAlertAction * _Nonnull action) {
+ [weakSelf connectNormalView];
weakSelf.connectType = ConnectTypeAirKiss;
weakSelf.connectTypeTitle.text = airkisTitle;
weakSelf.connectTipLbl.text = airkisTips;
@@ -187,6 +193,7 @@ extern BOOL isfromCameraView;
SPAlertAction*smart =[SPAlertAction actionWithTitle:smartTitle style:SPAlertActionStyleDefault handler:^(SPAlertAction * _Nonnull action) {
+ [weakSelf connectNormalView];
weakSelf.connectType = ConnectTypeSmartESPTouch;
weakSelf.connectTypeTitle.text = smartTitle;
weakSelf.connectTipLbl.text = smartTips;
@@ -194,6 +201,7 @@ extern BOOL isfromCameraView;
}];
SPAlertAction*ap =[SPAlertAction actionWithTitle:apTitle style:SPAlertActionStyleDefault handler:^(SPAlertAction * _Nonnull action) {
+ [weakSelf connectNormalView];
weakSelf.connectType = ConnectTypeAP;
weakSelf.connectTypeTitle.text = apTitle;
weakSelf.connectTipLbl.text = apTips;
@@ -257,6 +265,10 @@ extern BOOL isfromCameraView;
{
self.connectingView.hidden=YES;
self.connectBtn.hidden = NO;
+ self.reasonBtn.hidden = YES;
+ self.resultLabel.hidden = YES;
+ self.line.hidden = YES;
+
[self.indicator stopAnimating];
}
@@ -265,9 +277,22 @@ extern BOOL isfromCameraView;
{
self.connectingView.hidden=NO;
[self.indicator startAnimating];
+ self.reasonBtn.hidden = YES;
+ self.resultLabel.hidden = YES;
+ self.line.hidden = YES;
self.connectBtn.hidden = YES;
}
+-(void)showFailResultViewWithMsg:(NSString*)msg
+{
+ self.connectingView.hidden=NO;
+ [self.indicator stopAnimating];
+ self.connectBtn.hidden = YES;
+ self.reasonBtn.hidden = NO;
+ self.resultLabel.hidden = NO;
+ self.line.hidden = NO;
+ self.resultLabel.text = msg?:@"连接失败";
+}
-(void)initMacIdString:(NSString *)ssid{
@@ -280,6 +305,7 @@ extern BOOL isfromCameraView;
}else{
_maclabel.text = @"无设备mac";
}
+ [self showFailResultViewWithMsg:_maclabel.text];
NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:_maclabel.text];
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:8];
@@ -299,9 +325,9 @@ extern BOOL isfromCameraView;
// [self.view bringSubviewToFront:_maclabel];
self.bakbutton.userInteractionEnabled=YES;
- [self connectNormalView];
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [self.view makeToast:@"设备类型不匹配,请重新选择入口绑定"];
+ [self.view makeToast:_maclabel.text];
});
}
@@ -607,7 +633,7 @@ extern BOOL isfromCameraView;
{
[self.view makeToast:msg];
}
-
+ [self showFailResultViewWithMsg:msg];
};
ConnectType type = self.connectType;
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
@@ -1009,7 +1035,7 @@ extern BOOL isfromCameraView;
[self.view makeToast:msg];
self.bakbutton.userInteractionEnabled=YES;
- NSString *str =[NSString stringWithFormat:@"mac%@错误吗101",bssid];
+ NSString *str =[NSString stringWithFormat:@"mac%@错误码101",bssid];
[self initMacIdString:str];
}else if ([resultDic[@"result"] isEqualToString:@"301"]){
@@ -1043,6 +1069,7 @@ extern BOOL isfromCameraView;
self.isBindingDevice = NO;
self.HUD.labelText = err.localizedDescription;
[self.HUD hide:YES afterDelay:2];
+ [self initMacIdString:err.description];
[self appendTrakContent:[NSString stringWithFormat:@"绑定网络请求错误:%@", err.localizedDescription]];
self.bakbutton.userInteractionEnabled=YES;
}
diff --git a/Ifish/controllers/leftcontrollers/ConfigWifiViewController.xib b/Ifish/controllers/leftcontrollers/ConfigWifiViewController.xib
index e8a67b1..cbfaf36 100644
--- a/Ifish/controllers/leftcontrollers/ConfigWifiViewController.xib
+++ b/Ifish/controllers/leftcontrollers/ConfigWifiViewController.xib
@@ -32,7 +32,7 @@
-