From d72ca686a3e262693f8a6e45e747e8e8da43335b Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 06 七月 2021 09:39:03 +0800
Subject: [PATCH] 2021-07-06 1.更新

---
 HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs |   97 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 68 insertions(+), 29 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs
index 8107033..4188ad6 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs
@@ -58,12 +58,15 @@
             };
             bodyView.AddChidren(btnTipTitle);
 
-
-            if (optionType == "2" || optionType == "3")
+            if (optionType == "1")
+            {
+                btnTipTitle.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword;
+            }
+            else if (optionType == "2")
             {
                 btnTipTitle.TextID = StringId.PleaseEnterTheOriginalDigitalPassword;
             }
-            if (optionType == "7")
+            else
             {
                 btnTipTitle.TextID = StringId.PlsEntryPassword;
             }
@@ -227,18 +230,16 @@
 
             etPassword.Foucs = true;
 
-            //鍔犺浇搴曢儴楠岃瘉鎸夐挳
-            if (optionType == "3" || optionType == "5" || optionType == "6")
-            {
-                //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳
-                AddInputPasswordTipButton(optionType);
-            }
-            else if (optionType == "7")
+            if (optionType == "7")
             {
                 //浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳
                 AddLoginTipButton();
             }
-
+            else if (optionType != "1")
+            {
+                //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳
+                AddInputPasswordTipButton(optionType);
+            }
         }
 
 
@@ -434,30 +435,68 @@
                 //杈撳叆鐧诲綍瀵嗙爜楠岃瘉
                 Action<string> action = (pw) =>
                 {
-                    var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
-                    if (resultObj.Code.ToUpper() == StateCode.SUCCESS)
-                    {
-                        //UserInfo.Current.appUnlockPasswrod = "";
-                        //UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();
-                        //UserInfo.Current.SaveUserInfo();
-                        //this.RemoveFromParent();
-                        //backAction();
+                    AuthenticationByLoginPassword(pw, optionType);
+                    //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
+                    //if (resultObj.Code == StateCode.SUCCESS)
+                    //{
+                    //    PasswordInputPassed(optionType);
+                    //}
+                    //else
+                    //{
+                    //    Application.RunOnMainThread(() =>
+                    //    {
+                    //        Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
+                    //    });
 
-                        PasswordInputPassed(optionType);
-                    }
-                    else
-                    {
-                        Application.RunOnMainThread(() =>
-                        {
-                            Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
-                        });
-
-                    }
+                    //}
 
                 };
                 new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true);
             };
         }
 
+        /// <summary>
+        /// 鐧诲綍瀵嗙爜楠岃瘉
+        /// </summary>
+        /// <param name="pw"></param>
+        /// <param name="optionType"></param>
+        void AuthenticationByLoginPassword(string pw, string optionType)
+        {
+            var waitPage = new Loading();
+            bodyView.AddChidren(waitPage);
+            waitPage.Start(Language.StringByID(StringId.PleaseWait));
+
+            new System.Threading.Thread(() =>
+            {
+                try
+                {
+                    var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
+                    Application.RunOnMainThread(() =>
+                    {
+                        if (resultObj.Code == StateCode.SUCCESS)
+                        {
+                            PasswordInputPassed(optionType);
+                        }
+                        else
+                        {
+                            Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
+                        }
+                    });
+                }
+                catch { }
+                finally
+                {
+                    Application.RunOnMainThread(() =>
+                    {
+                        if (waitPage != null)
+                        {
+                            waitPage.RemoveFromParent();
+                            waitPage = null;
+                        }
+                    });
+                }
+            })
+            { IsBackground = true }.Start();
+        }
     }
 }

--
Gitblit v1.8.0