From 06696e6f225733a60b03eea4a7c6374053d92c1d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 14 四月 2020 14:15:35 +0800
Subject: [PATCH] 20200414

---
 HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs |  193 +++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 149 insertions(+), 44 deletions(-)

diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
index 237a1e9..fa2cae8 100644
--- a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
@@ -137,7 +137,7 @@
                         //閭鏂瑰紡-楠岃瘉閭鏄惁姝g‘
                         var reg = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$");
                         var mFalg = reg.Match(etAccount.Text.Trim());
-                        if (!mFalg.Success || (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11))
+                        if (!mFalg.Success )
                         {
                             btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                             btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
@@ -170,7 +170,7 @@
                     btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
                     btnPasswordViewBottomLine.Height = Application.GetRealHeight(1);
                     //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰
-                    if (etPassword.Text.Trim().Length < 6)
+                    if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13)
                     {
                         new Tip()
                         {
@@ -262,57 +262,65 @@
             {
                 if (btnGetVerificationCode.IsSelected)
                 {
+                    //鐭俊鍙戦�侀棿闅�60s
+                    btnGetVerificationCode.IsSelected = false;
+                    etVerificationCode.Foucs = true;
                     //鑾峰彇楠岃瘉鐮�
-                    var result = pm.SendSms(etAccount.Text.Trim());
-                    if (result.StateCode == "Success")
-                    {
-                        //鐭俊鍙戦�侀棿闅�60s
-                        btnGetVerificationCode.IsSelected = false;
-                        etVerificationCode.Foucs = true;
                         int time = 60;
-                        new Thread(() =>
+                    new Thread(() => {
+                        while (time > 0)
                         {
-                            while (time > 0)
+                            time--;
+                            Application.RunOnMainThread(() =>
                             {
-                                time--;
-                                Application.RunOnMainThread(() =>
-                                {
-                                    btnGetVerificationCode.Text = time.ToString() + "s";
-                                });
-                                Thread.Sleep(1000);
-                            }
+                                btnGetVerificationCode.Text = time.ToString() + "s";
+                            });
+                            Thread.Sleep(1000);
+                        }
+                    }){ IsBackground = true}.Start();
+                    new Thread(() =>
+                    {
+                        var result = pm.SendSms(etAccount.Text.Trim());
+                        if (result.StateCode == "Success")
+                        {
                             Application.RunOnMainThread(() =>
                             {
                                 //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢
                                 btnGetVerificationCode.IsSelected = true;
                                 btnGetVerificationCode.TextID = StringId.GetVerificationCode;
                             });
-                        })
-                        { IsBackground = true }.Start();
-                    }
-                    else
-                    {
-                        string tipString = "Server error";
-                        switch (result.StateCode)
-                        {
-                            case "Exist":
-                                tipString = Language.StringByID(StringId.AccountAlreadyExists);
-                                break;
-                            case "SendFail":
-                                tipString = Language.StringByID(StringId.FailedToSendVerificationCode);
-                                break;
-                            case "Self:Net_Error":
-                                tipString = Language.StringByID(StringId.NetworkAnomaly);
-                                break;
                         }
-
-                        new Tip()
+                        else
                         {
-                            CloseTime = 3,
-                            Direction = AMPopTipDirection.None,
-                            Text = tipString
-                        }.Show(bodyView);
-                    }
+                            string tipString = "Server error";
+                            switch (result.StateCode)
+                            {
+                                case "Exist":
+                                    tipString = Language.StringByID(StringId.AccountAlreadyExists);
+                                    break;
+                                case "SendFail":
+                                    tipString = Language.StringByID(StringId.FailedToSendVerificationCode);
+                                    break;
+                                case "AccountNoExists":
+                                    tipString = Language.StringByID(StringId.AccountNotExist);
+                                    break;
+                                case "Self:Net_Error":
+                                    tipString = Language.StringByID(StringId.NetworkAnomaly);
+                                    break;
+                            }
+
+                            Application.RunOnMainThread(() =>
+                            {
+                                new Tip()
+                                {
+                                    CloseTime = 3,
+                                    Direction = AMPopTipDirection.None,
+                                    Text = tipString
+                                }.Show(bodyView);
+                            });
+                        }
+                    })
+                    { IsBackground = true }.Start();
                 }
             };
         }
