From eb51679c618d5027070fbd6f3c0519f0f17e7d7d Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 23 十一月 2020 10:07:53 +0800
Subject: [PATCH] Merge branch 'CJL' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into CJL

---
 HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs |  302 +++++++++++++++++---------------------------------
 1 files changed, 102 insertions(+), 200 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs
index 4f3ed20..812f139 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs
@@ -32,55 +32,25 @@
 
         Button btnResend;
 
-        /// <summary>
-        /// 
-        /// </summary>
-        Button btnTip;
-
         int titleId;
 
-        ///// <summary>
-        ///// 鎿嶄綔绫诲瀷 1:閭锛�2:鎵嬫満
-        ///// </summary>
-        //int optionType;
         /// <summary>
-        /// 鏄惁鎵嬫満
+        /// 鎿嶄綔绫诲瀷 1:閭锛�2:鎵嬫満
         /// </summary>
-        bool isPhone;
-        /// <summary>
-        /// 璐﹀彿
-        /// </summary>
-        string account;
-
-
+        int optionType;
         public ResetPasswordVerificationCodePage()
         {
             bodyView = this;
         }
 
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="tId"></param>
-        /// <param name="isPhone">鏄惁鎵嬫満</param>
-        /// <param name="account">璐﹀彿</param>
-        public void LoadPage(int tId, bool isPhone, string account)
+        public void LoadPage(int tId, int ot)
         {
             titleId = tId;
-            this.isPhone = isPhone;
-            this.account = account;
+            optionType = ot;
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
+            new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView();
 
-            Action backAction = () =>
-            {
-                Application.HideSoftInput();
-                BackConfirmAction();
-            };
-            new TopViewDiv(bodyView, Language.StringByID(tId), false).LoadTopView(backAction);
-
-            //new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView();
-
-            btnTip = new Button()
+            Button btnTip = new Button()
             {
                 Y = Application.GetRealHeight(64),
                 X = Application.GetRealWidth(16),
@@ -397,12 +367,12 @@
                         btnNum4Line.Height = Application.GetRealHeight(1);
                         btnNum5Line.Height = Application.GetRealHeight(1);
                         btnNum6Line.Height = Application.GetRealHeight(1);
-                        btnNum1.Text = "";
-                        btnNum2.Text = "";
-                        btnNum3.Text = "";
-                        btnNum4.Text = "";
-                        btnNum5.Text = "";
-                        btnNum6.Text = "";
+                        btnNum1Line.Text = "";
+                        btnNum2Line.Text = "";
+                        btnNum3Line.Text = "";
+                        btnNum4Line.Text = "";
+                        btnNum5Line.Text = "";
+                        btnNum6Line.Text = "";
                         break;
                     case 1:
                         btnNum2Line.IsSelected = true;
@@ -418,11 +388,11 @@
                         btnNum4Line.Height = Application.GetRealHeight(1);
                         btnNum5Line.Height = Application.GetRealHeight(1);
                         btnNum6Line.Height = Application.GetRealHeight(1);
-                        btnNum2.Text = "";
-                        btnNum3.Text = "";
-                        btnNum4.Text = "";
-                        btnNum5.Text = "";
-                        btnNum6.Text = "";
+                        btnNum2Line.Text = "";
+                        btnNum3Line.Text = "";
+                        btnNum4Line.Text = "";
+                        btnNum5Line.Text = "";
+                        btnNum6Line.Text = "";
                         break;
                     case 2:
                         btnNum3Line.IsSelected = true;
@@ -438,10 +408,10 @@
                         btnNum4Line.Height = Application.GetRealHeight(1);
                         btnNum5Line.Height = Application.GetRealHeight(1);
                         btnNum6Line.Height = Application.GetRealHeight(1);
-                        btnNum3.Text = "";
-                        btnNum4.Text = "";
-                        btnNum5.Text = "";
-                        btnNum6.Text = "";
+                        btnNum3Line.Text = "";
+                        btnNum4Line.Text = "";
+                        btnNum5Line.Text = "";
+                        btnNum6Line.Text = "";
                         break;
                     case 3:
                         btnNum4Line.IsSelected = true;
@@ -457,9 +427,9 @@
                         btnNum4Line.Height = Application.GetRealHeight(2);
                         btnNum5Line.Height = Application.GetRealHeight(1);
                         btnNum6Line.Height = Application.GetRealHeight(1);
-                        btnNum4.Text = "";
-                        btnNum5.Text = "";
-                        btnNum6.Text = "";
+                        btnNum4Line.Text = "";
+                        btnNum5Line.Text = "";
+                        btnNum6Line.Text = "";
                         break;
                     case 4:
                         btnNum5Line.IsSelected = true;
@@ -475,8 +445,8 @@
                         btnNum4Line.Height = Application.GetRealHeight(1);
                         btnNum5Line.Height = Application.GetRealHeight(2);
                         btnNum6Line.Height = Application.GetRealHeight(1);
-                        btnNum5.Text = "";
-                        btnNum6.Text = "";
+                        btnNum5Line.Text = "";
+                        btnNum6Line.Text = "";
                         break;
                     case 5:
                         btnNum6Line.IsSelected = true;
@@ -492,74 +462,61 @@
                         btnNum4Line.Height = Application.GetRealHeight(1);
                         btnNum5Line.Height = Application.GetRealHeight(1);
                         btnNum6Line.Height = Application.GetRealHeight(2);
-                        btnNum6.Text = "";
+                        btnNum6Line.Text = "";
                         break;
                     case 6:
                         btnNum6.Text = etCode.Substring(5, 1);
                         et.Foucs = false;
-                        //杈撳叆瀹屾垚
-                        InputComplete(etCode);
+                        new Thread(() =>
+                        {
+                            bool result = false;
+                            Action act = () => { };
+                            Application.RunOnMainThread(() =>
+                            {
+                                act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait));
+                            });
+                            bool isPhone = optionType == 2;
+                            var resultObj = new HttpServerRequest().ValidatorCode(VerifyType.FIND_PASSWORD, MainPage.LoginUser.userEmailInfo, etCode, isPhone);
+                            if (resultObj.Code == StateCode.SUCCESS)
+                            {
+                                result = true;
+                            }
+                            else
+                            {
+                                //澶辫触鎻愮ず
+                                IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Check, resultObj.Code);
+                            }
+                            Application.RunOnMainThread(() =>
+                            {
+                                act();
+                            });
+                            if (result)
+                            {
+                                Application.RunOnMainThread(() =>
+                                {
+                                    new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.ValidationSuccessful), true);
+                                });
+                                Thread.Sleep(1600);
+                                Application.RunOnMainThread(() =>
+                                {
+                                    MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+                                    if (titleId == StringId.EmailVerification)
+                                    {
+
+                                    }
+                                    else if (titleId == StringId.PhoneNumberVerification)
+                                    {
+
+                                    }
+                                });
+                            }
+                        })
+                        { IsBackground = true }.Start();
+
                         break;
                 }
             };
         }
