From dc840e2d67654781ebc9c7640e6c44a63a6d04d0 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 11 十二月 2020 09:44:37 +0800
Subject: [PATCH] 2020-12-11 1.注册、忘记密码、重置密码、点击返回到时候屏蔽检测错误提示。底部按钮使能效果优化修改。邮箱变密码输入问题修复。2.网络请求底层增加token过期检测刷新方法。3.更新控件库,iOS EditText取消默认密码输入方式。

---
 HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs |  174 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 142 insertions(+), 32 deletions(-)

diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
index e04a6a4..47cfc1e 100644
--- a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
@@ -32,6 +32,12 @@
             {
                 if (registerType == 0)
                     return;
+
+                if (!string.IsNullOrEmpty(etAccount.Text.Trim()))
+                {
+                    //璁板綍涔嬪墠鐨勯偖绠�
+                    registerEmail = etAccount.Text.Trim();
+                }
                 etAccount.IsNumberKeyboardType = true;
                 etAccount.Text = registerPhone;
                 etPassword.Text = "";
@@ -61,7 +67,14 @@
             {
                 if (registerType == 1)
                     return;
+
+                if (!string.IsNullOrEmpty(etAccount.Text.Trim()))
+                {
+                    //璁板綍涔嬪墠鐨勬墜鏈哄彿
+                    registerPhone = etAccount.Text.Trim();
+                }
                 etAccount.IsNumberKeyboardType = false;
+                etAccount.SecureTextEntry = false;//2020-12-10 瑙e喅Android鏁板瓧鍒囨崲鍥炶矾鏅�氶敭鐩樺彉鍔犲瘑闂
                 etAccount.Text = registerEmail;
                 etPassword.Text = "";
                 etRepeatPassword.Text = "";
@@ -120,7 +133,26 @@
                             btnGetVerificationCode_Mail.IsSelected = true;
                     }
                 }
+
+                LoadMothed_EnableResetButton();
             };
+
+            //etVerificationCode.TextChangeEventHandler = (sender, e) => {
+
+            //    if (etVerificationCode.Text.Length > 1)
+            //    {
+            //        LoadMothed_EnableResetButton();
+            //    }
+            //};
+
+            Action<View, string> textChangeEventHandler = (view, textStr) =>
+            {
+                LoadMothed_EnableResetButton();
+            };
+            //etAccount.TextChangeEventHandler += textChangeEventHandler;
+            etPassword.TextChangeEventHandler += textChangeEventHandler;
+            etRepeatPassword.TextChangeEventHandler += textChangeEventHandler;
+            etVerificationCode.TextChangeEventHandler += textChangeEventHandler;
         }
 
         /// <summary>
