萤石云 iOSSDK,移植跨平台相关工程
chenqiyang
2023-04-06 eeb0fad802f9558eb74c6964480b38b49e016c45
EZSDK/EZSDK/EZ/UIViewControllers/EZAPWiFiConfigViewController.m
@@ -23,6 +23,14 @@
@property (weak, nonatomic) IBOutlet UILabel *stepTwoLabel;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *processingIndicator;
@property (weak, nonatomic) IBOutlet UIButton *addBtn;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *stepThreeLable;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *tipLable;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *step1TipLable;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *passwordLable;
@property (unsafe_unretained, nonatomic) IBOutlet UILabel *nameL;
@property (unsafe_unretained, nonatomic) IBOutlet UIButton *toCopBtn;
@property (unsafe_unretained, nonatomic) IBOutlet UIButton *toSetBtn;
@property (nonatomic,copy) NSString *devicWifiName;
@property (nonatomic,strong) NSTimer *timer;
@@ -61,9 +69,12 @@
- (void) initSubviews
{
    self.processingIndicator.hidden = YES;
    self.devicWifiName = [NSString stringWithFormat:@"EZVIZ_%@",[GlobalKit shareKit].deviceSerialNo];
//    self.devicWifiName = [NSString stringWithFormat:@"EZVIZ_%@",[GlobalKit shareKit].deviceSerialNo];
    self.devicWifiName = [NSString stringWithFormat:@"%@_%@",[GlobalKit shareKit].WiFiConfigPrefix,[GlobalKit shareKit].deviceSerialNo];
    self.wifiNameLabel.text = self.devicWifiName;
    self.wifiPwdLabel.text = [NSString stringWithFormat:@"EZVIZ_%@",[GlobalKit shareKit].deviceVerifyCode];
//    self.wifiPwdLabel.text = [NSString stringWithFormat:@"EZVIZ_%@",[GlobalKit shareKit].deviceVerifyCode];
    self.wifiPwdLabel.text = [NSString stringWithFormat:@"%@_%@",[GlobalKit shareKit].WiFiConfigPrefix,[GlobalKit shareKit].deviceVerifyCode];
    NSString *str = [NSString stringWithFormat:NSLocalizedString(@"wifi_step_two_msg",@"进入手机系统Wi-Fi设置界面,选择名称为%@的网络,用提示的密码进行连接"),self.devicWifiName];
    NSMutableAttributedString *aStr = [[NSMutableAttributedString alloc] initWithString:str];
    
@@ -78,6 +89,31 @@
    [aStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [aStr length])];
    
    self.stepTwoLabel.attributedText = aStr;
    //第三步
    NSString *stepThreeStr=HDLEZLocallizedString(@"wifi_config_step_three");
    NSString *tipStr=HDLEZLocallizedString(@"wifi_config_step_three_tip");
    NSString *step3FinalStr=[NSString stringWithFormat:@"%@  %@",stepThreeStr,tipStr];
    NSMutableAttributedString *aTipStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@  %@",stepThreeStr,tipStr]];
    //关键字符颜色调整
    [aTipStr addAttribute:NSForegroundColorAttributeName
                 value:[UIColor redColor]
                 range:[step3FinalStr rangeOfString:tipStr]];
    self.stepThreeLable.attributedText = aTipStr;
    self.stepThreeLable.adjustsFontSizeToFitWidth=YES;
    //设置国际化语言
    self.tipLable.text=HDLEZLocallizedString(@"wifi_config_tip");
    self.tipLable.adjustsFontSizeToFitWidth=YES;
    self.step1TipLable.text=HDLEZLocallizedString(@"wifi_config_step_1_tips");
    self.nameL.text=HDLEZLocallizedString(@"wifi_config_name");
    self.passwordLable.text=HDLEZLocallizedString(@"wifi_config_step_2_password");
    [self.toCopBtn setTitle:HDLEZLocallizedString(@"wifi_config_copy_pwd") forState:UIControlStateNormal];
    [self.toSetBtn setTitle:HDLEZLocallizedString(@"wifi_config_to_setting") forState:UIControlStateNormal];
    [self.addBtn setTitle:HDLEZLocallizedString(@"wifi_ap_add_device_title") forState:UIControlStateNormal];
}
-(void) startAction