wxr
2021-07-01 adc150efb13a0506f45a3c344c3ee2ef2dba8e90
HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs
@@ -18,7 +18,17 @@
        /// <summary>
        /// 
        /// </summary>
        Button btnTitle;
        /// <summary>
        ///
        /// </summary>
        Button btnContent;
        /// <summary>
        ///
        /// </summary>
        Action<string> action;
        /// <summary>
        /// 操作目标类型 1:邮箱,2:手机
        /// </summary>
@@ -26,16 +36,8 @@
        /// <summary>
        /// 是否为解绑验证
        /// </summary>
        public bool isUnbind;
        /// <summary>
        ///
        /// </summary>
        Button btnTitle;
        /// <summary>
        ///
        /// </summary>
        Button btnContent;
        public bool IsUnbind;
        /// <summary>
        /// ChangeBindAccountPage
@@ -101,7 +103,7 @@
                Y = Application.GetRealHeight(213),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealHeight(44),
                Height = Application.GetRealWidth(44),
                BackgroundColor = CSS_Color.MainColor,
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainBackgroundColor,
@@ -148,12 +150,12 @@
        {
            if (optionType == 2)
            {
                btnTitle.TextID = isUnbind ? StringId.CurPhone : StringId.PhoneNumberVerification;
                btnTitle.TextID = IsUnbind ? StringId.CurPhone : StringId.PhoneNumberVerification;
                btnContent.Text =  UserInfo.Current.userMobileInfo;
            }
            else
            {
                btnTitle.TextID = isUnbind ? StringId.CurrentEmail : StringId.EmailVerification;
                btnTitle.TextID = IsUnbind ? StringId.CurrentEmail : StringId.EmailVerification;
                btnContent.Text =  UserInfo.Current.userEmailInfo;
            }
        }
@@ -184,61 +186,80 @@
            {
                if (button.Text == Language.StringByID(StringId.GetVerificationCode))
                {
                    //加载Loading效果
                    var waitPage = new Loading();
                    bodyView.AddChidren(waitPage);
                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
                    new Thread(() =>
                    {
                        //1.获取验证码,采用敏感数据验证
                        ResponsePackNew resultObj;
                        if (optionType == 1)//邮箱
                        try
                        {
                            resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.SENSITIVE_DATA,  UserInfo.Current.userEmailInfo);
                        }
                        else
                        {
                            resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.SENSITIVE_DATA,  UserInfo.Current.userMobileInfo, true,  UserInfo.Current.areaCode);
                        }
                        if (resultObj.Code != StateCode.SUCCESS)
                        {
                            // 提示错误
                            IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
                        }
                        else
                        {
                            if (time == 0)
                            //1.获取验证码,采用敏感数据验证
                            ResponsePackNew resultObj;
                            if (optionType == 1)//邮箱
                            {
                                time = 60;
                                new Thread(() =>
                                resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.SENSITIVE_DATA, UserInfo.Current.userEmailInfo);
                            }
                            else
                            {
                                resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.SENSITIVE_DATA, UserInfo.Current.userMobileInfo, true, UserInfo.Current.areaCode);
                            }
                            if (resultObj.Code != StateCode.SUCCESS)
                            {
                                // 提示错误
                                IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
                            }
                            else
                            {
                                if (time == 0)
                                {
                                    while (time > 0)
                                    time = 60;
                                    new Thread(() =>
                                    {
                                        time--;
                                        while (time > 0)
                                        {
                                            time--;
                                            Application.RunOnMainThread(() =>
                                            {
                                                button.Text = time.ToString() + "s";
                                            });
                                            Thread.Sleep(1000);
                                        }
                                        Application.RunOnMainThread(() =>
                                        {
                                            button.Text = time.ToString() + "s";
                                            button.IsSelected = true;
                                            button.TextID = StringId.GetVerificationCode;
                                            button.BackgroundColor = CSS_Color.MainColor;
                                            time = 0;
                                        });
                                        Thread.Sleep(1000);
                                    }
                                    Application.RunOnMainThread(() =>
                                    {
                                        button.IsSelected = true;
                                        button.TextID = StringId.GetVerificationCode;
                                        button.BackgroundColor = CSS_Color.MainColor;
                                        time = 0;
                                    });
                                })
                                { IsBackground = true }.Start();
                                    })
                                    { IsBackground = true }.Start();
                                }
                                Application.RunOnMainThread(() =>
                                {
                                    button.BackgroundColor = CSS_Color.PromptingColor1;
                                    var vcp = new ChangeBindVerificationCodePage();
                                    vcp.IsUnbind = IsUnbind;
                                    MainPage.BasePageView.AddChidren(vcp);
                                    vcp.LoadPage(action, titleId, optionType, time);
                                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                                });
                            }
                        }
                        catch { }
                        finally
                        {
                            Application.RunOnMainThread(() =>
                            {
                                button.BackgroundColor = CSS_Color.PromptingColor1;
                                var vcp = new ChangeBindVerificationCodePage();
                                vcp.isUnbind = isUnbind;
                                MainPage.BasePageView.AddChidren(vcp);
                                vcp.LoadPage(action, titleId, optionType, time);
                                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                                if (waitPage != null)
                                {
                                    waitPage.RemoveFromParent();
                                    waitPage = null;
                                }
                            });
                        }
                    })
                    { IsBackground = true }.Start();
                }