修改字数的限制

This commit is contained in:
祝发冬
2023-08-20 20:14:16 +08:00
parent 878fe05931
commit 189897a4f3
9 changed files with 74 additions and 43 deletions
@@ -24,6 +24,8 @@
@property (weak, nonatomic) IBOutlet UILabel *resultLabel;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *indicator;
@property (weak, nonatomic) IBOutlet UIView *line;
@property (nonatomic, strong) UIView *mask;
@@ -101,7 +101,7 @@ extern BOOL isfromCameraView;
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self addTitleViewWithTitle:self.titleString];
self.view.backgroundColor=[UIColor whiteColor];
self.connectType = ConnectTypeAirKiss;
_deviceArry =[[NSMutableArray alloc]init];
@@ -154,6 +154,17 @@ extern BOOL isfromCameraView;
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
}
-(void)goBackAction{
if(self.connectingView.hidden==NO)
{
[self connectNormalView];
}
else
{
[self.navigationController popViewControllerAnimated:YES];
}
}
#pragma mark -连接不上?
@@ -183,7 +194,7 @@ extern BOOL isfromCameraView;
}];
SPAlertAction*ap =[SPAlertAction actionWithTitle:apTitle style:SPAlertActionStyleDefault handler:^(SPAlertAction * _Nonnull action) {
weakSelf.connectType = ConnectTypeSmartESPTouch;
weakSelf.connectType = ConnectTypeAP;
weakSelf.connectTypeTitle.text = apTitle;
weakSelf.connectTipLbl.text = apTips;
[weakSelf.connectBtn setTitle:@"下一步" forState:UIControlStateNormal];
@@ -429,6 +440,7 @@ extern BOOL isfromCameraView;
{
[self goSettingClick:nil];
}
else
{
[self configWifiForDevice];
@@ -713,6 +725,7 @@ extern BOOL isfromCameraView;
}
- (void)sendToDeviceWithSSIDName:(NSString *)name andSSIDPWD:(NSString *)pwd {
[self connectNotNormalView];
[IFishHotpotUDPHelper sharedInstance].delegate = self;
[[IFishHotpotUDPHelper sharedInstance] broadCastHotspotConnectCommandWith:name pwd:pwd];
}
@@ -726,7 +739,7 @@ extern BOOL isfromCameraView;
[self appendTrakContent:@"=================收到设备答复==================="];
[self appendTrakContent:[NSString stringWithFormat:@"答复状态码:%@", backModel.result]];
[self appendTrakContent:[NSString stringWithFormat:@"答复Mac地址:%@", backModel.senderMacAddress]];
self.macAddress = backModel.senderMacAddress;
self.deviceBssid = backModel.senderMacAddress;
[IFishHotpotUDPHelper sharedInstance].delegate = nil;
[[IFishHotpotUDPHelper sharedInstance] broadCastRestartCommand];
@@ -747,7 +760,7 @@ extern BOOL isfromCameraView;
if (self.isBindingDevice||self.storeNameView) {
return;
}
if (self.macAddress.length == 0) {
if (self.deviceBssid.length == 0) {
return;
}
@@ -758,7 +771,7 @@ extern BOOL isfromCameraView;
}
else
{
[self bindDeviceWithSsid:self.macAddress];
[self bindDeviceWithSsid:self.deviceBssid];
}
}
@@ -844,6 +857,7 @@ extern BOOL isfromCameraView;
{
[self.storeNameView removeFromSuperview];
[self.mask removeFromSuperview];
[self connectNormalView];
}
-(void)showStoreNameView
@@ -859,6 +873,7 @@ extern BOOL isfromCameraView;
store.cancelBlock=^(){
[weakSelf.mask removeFromSuperview];
[weakSelf.storeNameView removeFromSuperview];
[weakSelf connectNormalView];
};
store.sureBlock=^(NSString*name)
@@ -888,6 +903,7 @@ extern BOOL isfromCameraView;
else
{
self.isBindingDevice = YES;
[self connectNotNormalView];
if (self.bindTimer) {
[self.bindTimer invalidate];
self.bindTimer = nil;
@@ -913,7 +929,7 @@ extern BOOL isfromCameraView;
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSLog(@"data:%@",resultDic[@"data"]);
self.isBindingDevice = NO;
self.macAddress = nil;
self.deviceBssid = nil;
if ([resultDic[@"result"] isEqualToString:@"100"]) {
// 保存设备信息
@@ -1016,7 +1032,7 @@ extern BOOL isfromCameraView;
if (self.retryTimes < 10) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self.HUD.labelText = @"自动重连...";
[self bindDeviceWithSsid:self.macAddress];
[self bindDeviceWithSsid:self.deviceBssid];
self.retryTimes += 1;
@@ -18,6 +18,7 @@
<outlet property="connectTypeTitle" destination="D54-Zo-SRM" id="Rrc-ji-Mi6"/>
<outlet property="connectingView" destination="6tu-I5-SeJ" id="WWP-5J-epi"/>
<outlet property="indicator" destination="GB5-YX-lPF" id="6QA-Zj-USC"/>
<outlet property="line" destination="Bwm-2j-Hx2" id="ULt-Jd-CMP"/>
<outlet property="reasonBtn" destination="AbO-MC-LqW" id="ylr-EB-OXe"/>
<outlet property="resultLabel" destination="mZN-ia-LkX" id="GbV-Ue-ryI"/>
<outlet property="shuoMingShuBtn" destination="a2I-Bk-68I" id="iYV-KF-6No"/>
@@ -137,7 +138,7 @@
<action selector="shuoMingShuBtnAction:" destination="-1" eventType="touchUpInside" id="nN3-mz-XkF"/>
</connections>
</button>
<view alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bwm-2j-Hx2" userLabel="LINE4">
<view hidden="YES" alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bwm-2j-Hx2" userLabel="LINE4">
<rect key="frame" x="121.66666666666669" y="162" width="150" height="1"/>
<color key="backgroundColor" systemColor="systemGrayColor"/>
<constraints>