-
-        /// <summary>
-        /// 杈撳叆瀹屾垚
-        /// </summary>
-        /// <param name="etCode"></param>
-        void InputComplete(string etCode)
-        {
-            new Thread(() =>
-            {
-                bool result = false;
-                Action act = () => { };
-                Application.RunOnMainThread(() =>
-                {
-                    act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait));
-                });
-
-                var resultObj = new HttpServerRequest().ValidatorCode(VerifyType.FIND_PASSWORD, account, etCode, isPhone, false);
-                if (resultObj.Code == StateCode.SUCCESS)
-                {
-                    result = true;
-                }
-                else
-                {
-                    //澶辫触鎻愮ず
-                    IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
-                }
-                Application.RunOnMainThread(() =>
-                {
-                    act();
-                });
-                if (result)
-                {
-                    Application.RunOnMainThread(() =>
-                    {
-                        new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.ValidationSuccessful), true);
-                    });
-                    Thread.Sleep(1600);
-                    Application.RunOnMainThread(() =>
-                    {
-
-                        //MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
-                        this.RemoveFromParent();
-                        var vcp = new ResetPasswordPage();
-                        vcp.isPhone = isPhone;
-                        vcp.account = account;
-                        vcp.verCode = etCode;
-                        MainPage.BasePageView.AddChidren(vcp);
-                        vcp.LoadPage();
-                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-
-                    });
-                }
-            })
-            { IsBackground = true }.Start();
-        }
-
-       
         /// <summary>
         /// 閲嶅彂楠岃瘉鐮佺瓑寰呯嚎绋�
         /// </summary>
