| | |
| | | //AddBody |
| | | AddBodyView(); |
| | | |
| | | |
| | | //bind |
| | | BindEvent(); |
| | | } |
| | |
| | | } |
| | | pwdRow = new PwdRowForm(); |
| | | pwdRow.Init(accountCodeFrameLayout, 29, 196); |
| | | //pwdRow.PasswrodET.TextChangeEventHandler += Account_TextChange; |
| | | pwdRow.PasswrodET.TextChangeEventHandler += Code_TextChange; |
| | | |
| | | pwdComfireRow = new PwdRowForm(); |
| | | pwdComfireRow.Init(accountCodeFrameLayout, 29, 363); |
| | | //pwdComfireRow.PasswrodET.TextChangeEventHandler += Account_TextChange; |
| | | pwdComfireRow.PasswrodET.TextChangeEventHandler += Code_TextChange; |
| | | pwdComfireRow.SetPlaceholdText(Language.StringByID(R.MyInternationalizationString.PleaseComfirePWD)); |
| | | |
| | | codeRow = new CodeForRegisterRowForm(); |
| | |
| | | phoneEmailForm.SelectedEmail.MouseUpEventHandler += SelectPhoneOrEmail_MouseUpEvent; |
| | | registerBtn.MouseUpEventHandler += Register; |
| | | loginByAccountPWDBtn.MouseUpEventHandler += LoginByPWD; |
| | | codeRow.VerificationCodeET.TextChangeEventHandler += Code_TextChange; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private async void Register(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | if (CheckAccount(account) == false) |
| | | { |
| | | return; |
| | | } |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TwoPasswordInconsistency; |
| | | return; |
| | | } |
| | | |
| | | if (AccountLogic.Instance.CheckPwdLength(pwdRow.PasswrodET.Text.Trim()) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePWDLengthError; |
| | | return; |
| | | } |
| | | |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | |
| | | errorBtn.Text = string.Empty; |
| | | if ((sender as EditText).Text.Trim().Length > 0) |
| | | { |
| | | //IsRightAccount = true; |
| | | codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | //IsRightAccount = false; |
| | | codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = false; |
| | | } |
| | | account = (sender as EditText).Text.Trim(); |
| | |
| | | private void Code_TextChange(object sender, string mouseEventArgs) |
| | | { |
| | | errorBtn.Text = string.Empty; |
| | | if ((sender as EditText).Text.Trim().Length > 0) |
| | | if (codeRow.VerificationCodeET.Text.Trim().Length > 0 && account.Trim().Length > 0 && pwdRow.PasswrodET.Text.Trim().Length > 0 && pwdComfireRow.PasswrodET.Text.Trim().Length > 0) |
| | | { |
| | | registerBtn.Enable = registerBtn.IsSelected = true; |
| | | } |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private async void SendCode_MouseUpEventAsync(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | (sender as Button).Enable = (sender as Button).IsSelected = false; |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.TwoPasswordInconsistency), Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | alert.Show(); |
| | | codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = false; |
| | | if (CheckAccount(account) == false) |
| | | { |
| | | return; |
| | | } |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TwoPasswordInconsistency; |
| | | return; |
| | | } |
| | | |
| | | if (AccountLogic.Instance.CheckPwdLength(pwdRow.PasswrodET.Text.Trim()) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePWDLengthError; |
| | | return; |
| | | } |
| | | |
| | | CommonPage.Loading.Start(); |
| | | (sender as Button).Enable = (sender as Button).IsSelected = false; |
| | | try |
| | |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// CheckAccount |
| | | /// </summary> |
| | | /// <param name="accountStr"></param> |
| | | /// <returns></returns> |
| | | private bool CheckAccount(string accountStr) |
| | | { |
| | | errorBtn.Text = string.Empty; |
| | | if (phoneEmailForm.SelectedEmail.IsSelected) |
| | | { |
| | | if (AccountLogic.Instance.CheckEmail(accountStr) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TheEmailError; |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (AccountLogic.Instance.CheckPhoneWithZone(accountStr, CommonPage.PhoneZoneStr) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePhoneError; |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |