wxr
2020-09-09 c3e1b733fc45bd9f0b88bfb560cfa87a270b079b
HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs
@@ -1,6 +1,7 @@
using 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;
            };
        }
    }
}
}