@@ -567,102 +524,47 @@
         {
             btnResend.IsSelected = false;
             int time = 60;
-            try
+
+            new Thread(() =>
             {
-                new Thread(() =>
+                if (optionType == 1)
                 {
-                    //2.2  鑾峰彇楠岃瘉鐮�
-                    ResponsePackNew resultObj;
-                    if (!isPhone)
-                    {
-                        resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, account);
-                    }
-                    else
-                    {
-                        resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, account, true,  UserInfo.Current.areaCode.ToString());
-                    }
+                    var resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, MainPage.LoginUser.userEmailInfo);
 
-                    if (resultObj.Code != StateCode.SUCCESS)
-                    {
-                        //鍙戦�佸け璐�
-                        Application.RunOnMainThread(() =>
-                        {
-                            btnTip.TextID = StringId.FailedToSendVerificationCode;
-                        });
-                        //澶辫触鎻愮ず
-                        IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
-                    }
-                    else
-                    {
-                        //鍙戦�佹垚鍔燂紝寮�濮嬪�掕鏃�
-                        Application.RunOnMainThread(() =>
-                        {
-                            btnTip.TextID = StringId.VerificationCodePrompt;
-                        });
-
-                        while (time > 0)
-                        {
-                            time--;
-                            Application.RunOnMainThread(() =>
-                            {
-                                btnResend.Text = time.ToString() + "s";
-                            });
-                            Thread.Sleep(1000);
-                        }
-                        Application.RunOnMainThread(() =>
-                        {
-                            btnResend.IsSelected = true;
-                            btnResend.TextID = StringId.GetVerificationCode;
-                        });
-                    }
-                })
-                { IsBackground = true }.Start();
-            }
-
-            catch { }
-            finally
+                }
+                else if (optionType == 2)
+                {
+                    var resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, MainPage.LoginUser.userMobileInfo, true, MainPage.LoginUser.areaCode.ToString() );
+                }
+            })
+            { IsBackground = true }.Start();
+            new Thread(() =>
             {
-
-            };
+                while (time > 0)
+                {
+                    time--;
+                    Application.RunOnMainThread(() =>
+                    {
+                        btnResend.Text = time.ToString() + "s";
+                    });
+                    Thread.Sleep(1000);
+                }
+                Application.RunOnMainThread(() =>
+                {
+                    btnResend.IsSelected = true;
+                    btnResend.TextID = StringId.GetVerificationCode;
+                });
+            })
+            { IsBackground = true }.Start();
         }
-
         /// <summary>
         /// 閲嶅彂楠岃瘉鐮佷簨浠�
         /// </summary>
         void LoadEvent_Resend()
         {
-            btnResend.MouseUpEventHandler = (sender, e) =>
-            {
+            btnResend.MouseUpEventHandler = (sender, e) => {
                 LoadThread_SendVerCode();
             };
-        }
-
-        /// <summary>
-        /// 杩斿洖浜屾纭浜嬩欢
-        /// </summary>
-        void BackConfirmAction()
-        {
-            //楠岃瘉鐮佸彂閫佹垚鍔燂紝浜屾纭閫�鍑�
-            if (btnTip.TextID == StringId.VerificationCodePrompt)
-            {
-                Action cancelAction = () =>
-                {
-                    if (bodyView != null)
-                    {
-                        bodyView.RemoveFromParent();
-                    }
-                };
-                new ConfirmDialog().ShowDialog(StringId.Tip, StringId.VerificationCodeMayBeDelayed, null, cancelAction, StringId.ReturnStr, StringId.WaitAMoment);
-            }
-            else
-            {
-                //鐩存帴鍏抽棴
-                if (bodyView != null)
-                {
-                    bodyView.RemoveFromParent();
-                }
-
-            }
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0