| | |
| | | { |
| | | try |
| | | { |
| | | if(CheckAccount(accountStr)==false) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining)); |
| | | |
| | | var requestObj = new SendDataToServer.LoginObj |
| | |
| | | Config.Instance.MD5PWD = revertData.MD5PWD;
|
| | | Config.Instance.Guid = revertData.Guid; |
| | | Config.Instance.LoginDateTime = DateTime.Now; |
| | | Config.Instance.LoginToken = revertData.Token; |
| | | if (Config.Instance.AccountList.Find((obj) => obj == revertData.Account) == null) |
| | | { |
| | | Config.Instance.AccountList.Add(revertData.Account); |
| | |
| | | //}); |
| | | }; |
| | | action(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// CheckAccount |
| | | /// </summary> |
| | | /// <param name="accountStr"></param> |
| | | /// <returns></returns> |
| | | private bool CheckAccount(string accountStr) |
| | | { |
| | | if (phoneEmailForm.SelectedEmail.IsSelected) |
| | | { |
| | | if (AccountLogic.Instance.CheckEmail(accountStr) == false) |
| | | { |
| | | loginErrorBtn.TextID = R.MyInternationalizationString.TheEmailError; |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (AccountLogic.Instance.CheckPhone(accountStr) == false) |
| | | { |
| | | loginErrorBtn.TextID = R.MyInternationalizationString.ThePhoneError; |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | #endif |
| | | |
| | | #if iOS |
| | | GateWay.Ios.AppDelegate.WXLogin(); |
| | | GateWay.Ios.AppDelegate.RespAction = (authStr) => |
| | | Home.IOS.AppDelegate.WXLogin(); |
| | | Home.IOS.AppDelegate.RespAction = (authStr) => |
| | | { |
| | | if (authStr == null) |
| | | { |
| | |
| | | { |
| | | phoneEmailForm.SelectedPhone.IsSelected = phoneEmailForm.SelectedEmail.IsSelected = false; |
| | | loginBtn.Enable = loginBtn.IsSelected = false; |
| | | loginErrorBtn.Text = string.Empty; |
| | | (sender as Button).IsSelected = true; |
| | | if((sender as Button).Tag.ToString()=="Phone") |
| | | { |
| | |
| | | pwdRow = new PwdLoginRowForm(); |
| | | pwdRow.Init(accountPwdFrameLayout, 29, 225); |
| | | pwdRow.PasswrodET.TextChangeEventHandler += Pwd_TextChange; |
| | | |
| | | |
| | | } |
| | | #endregion |
| | | |
| | |
| | | private void Register(object sender,MouseEventArgs mouseEventArgs) |
| | | { |
| | | var registerPage = new AccountRegister(); |
| | | Shared.Common.CommonPage.Instance.AddChidren(registerPage); |
| | | CommonPage.Instance.AddChidren(registerPage); |
| | | registerPage.Show(); |
| | | } |
| | | |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void Account_TextChange(object sender,string mouseEventArgs) |
| | | { |
| | | loginErrorBtn.Text = ""; |
| | | loginErrorBtn.Text = string.Empty; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void Pwd_TextChange(object sender,string mouseEventArgs) |
| | | { |
| | | loginErrorBtn.Text = ""; |
| | | loginErrorBtn.Text = string.Empty; |
| | | if (1 <= pwdRow.PasswrodET.Text.Trim().Length && pwdRow.PasswrodET.Text.Trim().Length <= 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow.AccountET.Text.Trim().Length>0)) |
| | | { |
| | | loginBtn.Enable = loginBtn.IsSelected = true; |