|
|
@@ -39,105 +39,106 @@
|
|
|
|
|
|
logoSelectView = [[LogoSelectView alloc] init];
|
|
|
logoSelectView.delegate = self;
|
|
|
+ //logoSelectView.backgroundColor = [UIColor redColor];
|
|
|
[self.view addSubview:logoSelectView];
|
|
|
[logoSelectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.height.mas_equalTo(226);
|
|
|
+ make.height.mas_equalTo(256);
|
|
|
make.left.mas_equalTo(0);
|
|
|
make.right.mas_equalTo(0);
|
|
|
make.top.equalTo(self.navBarBGView.mas_bottom);
|
|
|
}];
|
|
|
|
|
|
/*修改入口密码*/
|
|
|
- UILabel *pwdLabel = [[UILabel alloc] init];
|
|
|
- [pwdLabel setFont:[UIFont boldSystemFontOfSize:16.f]];
|
|
|
- [pwdLabel setTextColor:HW0A132BColor];
|
|
|
- [pwdLabel setText:NSLocalizedString(@"logo_set_pwd_tips",nil)];
|
|
|
-
|
|
|
- [self.view addSubview:pwdLabel];
|
|
|
- [pwdLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(logoSelectView.mas_bottom).offset(24.f);
|
|
|
- make.left.mas_equalTo(16.f);
|
|
|
- make.right.mas_equalTo(-16.f);
|
|
|
- make.height.mas_equalTo(20.f);
|
|
|
- }];
|
|
|
-
|
|
|
- NSString *placeholderStr = NSLocalizedString(@"logo_input_pwd_tips",nil);
|
|
|
- NSString *placeholderStr1 = NSLocalizedString(@"logo_input_pwd_again_tips",nil);
|
|
|
- CGFloat fontSize = 13.f;
|
|
|
- CGFloat textfontSize = 16.f;
|
|
|
- CGFloat inputTextFieldH = 48.f;
|
|
|
- NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
|
|
|
- style.alignment = NSTextAlignmentLeft;
|
|
|
-
|
|
|
- NSAttributedString *attri = nil;
|
|
|
- NSAttributedString *attri1 = nil;
|
|
|
- NSString *verphone = [iPhone phoneVersion];
|
|
|
-
|
|
|
- if ([verphone isEqualToString:@"10.3.3"]){
|
|
|
- attri = [[NSAttributedString alloc] initWithString:placeholderStr
|
|
|
- attributes:@{NSForegroundColorAttributeName:COLOR_PACEHOLDER,
|
|
|
- NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
|
|
|
- NSBaselineOffsetAttributeName:[NSNumber numberWithFloat:-1.5],
|
|
|
- NSParagraphStyleAttributeName:style}];
|
|
|
- attri1 = [[NSAttributedString alloc] initWithString:placeholderStr1
|
|
|
- attributes:@{NSForegroundColorAttributeName:COLOR_PACEHOLDER,
|
|
|
- NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
|
|
|
- NSBaselineOffsetAttributeName:[NSNumber numberWithFloat:-1.5],
|
|
|
- NSParagraphStyleAttributeName:style}];
|
|
|
- }else{
|
|
|
- attri = [[NSAttributedString alloc] initWithString:placeholderStr
|
|
|
- attributes:@{NSForegroundColorAttributeName:COLOR_PACEHOLDER,
|
|
|
- NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
|
|
|
- NSParagraphStyleAttributeName:style}];
|
|
|
- attri1 = [[NSAttributedString alloc] initWithString:placeholderStr1
|
|
|
- attributes:@{NSForegroundColorAttributeName:COLOR_PACEHOLDER,
|
|
|
- NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
|
|
|
- NSBaselineOffsetAttributeName:[NSNumber numberWithFloat:-1.5],
|
|
|
- NSParagraphStyleAttributeName:style}];
|
|
|
- }
|
|
|
-
|
|
|
- pwdTextField = [[UITextField alloc] init];
|
|
|
- pwdTextField.delegate = self;
|
|
|
- [pwdTextField setNl_maxLength:4];
|
|
|
- [pwdTextField setKeyboardType:(UIKeyboardTypeNumberPad)];
|
|
|
- [self.view addSubview:pwdTextField];
|
|
|
- [pwdTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(pwdLabel.mas_bottom).offset(12.f);
|
|
|
- make.left.mas_equalTo(16.f);
|
|
|
- make.right.mas_equalTo(-16.f);
|
|
|
- make.height.mas_equalTo(inputTextFieldH);
|
|
|
- }];
|
|
|
- pwdTextField.attributedPlaceholder = attri;
|
|
|
- pwdTextField.layer.cornerRadius = 8.f;
|
|
|
- [pwdTextField setFont:[UIFont systemFontOfSize:textfontSize]];
|
|
|
- [pwdTextField setTextColor:HW0A132BColor];
|
|
|
- [pwdTextField setBackgroundColor:[UIColor whiteColor]];
|
|
|
- UIView *leftView = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, 15, inputTextFieldH))];
|
|
|
- [leftView setBackgroundColor:[UIColor clearColor]];
|
|
|
- [pwdTextField setLeftView:leftView];
|
|
|
- [pwdTextField setLeftViewMode:(UITextFieldViewModeAlways)];
|
|
|
-
|
|
|
- pwdAgainTextField = [[UITextField alloc] init];
|
|
|
- pwdAgainTextField.delegate = self;
|
|
|
- [pwdAgainTextField setNl_maxLength:4];
|
|
|
- [pwdAgainTextField setKeyboardType:(UIKeyboardTypeNumberPad)];
|
|
|
- [self.view addSubview:pwdAgainTextField];
|
|
|
- [pwdAgainTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(pwdTextField.mas_bottom).offset(15.f);
|
|
|
- make.left.mas_equalTo(16.f);
|
|
|
- make.right.mas_equalTo(-16.f);
|
|
|
- make.height.mas_equalTo(inputTextFieldH);
|
|
|
- }];
|
|
|
- pwdAgainTextField.attributedPlaceholder = attri1;
|
|
|
- pwdAgainTextField.layer.cornerRadius = 8.f;
|
|
|
- [pwdAgainTextField setFont:[UIFont systemFontOfSize:textfontSize]];
|
|
|
- [pwdAgainTextField setTextColor:HW0A132BColor];
|
|
|
- [pwdAgainTextField setBackgroundColor:[UIColor whiteColor]];
|
|
|
- UIView *leftView1 = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, 15, inputTextFieldH))];
|
|
|
- [leftView1 setBackgroundColor:[UIColor clearColor]];
|
|
|
- [pwdAgainTextField setLeftView:leftView1];
|
|
|
- [pwdAgainTextField setLeftViewMode:(UITextFieldViewModeAlways)];
|
|
|
-
|
|
|
+// UILabel *pwdLabel = [[UILabel alloc] init];
|
|
|
+// [pwdLabel setFont:[UIFont boldSystemFontOfSize:16.f]];
|
|
|
+// [pwdLabel setTextColor:HW0A132BColor];
|
|
|
+// [pwdLabel setText:NSLocalizedString(@"logo_set_pwd_tips",nil)];
|
|
|
+//
|
|
|
+// [self.view addSubview:pwdLabel];
|
|
|
+// [pwdLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(logoSelectView.mas_bottom).offset(24.f);
|
|
|
+// make.left.mas_equalTo(16.f);
|
|
|
+// make.right.mas_equalTo(-16.f);
|
|
|
+// make.height.mas_equalTo(20.f);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// NSString *placeholderStr = NSLocalizedString(@"logo_input_pwd_tips",nil);
|
|
|
+// NSString *placeholderStr1 = NSLocalizedString(@"logo_input_pwd_again_tips",nil);
|
|
|
+// CGFloat fontSize = 13.f;
|
|
|
+// CGFloat textfontSize = 16.f;
|
|
|
+// CGFloat inputTextFieldH = 48.f;
|
|
|
+// NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
|
|
|
+// style.alignment = NSTextAlignmentLeft;
|
|
|
+//
|
|
|
+// NSAttributedString *attri = nil;
|
|
|
+// NSAttributedString *attri1 = nil;
|
|
|
+// NSString *verphone = [iPhone phoneVersion];
|
|
|
+//
|
|
|
+// if ([verphone isEqualToString:@"10.3.3"]){
|
|
|
+// attri = [[NSAttributedString alloc] initWithString:placeholderStr
|
|
|
+// attributes:@{NSForegroundColorAttributeName:COLOR_PACEHOLDER,
|
|
|
+// NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
|
|
|
+// NSBaselineOffsetAttributeName:[NSNumber numberWithFloat:-1.5],
|
|
|
+// NSParagraphStyleAttributeName:style}];
|
|
|
+// attri1 = [[NSAttributedString alloc] initWithString:placeholderStr1
|
|
|
+// attributes:@{NSForegroundColorAttributeName:COLOR_PACEHOLDER,
|
|
|
+// NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
|
|
|
+// NSBaselineOffsetAttributeName:[NSNumber numberWithFloat:-1.5],
|
|
|
+// NSParagraphStyleAttributeName:style}];
|
|
|
+// }else{
|
|
|
+// attri = [[NSAttributedString alloc] initWithString:placeholderStr
|
|
|
+// attributes:@{NSForegroundColorAttributeName:COLOR_PACEHOLDER,
|
|
|
+// NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
|
|
|
+// NSParagraphStyleAttributeName:style}];
|
|
|
+// attri1 = [[NSAttributedString alloc] initWithString:placeholderStr1
|
|
|
+// attributes:@{NSForegroundColorAttributeName:COLOR_PACEHOLDER,
|
|
|
+// NSFontAttributeName:[UIFont systemFontOfSize:fontSize],
|
|
|
+// NSBaselineOffsetAttributeName:[NSNumber numberWithFloat:-1.5],
|
|
|
+// NSParagraphStyleAttributeName:style}];
|
|
|
+// }
|
|
|
+//
|
|
|
+// pwdTextField = [[UITextField alloc] init];
|
|
|
+// pwdTextField.delegate = self;
|
|
|
+// [pwdTextField setNl_maxLength:4];
|
|
|
+// [pwdTextField setKeyboardType:(UIKeyboardTypeNumberPad)];
|
|
|
+// [self.view addSubview:pwdTextField];
|
|
|
+// [pwdTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(pwdLabel.mas_bottom).offset(12.f);
|
|
|
+// make.left.mas_equalTo(16.f);
|
|
|
+// make.right.mas_equalTo(-16.f);
|
|
|
+// make.height.mas_equalTo(inputTextFieldH);
|
|
|
+// }];
|
|
|
+// pwdTextField.attributedPlaceholder = attri;
|
|
|
+// pwdTextField.layer.cornerRadius = 8.f;
|
|
|
+// [pwdTextField setFont:[UIFont systemFontOfSize:textfontSize]];
|
|
|
+// [pwdTextField setTextColor:HW0A132BColor];
|
|
|
+// [pwdTextField setBackgroundColor:[UIColor whiteColor]];
|
|
|
+// UIView *leftView = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, 15, inputTextFieldH))];
|
|
|
+// [leftView setBackgroundColor:[UIColor clearColor]];
|
|
|
+// [pwdTextField setLeftView:leftView];
|
|
|
+// [pwdTextField setLeftViewMode:(UITextFieldViewModeAlways)];
|
|
|
+//
|
|
|
+// pwdAgainTextField = [[UITextField alloc] init];
|
|
|
+// pwdAgainTextField.delegate = self;
|
|
|
+// [pwdAgainTextField setNl_maxLength:4];
|
|
|
+// [pwdAgainTextField setKeyboardType:(UIKeyboardTypeNumberPad)];
|
|
|
+// [self.view addSubview:pwdAgainTextField];
|
|
|
+// [pwdAgainTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(pwdTextField.mas_bottom).offset(15.f);
|
|
|
+// make.left.mas_equalTo(16.f);
|
|
|
+// make.right.mas_equalTo(-16.f);
|
|
|
+// make.height.mas_equalTo(inputTextFieldH);
|
|
|
+// }];
|
|
|
+// pwdAgainTextField.attributedPlaceholder = attri1;
|
|
|
+// pwdAgainTextField.layer.cornerRadius = 8.f;
|
|
|
+// [pwdAgainTextField setFont:[UIFont systemFontOfSize:textfontSize]];
|
|
|
+// [pwdAgainTextField setTextColor:HW0A132BColor];
|
|
|
+// [pwdAgainTextField setBackgroundColor:[UIColor whiteColor]];
|
|
|
+// UIView *leftView1 = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, 15, inputTextFieldH))];
|
|
|
+// [leftView1 setBackgroundColor:[UIColor clearColor]];
|
|
|
+// [pwdAgainTextField setLeftView:leftView1];
|
|
|
+// [pwdAgainTextField setLeftViewMode:(UITextFieldViewModeAlways)];
|
|
|
+//
|
|
|
/*确认按钮*/
|
|
|
okBtn = [[UIButton alloc] init];
|
|
|
CGFloat okBtn_W = SCREEN_W - 2*16.f;
|
|
|
@@ -157,7 +158,8 @@
|
|
|
[okBtn.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
|
|
|
[self.view addSubview:okBtn];
|
|
|
[okBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(pwdAgainTextField.mas_bottom).offset(16.f);
|
|
|
+ //make.top.equalTo(pwdAgainTextField.mas_bottom).offset(16.f);
|
|
|
+ make.top.equalTo(logoSelectView.mas_bottom).offset(30.f);
|
|
|
make.centerX.equalTo(self.view.mas_centerX);
|
|
|
make.width.mas_equalTo(okBtn_W);
|
|
|
make.height.mas_equalTo(48);
|
|
|
@@ -211,20 +213,20 @@
|
|
|
}
|
|
|
|
|
|
- (void)okBtnPressed{
|
|
|
- if (pwdTextField.text.length > 0 || pwdAgainTextField.text.length > 0){
|
|
|
- if (![pwdTextField.text isEqualToString:pwdAgainTextField.text] || pwdAgainTextField.text.length != 4 ){
|
|
|
- [[iToast makeText:NSLocalizedString(@"logo_input_pwd_no_same_tips",nil)] show];
|
|
|
- return;
|
|
|
- }else{
|
|
|
- /*设置密码*/
|
|
|
- NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
|
|
|
- NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:deviceDict];
|
|
|
- [dict setObject:pwdAgainTextField.text forKey:Const_Have_Add_Device_PWD];
|
|
|
- [HWDataManager setObjectWithKey:Const_Have_Add_Device value:dict];
|
|
|
-
|
|
|
- [[iToast makeText:NSLocalizedString(@"logo_set_pwd_success",nil)] show];
|
|
|
- }
|
|
|
- }
|
|
|
+// if (pwdTextField.text.length > 0 || pwdAgainTextField.text.length > 0){
|
|
|
+// if (![pwdTextField.text isEqualToString:pwdAgainTextField.text] || pwdAgainTextField.text.length != 4 ){
|
|
|
+// [[iToast makeText:NSLocalizedString(@"logo_input_pwd_no_same_tips",nil)] show];
|
|
|
+// return;
|
|
|
+// }else{
|
|
|
+// /*设置密码*/
|
|
|
+// NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
|
|
|
+// NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:deviceDict];
|
|
|
+// [dict setObject:pwdAgainTextField.text forKey:Const_Have_Add_Device_PWD];
|
|
|
+// [HWDataManager setObjectWithKey:Const_Have_Add_Device value:dict];
|
|
|
+//
|
|
|
+// [[iToast makeText:NSLocalizedString(@"logo_set_pwd_success",nil)] show];
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
if (logoSelectView.selectIndex == 1){
|
|
|
/*设置图标*/
|