From c3e1b733fc45bd9f0b88bfb560cfa87a270b079b Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 09 九月 2020 17:33:58 +0800
Subject: [PATCH] 20200909

---
 HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs |   84 +++++++++++++++++++++++++++---------------
 1 files changed, 54 insertions(+), 30 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs
index f858c03..8588606 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs
@@ -1,6 +1,7 @@
 锘縰sing System;
 using Shared;
 using HDL_ON.UI.CSS;
+using System.Threading;
 
 namespace HDL_ON.UI
 {
@@ -23,10 +24,19 @@
         /// <param name="optionType">鎿嶄綔鐩爣绫诲瀷 1:閭锛�2:鎵嬫満</param>
         /// <param name="titleId"></param>
         /// <param name="contentTitleId"></param>
-        public void LoadPage(Action<string> act,int opt,int titleId,int contentTitleId)
+        public void LoadPage(Action<string> act, int opt, int titleId, int contentTitleId)
         {
             action = act;
             optionType = opt;
+            string account;
+            if (optionType == 0)
+            {
+                account = MainPage.LoginUser.userEmailInfo;
+            }
+            else
+            {
+                account = MainPage.LoginUser.userMobileInfo;
+            }
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
             new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView();
 
@@ -92,10 +102,10 @@
                 };
                 bodyView.AddChidren(btnChangeGetVer);
 
-                LoadEvent_ChangeVerificationMethod(btnChangeGetVer,btnTitle, btnContent);
+                LoadEvent_ChangeVerificationMethod(btnChangeGetVer, btnTitle, btnContent);
             }
 
-            LoadEvent_GetVerification(btnChangeBind,titleId);
+            LoadEvent_GetVerification(btnChangeBind, titleId);
         }
     }
 
@@ -123,45 +133,59 @@
             };
         }
 
+        int time = 0;
         /// <summary>
         /// 鐐瑰嚮鑾峰彇楠岃瘉鐮�
         /// </summary>
-        void LoadEvent_GetVerification(Button button,int titleId)
+        void LoadEvent_GetVerification(Button button, int titleId)
         {
             button.MouseUpEventHandler = (sender, e) =>
             {
-                new System.Threading.Thread(() =>
+                if (button.Text == Language.StringByID(StringId.GetVerificationCode))
                 {
-                    if (optionType == 1)
+                    new Thread(() =>
                     {
-                        var result = new DAL.Server.HttpServerRequest().GetLoginVerCode(MainPage.LoginUser.userEmailInfo);
-                    }
-                    else if (optionType == 2)
+                        if (optionType == 1)
+                        {
+                            var result = new DAL.Server.HttpServerRequest().GetLoginVerCode(MainPage.LoginUser.userEmailInfo);
+                        }
+                        else if (optionType == 2)
+                        {
+                            var result = new DAL.Server.HttpServerRequest().GetLoginVerCode(MainPage.LoginUser.userMobileInfo);
+                        }
+                    })
+                    { IsBackground = true }.Start();
+                }
+                if (time == 0)
+                {
+                    time = 60;
+                    new Thread(() =>
                     {
-                        var result = new DAL.Server.HttpServerRequest().GetLoginVerCode(MainPage.LoginUser.userMobileInfo);
-                    }
-                })
-                { IsBackground = true }.Start();
+                        while (time > 0)
+                        {
+                            time--;
+                            Application.RunOnMainThread(() =>
+                            {
+                                button.Text = time.ToString() + "s";
+                            });
+                            Thread.Sleep(1000);
+                        }
+                        Application.RunOnMainThread(() =>
+                        {
+                            button.IsSelected = true;
+                            button.TextID = StringId.GetVerificationCode;
+                            button.BackgroundColor = CSS_Color.MainColor;
+                            time = 0;
+                        });
+                    })
+                    { IsBackground = true }.Start();
+                }
+                button.BackgroundColor = CSS_Color.PromptingColor1;
                 var vcp = new VerificationCodePage();
                 MainPage.BasePageView.AddChidren(vcp);
-                //if (titleId == StringId.ModifyBindingEmail)
-                //{
-                //    vcp.LoadPage(action, StringId.ModifyBindingEmail);
-                //}
-                //else if (titleId == StringId.UnbindEmail)
-                //{
-                //    vcp.LoadPage(action, StringId.UnbindEmail);
-                //}
-                //else if(titleId == StringId.ModifyBindingPhone)
-                //{
-                //    vcp.LoadPage(action, StringId.ModifyBindingPhone);
-                //}
-                //else if(titleId == StringId.UnbindPhone)
-                //{
-                //}
-                vcp.LoadPage(action, titleId,optionType);
+                vcp.LoadPage(action, titleId, optionType, time);
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
         }
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0