陈嘉乐
2020-10-13 611786df5108dca0bdcff03834cc285cba4b8e61
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs
@@ -7,6 +7,7 @@
    public partial class AppUnlockPasswordPage : FrameLayout
    {
        FrameLayout bodyView;
        EditText etPassword;
        string passwrod = "";
        string oldPasswrod = "";
@@ -17,7 +18,6 @@
            oldPasswrod = pw;
            backAction = action;
        }
        /// <summary>
        /// 
@@ -132,10 +132,10 @@
            bodyView.AddChidren(btnTipError);
            var etPassword = new EditText()
            etPassword = new EditText()
            {
                Y = Application.GetRealWidth(100),
                Height = Application.GetRealWidth(10),
                Height = Application.GetRealWidth(0),
                Foucs = true,
                //Visible = false,
                IsNumberKeyboardType = true,
@@ -205,8 +205,10 @@
                            {
                                if (passwrod == oldPasswrod)
                                {
                                    //MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
                                    this.RemoveFromParent();
                                    backAction();
                                    return;
                                }
                                else
                                {
@@ -228,7 +230,7 @@
                                    }
                                    if (MainPage.LoginUser.appUnlockType.Contains("1"))
                                    {
                                        MainPage.LoginUser.appUnlockType.Remove("1");
                                        MainPage.LoginUser.appUnlockType =new System.Collections.Generic.List<string>();//.Remove("1");
                                        MainPage.LoginUser.appUnlockPasswrod = "";
                                        MainPage.LoginUser.SaveUserInfo();
                                        this.RemoveFromParent();
@@ -341,6 +343,81 @@
            btnTipIcon4.MouseUpEventHandler = eventHandler;
            etPassword.Foucs = true;
            if (optionType == "3" || optionType == "5" || optionType == "6" || optionType == "7")
            {
                Button btnLoginAccountVerify = new Button()
                {
                    Y = Application.GetRealHeight(517),
                    Height = Application.GetRealHeight(60),
                    TextAlignment = TextAlignment.Center,
                    TextSize = CSS_FontSize.TextFontSize,
                    TextColor = CSS_Color.MainColor,
                    TextID = StringId.EnterLoginPasswordVerification,
                };
                bodyView.AddChidren(btnLoginAccountVerify);
                btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
                {
                    if (optionType == "7")
                    {
                        MainPage.GoLoginPage(MainPage.LoginUser.accountString);
                    }
                    else
                    {
                        Action<string> action = (pw) => {
                            var loginResult = new DAL.Server.HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw);
                            if (loginResult.StateCode.ToUpper() == "SUCCESS")
                            {
                                MainPage.LoginUser.appUnlockPasswrod = "";
                                MainPage.LoginUser.appUnlockType = new System.Collections.Generic.List<string>();
                                MainPage.LoginUser.SaveUserInfo();
                                this.RemoveFromParent();
                                backAction();
                            }
                            //登录失败
                            else
                            {
                                string tipStr = "Sever erorr";
                                switch (loginResult.StateCode)
                                {
                                    case "ValidCodeAndPhoneNoEqual":
                                        tipStr = Language.StringByID(StringId.VerificationCodeError);
                                        break;
                                    case "USERNAMEORPWDERROR":
                                        tipStr = Language.StringByID(StringId.LoginFailed_AccountOrPasswordError);
                                        break;
                                    case "ACCOUNTNOEXISTS":
                                        tipStr = Language.StringByID(StringId.ACCOUNTNOEXISTS);
                                        break;
                                    case "NoRecord":
                                        tipStr = Language.StringByID(StringId.PlsGetTheVerificationCode);
                                        break;
                                    case "Self:Net_Error":
                                        tipStr = Language.StringByID(StringId.NetworkAnomaly);
                                        break;
                                }
                                //账号或者密码错误
                                Application.RunOnMainThread(() =>
                                {
                                    //提示原因
                                    var tip = new Tip()
                                    {
                                        Text = tipStr,
                                        CloseTime = 3,
                                        Direction = AMPopTipDirection.None
                                    };
                                    tip.Show(bodyView);
                                });
                            }
                        };
                        new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true);
                    }
                };
            }
        }
    }
}