|
@@ -27,6 +27,8 @@ class KMSignUpView: KMBaseXibView {
|
|
|
@IBOutlet weak var sendLabel: NSTextField!
|
|
|
@IBOutlet weak var passwordView: NSView!
|
|
|
@IBOutlet weak var passwordTextField: NSTextField!
|
|
|
+ @IBOutlet weak var passwordTextField1: NSSecureTextField!
|
|
|
+
|
|
|
@IBOutlet weak var visibleButton: NSButton!
|
|
|
@IBOutlet weak var passwordErrorLabel: NSTextField!
|
|
|
@IBOutlet weak var stayCheckButton: NSButton!
|
|
@@ -66,13 +68,16 @@ class KMSignUpView: KMBaseXibView {
|
|
|
emailTextField.placeholderString = NSLocalizedString("Please enter Email", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
verifficationTextField.placeholderString = NSLocalizedString("Enter Verification code", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
passwordTextField.placeholderString = NSLocalizedString("Password", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
+ passwordTextField1.placeholderString = NSLocalizedString("Password", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
+ privacyCheckButton.toolTip = NSLocalizedString("Please first agree and check the above agreement.", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
}
|
|
|
|
|
|
private func initializeUI() -> Void {
|
|
|
emailTextField.delegate = self
|
|
|
verifficationTextField.delegate = self
|
|
|
passwordTextField.delegate = self
|
|
|
-
|
|
|
+ passwordTextField1.delegate = self
|
|
|
+
|
|
|
signUpLabel.textColor = NSColor(named: "000000")
|
|
|
signUpLabel.font = NSFont.SFMediumFontWithSize(20)
|
|
|
selectBox1.fillColor = NSColor(named: "4982E6") ?? NSColor.blue
|
|
@@ -162,7 +167,7 @@ class KMSignUpView: KMBaseXibView {
|
|
|
passwordButton.setTitleColor(color: NSColor(named: "42464D") ?? NSColor.black, font: NSFont.SFProTextRegularFont(14))
|
|
|
verifficationView.isHidden = false
|
|
|
passwordView.isHidden = true
|
|
|
- passwordTextField.placeholderString = NSLocalizedString("Enter Verification code", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
+ verifficationTextField.placeholderString = NSLocalizedString("Enter Verification code", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
forgetButton.isHidden = true
|
|
|
} else if viewModel.signUpState == .password {
|
|
|
selectBox1.isHidden = true
|
|
@@ -172,6 +177,7 @@ class KMSignUpView: KMBaseXibView {
|
|
|
verifficationView.isHidden = true
|
|
|
passwordView.isHidden = false
|
|
|
passwordTextField.placeholderString = NSLocalizedString("Password", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
+ passwordTextField1.placeholderString = NSLocalizedString("Password", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
forgetButton.isHidden = false
|
|
|
}
|
|
|
}
|
|
@@ -187,9 +193,15 @@ class KMSignUpView: KMBaseXibView {
|
|
|
|
|
|
private func visibleStateChange() -> Void {
|
|
|
if viewModel.isVisible {
|
|
|
- visibleButton.image = NSImage(named: "PasswordVisible")
|
|
|
+ visibleButton.image = NSImage(named: "passwordUnVisible")
|
|
|
+ passwordTextField.isHidden = false
|
|
|
+ passwordTextField1.isHidden = true
|
|
|
+ passwordTextField.stringValue = viewModel.password
|
|
|
} else {
|
|
|
- visibleButton.image = NSImage(named: "PasswordUnVisible")
|
|
|
+ visibleButton.image = NSImage(named: "passwordVisible")
|
|
|
+ passwordTextField.isHidden = true
|
|
|
+ passwordTextField1.isHidden = false
|
|
|
+ passwordTextField1.stringValue = viewModel.password
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -223,7 +235,7 @@ class KMSignUpView: KMBaseXibView {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- func sendBoxRefresh() -> Void {
|
|
|
+ private func sendBoxRefresh() -> Void {
|
|
|
sendLabel.stringValue = viewModel.sendContent
|
|
|
if viewModel.sendContent == NSLocalizedString("Send", tableName: "MemberCenterLocalizable", comment: "") {
|
|
|
if viewModel.email.count > 0 {
|
|
@@ -347,6 +359,8 @@ extension KMSignUpView: NSTextFieldDelegate {
|
|
|
viewModel.verificationCode = textField!.stringValue
|
|
|
} else if textField == passwordTextField {
|
|
|
viewModel.password = textField!.stringValue
|
|
|
+ } else if textField == passwordTextField1 {
|
|
|
+ viewModel.password = textField!.stringValue
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -358,6 +372,8 @@ extension KMSignUpView: NSTextFieldDelegate {
|
|
|
viewModel.verificationCode = textField!.stringValue
|
|
|
} else if textField == passwordTextField {
|
|
|
viewModel.password = textField!.stringValue
|
|
|
+ } else if textField == passwordTextField1 {
|
|
|
+ viewModel.password = textField!.stringValue
|
|
|
}
|
|
|
}
|
|
|
}
|