@@ -329,7 +337,7 @@
                     //鍒涘缓淇敼瀵嗙爜绾跨▼
                     var loginThread = LoadMothed_ResetThread();
                     waitPage = new Loading();
-                    new WaitPageMothed().LoadPage_WaitPage(loginThread, bodyView, waitPage);
+                    new PublicAssmebly().LoadPage_WaitPage(loginThread, bodyView, waitPage);
                 }
             };
         }
@@ -360,8 +368,8 @@
                     {
                         Application.RunOnMainThread(() =>
                         {
-                            waitPage.Hide();
-                            this.Close();
+                            LoadEvent_AutoLogin();
+
                             callbackAction?.Invoke(account);
                         });
                     }
@@ -399,6 +407,19 @@
                     {
                         case "ValidCodeAndPhoneNoEqual"://楠岃瘉鐮侀敊璇�
                             erorrInfo = Language.StringByID(StringId.VerificationCodeWrong);
+                            Application.RunOnMainThread(() =>
+                            {
+                                btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
+                                btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
+                            });
+                            break;
+                        case "NoRecord":
+                            erorrInfo = Language.StringByID(StringId.PlsGetTheVerificationCode);
+                            Application.RunOnMainThread(() =>
+                            {
+                                btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
+                                btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
+                            });
                             break;
                         default:
                             erorrInfo = "Server error";
@@ -433,5 +454,89 @@
             }
         }
 
+        /// <summary>
+        /// 浣忓畢鎴愬姛涔嬪悗鑷姩鐧诲綍
+        /// </summary>
+        void LoadEvent_AutoLogin()
+        {
+            Dialog dialog = new Dialog();
+
+            FrameLayout frame = new FrameLayout()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = Application.GetRealHeight(198),
+                Width = Application.GetRealWidth(288),
+                Height = Application.GetRealHeight(206),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+                BorderWidth = 0,
+                BorderColor = 0x00000000,
+            };
+            dialog.AddChidren(frame);
+
+            Button btnAccountText = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = Application.GetRealHeight(40),
+                Height = Application.GetRealHeight(17 + 14 + 14),
+                IsMoreLines = true,
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextSize = CSS_FontSize.TextFontSize,
+                Text = "s鏄敓鐢熶笘涓�",
+            };
+            frame.AddChidren(btnAccountText);
+
+            Button btnTipRegisterSuccess = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = Application.GetRealHeight(123),
+                Height = Application.GetRealHeight(30),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.MainColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.PasswordChangeSuccessfully,
+            };
+            frame.AddChidren(btnTipRegisterSuccess);
+
+            Button btnAutoLoginTip = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = btnTipRegisterSuccess.Bottom,
+                Height = Application.GetRealHeight(17 + 8),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.PromptingColor1,
+                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                TextID = StringId.AutomaticallyLogin,
+            };
+            frame.AddChidren(btnAutoLoginTip);
+
+            Button btnHeadImage = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = Application.GetRealHeight(150),
+                Width = Application.GetRealWidth(84),
+                Height = Application.GetRealWidth(84),
+                Radius = (uint)Application.GetRealWidth(42),
+                BorderColor = 0x00000000,
+                BorderWidth = 0,
+                UnSelectedImagePath = "LoginIcon/2.png",
+            };
+            dialog.AddChidren(btnHeadImage);
+
+            dialog.Show();
+
+            new Thread(() =>
+            {
+                Thread.Sleep(1500);
+                Application.RunOnMainThread(() =>
+                {
+                    this.Close();
+                });
+            })
+            { IsBackground = true }.Start();
+        }
+
+
     }
 }

--
Gitblit v1.8.0