@@ -133,22 +165,22 @@
             {
                 if (etAccount.Foucs)
                 {
-                    btnAccountViewBottomLine.BackgroundColor = CSS_Color.MainColor;
-                    btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
+                    HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.GotFocus);
                 }
                 else
                 {
-                    //鏍囪鎵嬫満鍙风爜鏃犳晥
-                    btnAccountViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
-                    btnAccountViewBottomLine.Height = Application.GetRealHeight(1);
+                    if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀�
+
+                    HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Normal);
+                    if (etAccount.Text.Length == 0) return;//娌¤緭鍏ヤ笉妫�娴嬫彁绀�
+
                     //鎵嬫満鏂瑰紡-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘
                     if (registerType == 0)
                     {
                         btnGetVerificationCode_Phone.IsSelected = false;
                         if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode))
                         {
-                            btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
-                            btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
+                            HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Error);
                             new Tip()
                             {
                                 CloseTime = 1,
@@ -158,7 +190,7 @@
                         }
                         else
                         {
-                            if (btnGetVerificationCode_Phone.Text == Language.StringByID( StringId.GetVerificationCode))
+                            if (btnGetVerificationCode_Phone.Text == Language.StringByID(StringId.GetVerificationCode))
                             {
                                 btnGetVerificationCode_Phone.IsSelected = true;
                             }
@@ -171,8 +203,7 @@
                         //閭鏂瑰紡-楠岃瘉閭鏄惁姝g‘
                         if (!Utlis.CheckEmail(etAccount.Text.Trim()))
                         {
-                            btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
-                            btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
+                            HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Error);
                             new Tip()
                             {
                                 CloseTime = 1,
@@ -197,16 +228,19 @@
             {
                 if (etPassword.Foucs)
                 {
-                    btnPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor;
-                    btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
+                    HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.GotFocus);
                 }
                 else
                 {
-                    btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
-                    btnPasswordViewBottomLine.Height = Application.GetRealHeight(1);
+                    if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀�
+
+                    HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.Normal);
+                    if (etPassword.Text.Length == 0) return;//娌¤緭鍏ヤ笉妫�娴嬫彁绀�
+
                     //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰
                     if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13)
                     {
+                        HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.Error);
                         new Tip()
                         {
                             CloseTime = 1,
@@ -222,18 +256,17 @@
             {
                 if (etRepeatPassword.Foucs)
                 {
-                    btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor;
-                    btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2);
+                    HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.GotFocus);
                 }
                 else
                 {
-                    btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
-                    btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(1);
+                    if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀�
+
+                    HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.Normal);
                     //鏍¢獙涓ゆ杈撳叆鐨勫瘑鐮佹槸鍚︿竴鑷�
                     if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim())
                     {
-                        btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
-                        btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2);
+                        HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.Error);
                         new Tip()
                         {
                             CloseTime = 1,
@@ -253,13 +286,13 @@
             {
                 if (etVerificationCode.Foucs)
                 {
-                    btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.MainColor;
-                    btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
+                    HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.GotFocus);
                 }
                 else
                 {
-                    btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
-                    btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(1);
+                    if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀�
+
+                    HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.Normal);
                     if (etVerificationCode.Text.Length > 4)
                     {
                         LoadMothed_EnableResetButton();
@@ -292,7 +325,8 @@
         /// 妫�娴嬪綋鍓嶉厤缃煙鍚嶆槸鍚︿竴鑷达紝涓嶄竴鑷村垯鏇挎崲
         /// </summary>
         /// <param name="result"></param>
-        void CheckAndSetUserRequestHost(ResponsePackNew result) {
+        void CheckAndSetUserRequestHost(ResponsePackNew result)
+        {
             try
             {
                 var mGlobalRegionListObj = Newtonsoft.Json.JsonConvert.DeserializeObject<GlobalRegionListRes>(result.Data.ToString());
@@ -361,8 +395,8 @@
                                     //3.鍙戦�侀獙璇佺爜鎴愬姛锛屽紑濮嬭鏃�
                                     Application.RunOnMainThread(() =>
                                     {
-                                    //鐭俊鍙戦�侀棿闅�60s
-                                    (sender as Button).IsSelected = false;
+                                        //鐭俊鍙戦�侀棿闅�60s
+                                        (sender as Button).IsSelected = false;
                                         etVerificationCode.Foucs = true;
                                     });
                                     //2.1鑾峰彇楠岃瘉鐮佸�掕鏃�
@@ -379,8 +413,8 @@
                                         }
                                         Application.RunOnMainThread(() =>
                                         {
-                                        //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢
-                                        (sender as Button).IsSelected = true;
+                                            //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢
+                                            (sender as Button).IsSelected = true;
                                             (sender as Button).TextID = StringId.GetVerificationCode;
                                         });
                                     })
@@ -419,6 +453,13 @@
             {
                 if (btnReset.IsSelected)
                 {
+                    //妫�娴嬭处鍙�
+                    if (!CheckAccount()) return;
+                    //妫�娴嬪瘑鐮�
+                    if (!CheckPassword()) return;
+                    //妫�娴嬮獙璇佺爜
+                    if (!CheckVerificationCode()) return;
+
                     //鍒涘缓淇敼瀵嗙爜绾跨▼
                     var loginThread = LoadMothed_ResetThread();
                     waitPage = new Loading();
@@ -472,8 +513,7 @@
                         // 楠岃瘉鐮侀敊璇� 璀﹀憡鎻愮ず
                         if (resultObj.Code == StateCode.VERIFICATION_CODE_WRONG)
                         {
-                            btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
-                            btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
+                            HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.Error);
                         }
                     });
                     // 鎻愮ず閿欒
@@ -498,6 +538,76 @@
         }
 
         /// <summary>
+        /// 妫�娴嬭处鍙�
+        /// </summary>
+        /// <returns></returns>
+        bool CheckAccount()
+        {
+            //鎵嬫満鏂瑰紡-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘
+            if (registerType == 0)
+            {
+                if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode))
+                {
+                    Utlis.ShowTip(Language.StringByID(StringId.PlsEntryCorrectMobilNeumber));
+                }
+                else
+                {
+                    return true;
+                }
+
+            }
+            else if (registerType == 1)
+            {
+                //閭鏂瑰紡-楠岃瘉閭鏄惁姝g‘
+                if (!Utlis.CheckEmail(etAccount.Text.Trim()))
+                {
+                    Utlis.ShowTip(Language.StringByID(StringId.PlsEntryCorrectEmailAddress));
+                }
+                else
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        /// <summary>
+        /// 妫�娴嬪瘑鐮佹槸鍚︽纭�
+        /// </summary>
+        /// <returns></returns>
+        bool CheckPassword()
+        {
+            //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰
+            if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13)
+            {
+                Utlis.ShowTip(Language.StringByID(StringId.PasswordIsUnqualified));
+                return false;
+            }
+
+            if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim())
+            {
+                Utlis.ShowTip(Language.StringByID(StringId.IncorrectRepeatPassword));
+                return false;
+            }
+            return true;
+        }
+
+        /// <summary>
+        /// 妫�娴嬮獙璇佺爜鏄惁杈撳叆
+        /// </summary>
+        /// <returns></returns>
+        bool CheckVerificationCode()
+        {
+            if (string.IsNullOrEmpty(etVerificationCode.Text))
+            {
+                Utlis.ShowTip(Language.StringByID(StringId.PlsEntryVerificationCode));
+                return false;
+            }
+            return true;
+        }
+
+        /// <summary>
         /// 鏄剧ず鑷姩鑷姩鐧诲綍浜嬩欢
         /// </summary>
         void ShowAutoLoginDialog(string account, string password, bool isPhone)
@@ -514,7 +624,7 @@
             FrameLayout contentView = new FrameLayout()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y =  Application.GetRealWidth(200),
+                Y = Application.GetRealWidth(200),
                 Width = Application.GetRealWidth(288),
                 Height = Application.GetRealWidth(270),
                 Radius = (uint)Application.GetRealWidth(6),

--
Gitblit v1.8.0