Commit 097062e8 authored by lujunye's avatar lujunye

键盘

parent 9623b199
...@@ -15,7 +15,7 @@ protocol loginDelegate { ...@@ -15,7 +15,7 @@ protocol loginDelegate {
func successLogin() func successLogin()
} }
class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDelegate { class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDelegate {
var delegate :loginDelegate? var delegate :loginDelegate?
//MARK: - 输入账号、密码、验证码 //MARK: - 输入账号、密码、验证码
@IBOutlet weak var loginBtn: LGButton! @IBOutlet weak var loginBtn: LGButton!
...@@ -31,7 +31,7 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel ...@@ -31,7 +31,7 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
self.view.backgroundColor = UIColor(named:"白色背景色") self.view.backgroundColor = UIColor(named:"白色背景色")
} }
override func viewDidLoad() { override func viewDidLoad() {
...@@ -53,8 +53,21 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel ...@@ -53,8 +53,21 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
codeV.delegate = self codeV.delegate = self
codeView.addSubview(codeV); codeView.addSubview(codeV);
codeV.changeCaptcha() codeV.changeCaptcha()
passTF.keyboardType = .default
codeTF.keyboardType = .default
codeTF.autocorrectionType = .no
codeTF.autocapitalizationType = .none
passTF.autocorrectionType = .no
passTF.autocapitalizationType = .none
phoneTF.autocorrectionType = .no
phoneTF.autocapitalizationType = .none
passTF.isSecureTextEntry = true
shBtn.isSelected = false
} }
//MARK: -跳转忘记密码,登录 //MARK: -跳转忘记密码,登录
@IBAction func forgetPasswordAction(_ sender: Any) { @IBAction func forgetPasswordAction(_ sender: Any) {
let alertView = GeliAlertView(frame: self.view.window!.bounds) let alertView = GeliAlertView(frame: self.view.window!.bounds)
...@@ -65,7 +78,7 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel ...@@ -65,7 +78,7 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
} }
func sureGeliAlertViewAction(sender: UIButton) { func sureGeliAlertViewAction(sender: UIButton) {
UIApplication.shared.openURL(NSURL.init(string: "tel://020-81338860")! as URL) UIApplication.shared.openURL(NSURL.init(string: "tel://020-81338860")! as URL)
} }
@IBAction func shPassAction(_ sender: UIButton) { @IBAction func shPassAction(_ sender: UIButton) {
...@@ -82,8 +95,8 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel ...@@ -82,8 +95,8 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
@IBAction func loginAction(_ sender: Any) { @IBAction func loginAction(_ sender: Any) {
//MARK:--登录接口样式 //MARK:--登录接口样式
print("\(codeNum) == \(codeTF.text)") print("\(codeNum) == \(codeTF.text)")
// zxpf // zxpf
// 123456 // 123456
if phoneTF.text?.count == 0 { if phoneTF.text?.count == 0 {
HUD.flash(.label("请填写用户名"), delay: 1.2) HUD.flash(.label("请填写用户名"), delay: 1.2)
return return
...@@ -107,7 +120,7 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel ...@@ -107,7 +120,7 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
self.delegate?.successLogin() self.delegate?.successLogin()
JPUSHService.setAlias(self.phoneTF.text, completion: { (resCode, alias, num) in JPUSHService.setAlias(self.phoneTF.text, completion: { (resCode, alias, num) in
}, seq: 1433223) }, seq: 1433223)
}) { (error) in }) { (error) in
self.loginBtn.isLoading = false self.loginBtn.isLoading = false
...@@ -115,8 +128,8 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel ...@@ -115,8 +128,8 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
}else{ }else{
HUD.flash(.label("请填写正确的验证码"), delay: 1.2) HUD.flash(.label("请填写正确的验证码"), delay: 1.2)
} }
} }
} }
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<constraint firstAttribute="width" constant="1" id="U0P-VY-p7C"/> <constraint firstAttribute="width" constant="1" id="U0P-VY-p7C"/>
</constraints> </constraints>
</view> </view>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入您的用户名" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="xEL-ml-rz8"> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入您的用户名" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="xEL-ml-rz8">
<rect key="frame" x="123.5" y="11.5" width="209" height="34"/> <rect key="frame" x="123.5" y="11.5" width="209" height="34"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="34" id="w0K-cg-k4c"/> <constraint firstAttribute="height" constant="34" id="w0K-cg-k4c"/>
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<constraint firstAttribute="width" constant="1" id="Vpp-aL-eh1"/> <constraint firstAttribute="width" constant="1" id="Vpp-aL-eh1"/>
</constraints> </constraints>
</view> </view>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ipW-Al-eG6"> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入密码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="ipW-Al-eG6">
<rect key="frame" x="123.5" y="11" width="167" height="34"/> <rect key="frame" x="123.5" y="11" width="167" height="34"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="34" id="RUR-1C-sOu"/> <constraint firstAttribute="height" constant="34" id="RUR-1C-sOu"/>
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
<constraint firstAttribute="height" constant="22" id="TBL-ev-Ois"/> <constraint firstAttribute="height" constant="22" id="TBL-ev-Ois"/>
</constraints> </constraints>
</view> </view>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入验证码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="qfV-go-Nf1"> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入验证码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="qfV-go-Nf1">
<rect key="frame" x="123.5" y="11" width="109" height="34"/> <rect key="frame" x="123.5" y="11" width="109" height="34"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="34" id="g6O-S7-x6a"/> <constraint firstAttribute="height" constant="34" id="g6O-S7-x6a"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment