From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs |  106 +++++++++++++++--------------------------------------
 1 files changed, 30 insertions(+), 76 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs
index 4763aba..f85a69c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/CheckOldPhoneForm.cs
@@ -58,21 +58,21 @@
             btnPhone.TextColor = UserCenterColor.Current.TextGrayColor3;
             btnPhone.TextAlignment = TextAlignment.Center;
             btnPhone.TextSize = 16;
-            btnPhone.Text = UserCenterResourse.UserInfo.Email;
+            btnPhone.Text = HdlUserCenterResourse.UserInfo.UserEmail;
             btnPhone.Y = btnMsg1.Bottom + Application.GetRealHeight(12);
             bodyFrameLayout.AddChidren(btnPhone);
-            if (UserCenterResourse.UserInfo.Phone.Length >= 11)
+            if (HdlUserCenterResourse.UserInfo.UserPhone.Length >= 11)
             {
-                var phone = UserCenterResourse.UserInfo.Phone;
+                var phone = HdlUserCenterResourse.UserInfo.UserPhone;
                 phone = phone.Substring(0, 3) + "".PadLeft(phone.Length - 7, '*') + phone.Substring(phone.Length - 4, 4);
-                btnPhone.Text = "+" + UserCenterResourse.UserInfo.AreaCode + " " + phone;
+                btnPhone.Text = "+" + HdlUserCenterResourse.UserInfo.PhoneAreaCode + " " + phone;
             }
             else
             {
                 //鎴栬杩欐槸鍥藉鐨勬墜鏈哄惂
-                var phone = UserCenterResourse.UserInfo.Phone;
+                var phone = HdlUserCenterResourse.UserInfo.UserPhone;
                 phone = phone.Substring(0, 3) + "".PadLeft(phone.Length - 5, '*') + phone.Substring(phone.Length - 2, 2);
-                btnPhone.Text = "+" + UserCenterResourse.UserInfo.AreaCode + " " + phone;
+                btnPhone.Text = "+" + HdlUserCenterResourse.UserInfo.PhoneAreaCode + " " + phone;
             }
 
             //淇敼鎵嬫満鍙峰墠锛岃杈撳叆楠岃瘉鐮佺‘璁ゆ偍鐨勮韩浠�
@@ -99,7 +99,11 @@
             btnCodeControl.FinishInputEvent += (value) =>
             {
                 //鏍¢獙楠岃瘉鐮�
-                this.CheckVerificationCode(value);
+                if (this.CheckVerificationCode(value) == false)
+                {
+                    //娓呯┖楠岃瘉鐮�
+                    btnCodeControl.ClearInputValue();
+                }
             };
 
             //楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏�
@@ -108,6 +112,7 @@
             btnErrorMsg.TextAlignment = TextAlignment.Center;
             btnErrorMsg.TextColor = 0xfff75858;
             btnErrorMsg.TextID = R.MyInternationalizationString.uVerificationCodeErrorInputAgain;
+            btnErrorMsg.IsBold = true;
             bodyFrameLayout.AddChidren(btnErrorMsg);
             btnErrorMsg.Visible = false;
 
@@ -118,6 +123,8 @@
             bodyFrameLayout.AddChidren(btnNext);
             btnNext.ButtonClickEvent += (sender, e) =>
             {
+                //娓呯┖杈撳叆鐨勫��
+                btnCodeControl.ClearInputValue();
                 //鍙戦�侀獙璇佺爜鍒版墜鏈�
                 this.SendCodeToPhone(btnNext);
             };
@@ -130,13 +137,12 @@
         /// <summary>
         /// 鍙戦�侀獙璇佺爜鍒版墜鏈�
         /// </summary>
-        private async void SendCodeToPhone(BottomClickButton btnNext)
+        private void SendCodeToPhone(BottomClickButton btnNext)
         {
-            var sendCodePra = new SendCodePra();
-
-            bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/LoginSendVerCode", false, sendCodePra);
-            if (flage == false)
+            var errorMsg = HdlAccountLogic.Current.SendVeriCodeToEmail(HdlUserCenterResourse.UserInfo.UserPhone, VerCodeType.A鍏朵粬);
+            if (errorMsg != null)
             {
+                HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, errorMsg);
                 return;
             }
 
@@ -146,8 +152,8 @@
             btnNext.CanClick = false;
             //?s鍚庨噸鍙�
             string repeat = Language.StringByID(R.MyInternationalizationString.RepeatSend1);
-            //鏈夋晥鏃堕棿300绉�
-            int waitime = 300;
+            //鏈夋晥鏃堕棿60绉�
+            int waitime = 60;
             btnNext.Text = waitime + "s" + repeat;
 
             HdlThreadLogic.Current.RunThread(() =>
@@ -158,8 +164,7 @@
                     System.Threading.Thread.Sleep(1000);
                     if (waitime == 0)
                     {
-                        this.canCheckCode = false;
-                        Application.RunOnMainThread(() =>
+                        HdlThreadLogic.Current.RunMain(() =>
                         {
                             if (btnNext != null)
                             {
@@ -171,13 +176,13 @@
                         });
                         break;
                     }
-                    Application.RunOnMainThread(() =>
+                    HdlThreadLogic.Current.RunMain(() =>
                     {
                         if (btnNext != null)
                         {
                             btnNext.Text = waitime + "s" + repeat;
                         }
-                    });
+                    }, ShowErrorMode.NO);
                 }
             });
         }
@@ -190,77 +195,26 @@
         /// 楠岃瘉楠岃瘉鐮�
         /// </summary>
         /// <returns></returns>
-        private async void CheckVerificationCode(string code)
+        private bool CheckVerificationCode(string code)
         {
             if (this.canCheckCode == false)
             {
                 //楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏�
                 this.btnErrorMsg.Visible = true;
-                return;
+                return false;
             }
-            var checkCodePra = new CheckCodePra();
-            checkCodePra.Code = code;
-
-            bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ValidatorCode", false, checkCodePra);
-            if (flage == false)
+            var result = HdlAccountLogic.Current.CheckVeriCode(HdlUserCenterResourse.UserInfo.UserPhone, VerCodeType.A鍏朵粬, code);
+            if (result == false)
             {
                 //楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏�
                 this.btnErrorMsg.Visible = true;
-                return;
+                return false;
             }
 
             var from = new CheckNewPhoneForm();
-            base.AddFromAndRemoveNowForm(from);
-        }
+            base.AddFormAndCloseNowForm(from);
 
-        #endregion
-
-        #region 鈻� 缁撴瀯浣揰____________________________
-
-        /// <summary>
-        /// 鍙戦�侀獙璇佺爜鐨勫惎鍔ㄥ弬鏁�
-        /// </summary>
-        private class SendCodePra
-        {
-            /// <summary>
-            /// 鐢ㄦ埛璐﹀彿
-            /// </summary>
-            public string Account = UserCenterResourse.UserInfo.Phone;
-            /// <summary>
-            /// 鍏徃缂栧彿,鍥藉唴浣跨敤鎵嬫満鐭俊楠岃瘉鐮佹椂锛屾瀛楁濉叆0锛屽浗澶栨墜鏈虹煭淇¢獙璇佺爜锛屾瀛楁濉叆4 
-            /// </summary>
-            public int Company = Common.CommonPage.PhoneZoneStr == "86" ? 0 : 4;
-            /// <summary>
-            /// 璇█
-            /// </summary>
-            public string Language = Shared.Language.CurrentLanguage;
-            /// <summary>
-            /// 鍥藉鍦板尯浠g爜锛屾墜鏈哄彿鍙戦�侀獙璇佺爜鏃朵娇鐢�
-            /// </summary>
-            public int AreaCode = 0;
-        }
-
-        /// <summary>
-        /// 鍙戦�侀獙璇佺爜鐨勫惎鍔ㄥ弬鏁�
-        /// </summary>
-        private class CheckCodePra
-        {
-            /// <summary>
-            /// 鐢ㄦ埛璐﹀彿
-            /// </summary>
-            public string Account = UserCenterResourse.UserInfo.Phone;
-            /// <summary>
-            /// 楠岃瘉鐮�
-            /// </summary>
-            public string Code = "0";
-            /// <summary>
-            /// 璇█
-            /// </summary>
-            public string Language = Shared.Language.CurrentLanguage;
-            /// <summary>
-            /// 鍥藉鍦板尯浠g爜锛屾墜鏈哄彿鍙戦�侀獙璇佺爜鏃朵娇鐢�
-            /// </summary>
-            public int AreaCode = 0;
+            return true;
         }
 
         #endregion

--
Gitblit v1.8.0