Files
yingmeng-ios-switf/yinmeng-ios/Modules/Auth/VC/AuthForgetVC.swift
2024-02-22 19:59:38 +08:00

222 lines
6.6 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// AuthForgetVC.swift
// yinmeng-ios
//
// Created by MaiMang on 2024/2/21.
//
import UIKit
class AuthForgetVC: BaseViewController, HiddenNavigationBarProtocol {
override func viewDidLoad() {
super.viewDidLoad()
loadSubViews()
}
private func loadSubViews() {
view.addSubview(backImgView)
view.addSubview(backBtn)
view.addSubview(titleLb)
view.addSubview(phoneTextFiled)
view.addSubview(codeView)
view.addSubview(pwdTextFiled)
view.addSubview(confirmBtn)
codeView.addSubview(codeTextFiled)
codeView.addSubview(sepView)
codeView.addSubview(getCodeBtn)
backImgView.snp.makeConstraints { make in
make.edges.equalTo(view)
}
backBtn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 20, height: 20))
make.left.equalTo(view).offset(16)
make.top.equalTo(view).offset(StatusBarHeight + 12)
}
titleLb.snp.makeConstraints { make in
make.centerX.equalTo(view)
make.centerY.equalTo(backBtn)
}
phoneTextFiled.snp.makeConstraints { make in
make.left.right.equalTo(view).inset(36)
make.height.equalTo(52)
make.top.equalTo(view).offset(StatusBarHeight + 94)
}
codeView.snp.makeConstraints { make in
make.left.right.height.equalTo(phoneTextFiled)
make.top.equalTo(phoneTextFiled.snp.bottom).offset(20)
}
codeTextFiled.snp.makeConstraints { make in
make.left.top.bottom.equalTo(codeView)
make.right.equalTo(sepView.snp.left)
}
getCodeBtn.snp.makeConstraints { make in
make.right.equalTo(codeView).offset(-18)
make.top.bottom.equalTo(codeView)
}
sepView.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 1, height: 20))
make.centerY.equalTo(codeView)
make.right.equalTo(getCodeBtn.snp.left).offset(-16)
}
pwdTextFiled.snp.makeConstraints { make in
make.left.right.height.equalTo(phoneTextFiled)
make.top.equalTo(codeView.snp.bottom).offset(20)
}
confirmBtn.snp.makeConstraints { make in
make.left.right.equalTo(view).inset(36)
make.height.equalTo(52)
make.top.equalTo(pwdTextFiled.snp.bottom).offset(40)
}
}
private lazy var backImgView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "auth_login_bg")
imageView.isUserInteractionEnabled = true
imageView.layer.masksToBounds = true
imageView.contentMode = .scaleAspectFill
return imageView
}()
private lazy var backBtn: UIButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "public_back_white"), for: .normal)
button.setImage(UIImage(named: "public_back_white"), for: .selected)
button.addTarget(self, action: #selector(backBtnAction), for: .touchUpInside)
return button
}()
private lazy var titleLb: UILabel = {
let label = UILabel()
label.textColor = .white
label.textAlignment = .center
label.text = "忘记密码"
label.font = UIFont.systemFont(ofSize: 18, weight: .medium)
return label
}()
lazy var phoneTextFiled:UITextField = {
let view = UITextField()
view.textColor = .firstText
view.font = UIFont.systemFont(ofSize: 16)
view.leftViewMode = .always
let leftView = UIView()
leftView.frame = CGRect(x: 0, y: 0, width: 20, height: 52)
leftView.backgroundColor = .clear
view.leftView = leftView
let attribute = NSMutableAttributedString(string: "请输入手机号", attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 16), NSAttributedString.Key.foregroundColor:UIColor.placeholderText])
view.attributedPlaceholder = attribute
view.keyboardType = .numberPad
view.backgroundColor = .white
view.layer.masksToBounds = true
view.layer.cornerRadius = 26
view.addTarget(self, action: #selector(phoneTextFiledDidChange), for: .editingChanged)
return view
}()
private lazy var codeView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.masksToBounds = true
view.layer.cornerRadius = 26
return view
}()
lazy var codeTextFiled:UITextField = {
let view = UITextField()
view.textColor = .firstText
view.font = UIFont.systemFont(ofSize: 16)
view.leftViewMode = .always
let leftView = UIView()
leftView.frame = CGRect(x: 0, y: 0, width: 20, height: 52)
leftView.backgroundColor = .clear
view.leftView = leftView
let attribute = NSMutableAttributedString(string: "请输入验证码", attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 16), NSAttributedString.Key.foregroundColor:UIColor.placeholderText])
view.attributedPlaceholder = attribute
view.addTarget(self, action: #selector(codeTextFiledDidChange), for: .editingChanged)
return view
}()
private lazy var sepView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.sepLine
return view
}()
private lazy var getCodeBtn: UIButton = {
let button = UIButton(type: .custom)
button.setTitle("获取验证码", for: .normal)
button.setTitleColor(ThemeColor(hexStr: "#9552FF"), for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .regular)
button.addTarget(self, action: #selector(getCodeBtnAction), for: .touchUpInside)
return button
}()
lazy var pwdTextFiled:UITextField = {
let view = UITextField()
view.textColor = .firstText
view.font = UIFont.systemFont(ofSize: 16)
view.leftViewMode = .always
let leftView = UIView()
leftView.frame = CGRect(x: 0, y: 0, width: 20, height: 52)
leftView.backgroundColor = .clear
view.leftView = leftView
let attribute = NSMutableAttributedString(string: "请输入密码6-16字符", attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 16), NSAttributedString.Key.foregroundColor:UIColor.placeholderText])
view.attributedPlaceholder = attribute
view.backgroundColor = .white
view.layer.masksToBounds = true
view.layer.cornerRadius = 26
view.addTarget(self, action: #selector(pwdTextFiledDidChange), for: .editingChanged)
return view
}()
private lazy var confirmBtn: UIButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage.gradient(hexsString: ["#FF60FD", "#8974FF", "#69EBFF"]), for: .normal)
button.setImage(UIImage(named: "auth_login_confirm"), for: .normal)
button.layer.masksToBounds = true
button.layer.cornerRadius = 26
button.addTarget(self, action: #selector(confirmBtnAction), for: .touchUpInside)
return button
}()
@objc func backBtnAction() {
self.navigationController?.popViewController(animated: true)
}
@objc func phoneTextFiledDidChange(_ textField: UITextField) {
}
@objc func pwdTextFiledDidChange(_ textField: UITextField) {
}
@objc func codeTextFiledDidChange(_ textField: UITextField) {
}
@objc func getCodeBtnAction() {
}
@objc func confirmBtnAction() {
}
}