From f500e14c0a994487070380c50c85e0929cbc8e63 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 05 一月 2021 10:48:04 +0800
Subject: [PATCH] 2021-01-05 1.更新

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountRegistration.cs |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountRegistration.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountRegistration.cs
index cc13506..fc37361 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountRegistration.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountRegistration.cs
@@ -146,8 +146,8 @@
             Button btnShowPassword = new Button () {
                 X = etPasswrod.Right - Application.GetRealWidth (80),
                 Y = etPasswrod.Y + Application.GetRealHeight (12),
-                Width = Application.GetRealWidth (73),
-                Height = Application.GetRealHeight (60),
+                Width = Application.GetMinRealAverage (73),
+                Height = Application.GetMinRealAverage (60),
                 SelectedImagePath = "CrabtreeAdd/ShowPW.png",
                 UnSelectedImagePath = "CrabtreeAdd/HidePW.png",
                 BorderColor = SkinStyle.Current.Transparent,
@@ -189,8 +189,8 @@
             Button btnShowPassword2 = new Button () {
                 X = etPasswrod.Right - Application.GetRealWidth (80),
                 Y = etConfirmPassword.Y + Application.GetRealHeight (12),
-                Width = Application.GetRealWidth (73),
-                Height = Application.GetRealHeight (60),
+                Width = Application.GetMinRealAverage (73),
+                Height = Application.GetMinRealAverage (60),
                 SelectedImagePath = "CrabtreeAdd/ShowPW.png",
                 UnSelectedImagePath = "CrabtreeAdd/HidePW.png",
                 BorderColor = SkinStyle.Current.Transparent,
@@ -226,8 +226,8 @@
             };
 
             btnOK.MouseUpEventHandler += (sender, e) => {
-                var reg = new Regex ("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$");
-                var ss = reg.Match (etEmailAddress.Text);
+                //var reg = new Regex ("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$");
+                //var ss = reg.Match (etEmailAddress.Text);
 
                 string account = etEmailAddress.Text.Trim ();
                 string passwordText = etPasswrod.Text.Trim ();
@@ -240,15 +240,25 @@
                 } else if (regName.Match (userName).Success) {
                     new Alert ("", "Protect Your Illegal Characters in Name", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                     return;
-                } else if (!ss.Success) {
+                } else if (!CommonUtlis.Current.CheckEmail (account)) {
                     new Alert ("", Language.StringByID (R.MyInternationalizationString.PleaseCheckEmailAddressCorrectly),
                                                        Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                     return;
-                } else if (etPasswrod.Text.Trim ().Length < 6) {
-                    new Alert ("", Language.StringByID (R.MyInternationalizationString.PasswordLenghtTip), Language.StringByID (R.MyInternationalizationString.Close)).Show ();
-                    return;
-                } else if (etPasswrod.Text == "" && etConfirmPassword.Text == "") {
+                }
+
+               
+
+                if (etPasswrod.Text == "" && etConfirmPassword.Text == "") {
                     new Alert ("", Language.StringByID (R.MyInternationalizationString.PleaseWriteTheCompleteContent), Language.StringByID (R.MyInternationalizationString.Close)).Show ();
+                    return;
+                } else if (passwordText.Contains(userName)) {
+                    //瀵嗙爜涓嶈兘鍖呭惈鐢ㄦ埛鍚�
+                    new Alert ("", ErrorCode.PasswordNotUsername,
+                               Language.StringByID (R.MyInternationalizationString.Close)).Show ();
+                    return;
+                } else if (!CommonUtlis.Current.CheckPassword(etPasswrod.Text.Trim ())) {
+                    new Alert ("", ErrorCode.PasswordStrengthNotMatch,
+                               Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                     return;
                 } else if (etPasswrod.Text.Trim () != etConfirmPassword.Text.Trim ()) {
                     new Alert ("", Language.StringByID (R.MyInternationalizationString.RepeatPasswordsDidNotmatch),
@@ -340,7 +350,7 @@
             //2020-01-06 浠hˉ鍏�
             if (stateCodeStr == "AccountExists") {
                 mes = "This account has been registered.";
-            } else if (stateCodeStr == ErrorCode.AccountYesRegisterNoIsverify) {
+            } else if (stateCodeStr == "AccountYesRegisterNoIsverify") {
                 mes = ErrorCode.AccountYesRegisterNoIsverify;
             } else if (stateCodeStr == ErrorCode.NetworkError) {
                 mes = ErrorCode.NetworkError;

--
Gitblit v1.8.0