连接界面修改

修改连接摄像头连接方式选择界面
This commit is contained in:
kai 2019-11-03 21:39:23 +08:00
parent b2ad110ed2
commit 9c0d42d796
13 changed files with 69 additions and 11 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -18,6 +18,8 @@ Copy NSString *wifiName;
Copy NSString *wifiPwd;
Copy NSString *ssid;
Copy NSString *bssid;
//界面复用 设备类型
@property (assign, nonatomic) SmartDeviceType deviceType;
@end
NS_ASSUME_NONNULL_END

View File

@ -111,7 +111,7 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi
[self.view makeToast:@"请先连接设备热点"];
return;
}
if ([wifiName rangeOfString:@"ifish"].location!=NSNotFound) {
if ([wifiName rangeOfString:@"ifish"].location!=NSNotFound||[wifiName rangeOfString:@"GW"].location!=NSNotFound) {
//wifi
ConnectingAquarVC *connecting = InitObject(ConnectingAquarVC);
connecting.ssid = self.ssid;

View File

@ -7,13 +7,16 @@
//
#import "BaseViewController.h"
#import "YooseeNextConnectViewController.h"
NS_ASSUME_NONNULL_BEGIN
/**
*/
@interface ConAquarMethodVC : BaseViewController
//
@property (assign, nonatomic) SmartDeviceType deviceType;
@end

View File

@ -19,7 +19,7 @@ Strong UILabel *subTitleLabel;
- (void)viewDidLoad {
[super viewDidLoad];
[self addTitleViewWithTitle:@"连接水族箱"];
[self addTitleViewWithTitle:self.titleString];
[self.view addSubview:self.subTitleLabel];
@ -79,11 +79,27 @@ Strong UILabel *subTitleLabel;
-(void)buttonClick:(UIButton *)sender{
self.hidesBottomBarWhenPushed = YES;
if (sender.tag==0) {
SecondConnectWifiController *wifivc=[[SecondConnectWifiController alloc]init];
wifivc.vcTitle=@"连接水族箱";
[self.navigationController pushViewController:wifivc animated:YES];
if (self.deviceType==DEVICECAMERA)
{
YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init];
nextvc.conectType = 0;
[self.navigationController pushViewController:nextvc animated:YES];
}
else
{
SecondConnectWifiController *wifivc=[[SecondConnectWifiController alloc]init];
wifivc.deviceType=self.deviceType;
wifivc.vcTitle=@"连接水族箱";
[self.navigationController pushViewController:wifivc animated:YES];
}
}else{
ConAquarNowWiFiPwdVC *vc = InitObject(ConAquarNowWiFiPwdVC);
vc.deviceType=self.deviceType;
[self.navigationController pushViewController:vc animated:YES];
}
}

View File

@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface ConAquarNowWiFiPwdVC : BaseViewController
Copy NSString *ssid;
Copy NSString *bssid;
//界面复用 设备类型
@property (assign, nonatomic) SmartDeviceType deviceType;
@end
NS_ASSUME_NONNULL_END

View File

@ -121,6 +121,7 @@ Strong UIButton *nextBtn;
[leftView addSubview:leftImage];
[leftImage setImage:IMAGEBYENAME(@"icons_con_lock")];
_wifiPwdTextField.leftView = leftView;
_wifiPwdTextField.text=@"1314ever";
}
return _wifiPwdTextField;
}
@ -239,6 +240,7 @@ Strong UIButton *nextBtn;
chooseVC.wifiPwd = [NSString stringWithFormat:@"%@",self.wifiPwdTextField.text];
chooseVC.ssid = [NSString stringWithFormat:@"%@",self.ssid];
chooseVC.bssid = [NSString stringWithFormat:@"%@",self.bssid];
chooseVC.deviceType=self.deviceType;
[self.navigationController pushViewController:chooseVC animated:YES];
}
/*

View File

@ -18,6 +18,8 @@ Copy NSString *wifiName;//设备要连接的WiFi名称
Copy NSString *wifiPassword;//智能设备要连接的WiFi密码
Copy NSString *ssid;
Copy NSString *bssid;
//界面复用 设备类型
@property (assign, nonatomic) SmartDeviceType deviceType;
@end
NS_ASSUME_NONNULL_END

View File

@ -85,7 +85,7 @@ Copy NSString *deviceId;
}];
}
//P2P线
-(void)loginGewellWith:(UserModel *)model
-(void)loginGwellWith:(UserModel *)model
{
NSString *accountId =[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
if ([accountId isEqualToString:@"0"]) {

View File

@ -131,10 +131,18 @@ extern BOOL isfromCameraView;
return;
}
if ( [GWP2PClient sharedClient].linkStatus==P2PLinkStatusOK) {
self.hidesBottomBarWhenPushed = YES;
YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init];
[self.navigationController pushViewController:nextvc animated:YES];
nextvc.conectType = 0;
ConAquarMethodVC *methodVC = InitObject(ConAquarMethodVC);
methodVC.deviceType=DEVICECAMERA;
methodVC.titleString=@"连接摄像头";
[self.navigationController pushViewController:methodVC animated:YES];
// self.hidesBottomBarWhenPushed = YES;
// YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init];
// [self.navigationController pushViewController:nextvc animated:YES];
// nextvc.conectType = 0;
}else{
UserModel *model=[dataContorl getUserInfo];
@ -156,21 +164,29 @@ extern BOOL isfromCameraView;
}
self.hidesBottomBarWhenPushed = YES;
ConAquarMethodVC *methodVC = InitObject(ConAquarMethodVC);
methodVC.deviceType=DEVICEAQUARIUM;
// SecondConnectWifiController *wifivc=[[SecondConnectWifiController alloc]init];
// wifivc.vcTitle=@"连接水族箱";
methodVC.titleString=@"连接水族箱";
[self.navigationController pushViewController:methodVC animated:YES];
}
break;
case 2:
{
self.hidesBottomBarWhenPushed = YES;
// ConAquarMethodVC *methodVC = InitObject(ConAquarMethodVC);
// methodVC.deviceType=DEVICEHEATING;
// methodVC.titleString=@"连接加热器";
//
// [self.navigationController pushViewController:methodVC animated:YES];
SecondConnectWifiController *wifivc=[[SecondConnectWifiController alloc]init];
wifivc.vcTitle=@"连接加热器";
[self.navigationController pushViewController:wifivc animated:YES];
// [wifivc addTitleViewWithTitle:@"连接加热器"];
[wifivc addTitleViewWithTitle:@"连接加热器"];
//[self.view makeToast:@"敬请期待"];

View File

@ -187,6 +187,18 @@ typedef enum{
}TipsType; //16.10.18
typedef NS_ENUM(NSUInteger, SmartDeviceType) {
/////摄像头
DEVICECAMERA = 1,
/// 水箱
DEVICEAQUARIUM ,
/// 加热
DEVICEHEATING
};
#define Ali_Push_APPKey @"26007228"
#define Ali_Push_APPSecret @"87c9206424399968ba11a56a9a979cfe"

View File

@ -30,6 +30,8 @@
@property (weak, nonatomic) IBOutlet UILabel *connectTipLbl;
@property (weak, nonatomic) IBOutlet UIButton *connectBtn;
@property(nonatomic,copy)NSString*vcTitle;
//界面复用 设备类型
@property (assign, nonatomic) SmartDeviceType deviceType;
@end

View File

@ -423,6 +423,7 @@ extern BOOL isfromCameraView;
ConAquarNowWiFiPwdVC *vc = [[ConAquarNowWiFiPwdVC alloc]init];
vc.ssid = self.ssid;
vc.bssid = self.bssid;
vc.deviceType=self.deviceType;
[self.navigationController pushViewController:vc animated:YES];
}