|
@@ -8,6 +8,8 @@
|
|
|
#import "LoginType1ViewController.h"
|
|
|
#import "ScanToLoginViewController.h"
|
|
|
#import "GuideViewController.h"
|
|
|
+#import "IQKeyboardManager.h"
|
|
|
+#import "CustomerWebViewController.h"
|
|
|
|
|
|
@interface LoginType1ViewController ()<UITextViewDelegate,UITextFieldDelegate>
|
|
|
@property(nonatomic,strong) UITextField *accountTF;
|
|
@@ -23,8 +25,31 @@
|
|
|
// Do any additional setup after loading the view.
|
|
|
|
|
|
[self drawAnyView];
|
|
|
+
|
|
|
+ [self setupKeyboardManager];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)viewWillAppear:(BOOL)animated
|
|
|
+{
|
|
|
+ [super viewWillAppear:animated];
|
|
|
+ IQKeyboardManager *keyboardManager = [IQKeyboardManager sharedManager];
|
|
|
+ keyboardManager.enable = YES;
|
|
|
}
|
|
|
|
|
|
+- (void)viewWillDisappear:(BOOL)animated
|
|
|
+{
|
|
|
+ [super viewWillDisappear:animated];
|
|
|
+ IQKeyboardManager *keyboardManager = [IQKeyboardManager sharedManager];
|
|
|
+ keyboardManager.enable = NO;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)setupKeyboardManager {
|
|
|
+ IQKeyboardManager *keyboardManager = [IQKeyboardManager sharedManager];
|
|
|
+ keyboardManager.enable = YES;
|
|
|
+ keyboardManager.shouldResignOnTouchOutside = YES;
|
|
|
+ keyboardManager.shouldShowToolbarPlaceholder = NO;
|
|
|
+ keyboardManager.enableAutoToolbar = NO;
|
|
|
+}
|
|
|
|
|
|
- (void)drawAnyView{
|
|
|
[self.navigationBar setHidden:YES];
|
|
@@ -62,41 +87,46 @@
|
|
|
}];
|
|
|
|
|
|
NSString *curTitle = NSLocalizedString(@"input_your_account",nil);
|
|
|
- UILabel *tipLabel = [[UILabel alloc] init];
|
|
|
- tipLabel.text = curTitle;
|
|
|
- tipLabel.textColor = [UIColor hwColor:@"#999999"];
|
|
|
- tipLabel.font = [UIFont systemFontOfSize:14.0];
|
|
|
- [bgView addSubview:tipLabel];
|
|
|
-
|
|
|
- [tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.left.mas_equalTo(15);
|
|
|
- make.height.mas_equalTo(30);
|
|
|
- make.centerY.mas_equalTo(0);
|
|
|
- }];
|
|
|
-
|
|
|
- UIButton *scanBut = [[UIButton alloc] init];
|
|
|
+// UILabel *tipLabel = [[UILabel alloc] init];
|
|
|
+// tipLabel.text = curTitle;
|
|
|
+// tipLabel.textColor = [UIColor hwColor:@"#999999"];
|
|
|
+// tipLabel.font = [UIFont systemFontOfSize:14.0];
|
|
|
+// [bgView addSubview:tipLabel];
|
|
|
+//
|
|
|
+// [tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.left.mas_equalTo(15);
|
|
|
+// make.height.mas_equalTo(30);
|
|
|
+// make.centerY.mas_equalTo(0);
|
|
|
+// }];
|
|
|
+
|
|
|
+ UIButton *scanBut = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
|
|
|
[scanBut setImage:[UIImage imageNamed:@"login_scan"] forState:UIControlStateNormal];
|
|
|
[scanBut addTarget:self action:@selector(didClickScanButtonFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
[bgView addSubview:scanBut];
|
|
|
//scanBut.backgroundColor = [UIColor greenColor];
|
|
|
|
|
|
- [scanBut mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.mas_equalTo(0);
|
|
|
- make.width.mas_equalTo(50);
|
|
|
- make.height.mas_equalTo(50);
|
|
|
- make.top.mas_equalTo(0);
|
|
|
- }];
|
|
|
+// [scanBut mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.mas_equalTo(0);
|
|
|
+// make.width.mas_equalTo(50);
|
|
|
+// make.height.mas_equalTo(50);
|
|
|
+// make.top.mas_equalTo(0);
|
|
|
+// }];
|
|
|
|
|
|
_accountTF = [[UITextField alloc] init];
|
|
|
+ _accountTF.placeholder = curTitle;
|
|
|
_accountTF.textColor = [UIColor blackColor];
|
|
|
- _accountTF.font = [UIFont systemFontOfSize:12];
|
|
|
+ _accountTF.font = [UIFont systemFontOfSize:14];
|
|
|
_accountTF.delegate = self;
|
|
|
_accountTF.keyboardType = UIKeyboardTypeNamePhonePad;
|
|
|
+ _accountTF.rightView = scanBut;
|
|
|
+ _accountTF.rightViewMode = UITextFieldViewModeAlways;
|
|
|
[bgView addSubview:_accountTF];
|
|
|
|
|
|
[_accountTF mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.left.equalTo(tipLabel.mas_right).offset(5);
|
|
|
- make.right.equalTo(scanBut.mas_left).offset(0);
|
|
|
+// make.left.equalTo(tipLabel.mas_right).offset(5);
|
|
|
+// make.right.equalTo(scanBut.mas_left).offset(0);
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
make.height.mas_equalTo(50);
|
|
|
make.top.mas_equalTo(0);
|
|
|
}];
|
|
@@ -147,7 +177,7 @@
|
|
|
contentTV.backgroundColor = [UIColor whiteColor];
|
|
|
contentTV.textColor = [UIColor hwColor:@"#999999"];
|
|
|
contentTV.delegate = self;
|
|
|
- contentTV.editable = NO; //必须禁止输入,否则点击将弹出输入键盘
|
|
|
+ contentTV.editable = YES; //必须禁止输入,否则点击将弹出输入键盘
|
|
|
contentTV.scrollEnabled = NO;
|
|
|
[self.view addSubview:contentTV];
|
|
|
//contentTV.backgroundColor = [UIColor greenColor];
|
|
@@ -162,7 +192,7 @@
|
|
|
// 创建长按手势识别器
|
|
|
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress)];
|
|
|
// 设置长按手势的最小按压时间
|
|
|
- longPress.minimumPressDuration = 0.5; // 2
|
|
|
+ longPress.minimumPressDuration = 1.3; // 2
|
|
|
// 将手势识别器添加到视图上
|
|
|
[contentTV addGestureRecognizer:longPress];
|
|
|
|
|
@@ -207,12 +237,13 @@
|
|
|
#pragma mark ---- textView Delegate ----
|
|
|
- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction
|
|
|
{
|
|
|
-
|
|
|
+ HLog(@"按事件")
|
|
|
if([[URL scheme] isEqualToString:@"didclick1"]){
|
|
|
-
|
|
|
-// if(_didClickButtonFun){
|
|
|
-// _didClickButtonFun(10);
|
|
|
-// }
|
|
|
+ [self ruleBtnClick];
|
|
|
+ return NO;
|
|
|
+ }
|
|
|
+ else if([[URL scheme] isEqualToString:@"didclick2"]){
|
|
|
+ [self privateBtnClick];
|
|
|
return NO;
|
|
|
}
|
|
|
|
|
@@ -220,6 +251,11 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+-(BOOL)textViewShouldBeginEditing:(UITextView *)textView
|
|
|
+{
|
|
|
+ return NO;
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark 拦截长按事件
|
|
|
- (void)longPress{
|
|
|
HLog(@"拦截长按事件")
|
|
@@ -381,4 +417,25 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+#pragma mark 用户协议
|
|
|
+- (void)ruleBtnClick {
|
|
|
+//https://cliys.armclouding.com/h5/protocol/protocol.html?agreementCoding=YSZYHXY2002&type=1
|
|
|
+// [self gotoProtocolWKWebVCByPush:YES];
|
|
|
+ CustomerWebViewController *vc = [[CustomerWebViewController alloc] init];
|
|
|
+ vc.titleStr = NSLocalizedString(@"app_update_use_deal",nil);
|
|
|
+ NSString *url = @"https://cliys.armclouding.com/h5/protocol/protocol.html?agreementCoding=YSZYHXY2003&type=1";//[NSString stringWithFormat:@"%@/h5/protocol/protocol.html?agreementCoding=YSZYHXY2002&type=1", CloudService];
|
|
|
+ vc.webUrl = url;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 隐私协议
|
|
|
+- (void)privateBtnClick {
|
|
|
+
|
|
|
+// [self gotoPrivateProtocolWKWebVCByPush:YES];
|
|
|
+ CustomerWebViewController *vc = [[CustomerWebViewController alloc] init];
|
|
|
+ vc.titleStr = NSLocalizedString(@"app_update_private",nil);
|
|
|
+ NSString *url = @"https://cliys.armclouding.com/h5/protocol/protocol.html?agreementCoding=YSZYSXY2002&type=1";//[NSString stringWithFormat:@"%@/h5/protocol/protocol.html?agreementCoding=YSZYSXY2001&type=1", CloudService];
|
|
|
+ vc.webUrl = url;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
@end
|