| | |
| | | //邮箱方式-验证邮箱是否正确 |
| | | var reg = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); |
| | | var mFalg = reg.Match(etAccount.Text.Trim()); |
| | | if (!mFalg.Success || (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11)) |
| | | if (!mFalg.Success ) |
| | | { |
| | | btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | |
| | | btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; |
| | | btnPasswordViewBottomLine.Height = Application.GetRealHeight(1); |
| | | //校验密码是否符合要求 |
| | | if (etPassword.Text.Trim().Length < 6) |
| | | if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | { |
| | | if (btnGetVerificationCode.IsSelected) |
| | | { |
| | | //短信发送间隔60s |
| | | btnGetVerificationCode.IsSelected = false; |
| | | etVerificationCode.Foucs = true; |
| | | //获取验证码 |
| | | var result = pm.SendSms(etAccount.Text.Trim()); |
| | | if (result.StateCode == "Success") |
| | | { |
| | | //短信发送间隔60s |
| | | btnGetVerificationCode.IsSelected = false; |
| | | etVerificationCode.Foucs = true; |
| | | int time = 60; |
| | | new Thread(() => |
| | | new Thread(() => { |
| | | while (time > 0) |
| | | { |
| | | while (time > 0) |
| | | time--; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | time--; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnGetVerificationCode.Text = time.ToString() + "s"; |
| | | }); |
| | | Thread.Sleep(1000); |
| | | } |
| | | btnGetVerificationCode.Text = time.ToString() + "s"; |
| | | }); |
| | | Thread.Sleep(1000); |
| | | } |
| | | }){ IsBackground = true}.Start(); |
| | | new Thread(() => |
| | | { |
| | | var result = pm.SendSms(etAccount.Text.Trim()); |
| | | if (result.StateCode == "Success") |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //回复获取短信按钮事件 |
| | | btnGetVerificationCode.IsSelected = true; |
| | | btnGetVerificationCode.TextID = StringId.GetVerificationCode; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | string tipString = "Server error"; |
| | | switch (result.StateCode) |
| | | { |
| | | case "Exist": |
| | | tipString = Language.StringByID(StringId.AccountAlreadyExists); |
| | | break; |
| | | case "SendFail": |
| | | tipString = Language.StringByID(StringId.FailedToSendVerificationCode); |
| | | break; |
| | | case "Self:Net_Error": |
| | | tipString = Language.StringByID(StringId.NetworkAnomaly); |
| | | break; |
| | | } |
| | | |
| | | new Tip() |
| | | else |
| | | { |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None, |
| | | Text = tipString |
| | | }.Show(bodyView); |
| | | } |
| | | string tipString = "Server error"; |
| | | switch (result.StateCode) |
| | | { |
| | | case "Exist": |
| | | tipString = Language.StringByID(StringId.AccountAlreadyExists); |
| | | break; |
| | | case "SendFail": |
| | | tipString = Language.StringByID(StringId.FailedToSendVerificationCode); |
| | | break; |
| | | case "AccountNoExists": |
| | | tipString = Language.StringByID(StringId.AccountNotExist); |
| | | break; |
| | | case "Self:Net_Error": |
| | | tipString = Language.StringByID(StringId.NetworkAnomaly); |
| | | break; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None, |
| | | Text = tipString |
| | | }.Show(bodyView); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | }; |
| | | } |
| | |
| | | //创建修改密码线程 |
| | | var loginThread = LoadMothed_ResetThread(); |
| | | waitPage = new Loading(); |
| | | new WaitPageMothed().LoadPage_WaitPage(loginThread, bodyView, waitPage); |
| | | new PublicAssmebly().LoadPage_WaitPage(loginThread, bodyView, waitPage); |
| | | } |
| | | }; |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | this.Close(); |
| | | LoadEvent_AutoLogin(); |
| | | |
| | | callbackAction?.Invoke(account); |
| | | }); |
| | | } |
| | |
| | | { |
| | | case "ValidCodeAndPhoneNoEqual"://验证码错误 |
| | | erorrInfo = Language.StringByID(StringId.VerificationCodeWrong); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2); |
| | | }); |
| | | break; |
| | | case "NoRecord": |
| | | erorrInfo = Language.StringByID(StringId.PlsGetTheVerificationCode); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2); |
| | | }); |
| | | break; |
| | | default: |
| | | erorrInfo = "Server error"; |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 住宅成功之后自动登录 |
| | | /// </summary> |
| | | void LoadEvent_AutoLogin() |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout frame = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(198), |
| | | Width = Application.GetRealWidth(288), |
| | | Height = Application.GetRealHeight(206), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | }; |
| | | dialog.AddChidren(frame); |
| | | |
| | | Button btnAccountText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(40), |
| | | Height = Application.GetRealHeight(17 + 14 + 14), |
| | | IsMoreLines = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = "s是生生世世", |
| | | }; |
| | | frame.AddChidren(btnAccountText); |
| | | |
| | | Button btnTipRegisterSuccess = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(123), |
| | | Height = Application.GetRealHeight(30), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.PasswordChangeSuccessfully, |
| | | }; |
| | | frame.AddChidren(btnTipRegisterSuccess); |
| | | |
| | | Button btnAutoLoginTip = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = btnTipRegisterSuccess.Bottom, |
| | | Height = Application.GetRealHeight(17 + 8), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.AutomaticallyLogin, |
| | | }; |
| | | frame.AddChidren(btnAutoLoginTip); |
| | | |
| | | Button btnHeadImage = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(150), |
| | | Width = Application.GetRealWidth(84), |
| | | Height = Application.GetRealWidth(84), |
| | | Radius = (uint)Application.GetRealWidth(42), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | UnSelectedImagePath = "LoginIcon/2.png", |
| | | }; |
| | | dialog.AddChidren(btnHeadImage); |
| | | |
| | | dialog.Show(); |
| | | |
| | | new Thread(() => |
| | | { |
| | | Thread.Sleep(1500); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.Close(); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |