old mode 100755
new mode 100644
| | |
| | | /// </summary> |
| | | public AccountLoginByCode() |
| | | { |
| | | CommonPage.Instance.IsDrawerLockMode = true; |
| | | Tag = "Login"; |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | t = new Timer(); |
| | |
| | | Width = Application.GetRealWidth(942), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(30) |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | }; |
| | | midFrameLayout.AddChidren(accountCodeFL); |
| | | |
| | |
| | | LoginByAccountPWDBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(98), |
| | | Y = Application.GetRealHeight(1446), |
| | | Y = Application.GetRealHeight(1466), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(49), |
| | | TextID = R.MyInternationalizationString.LoginByAccountPWD, |
| | |
| | | registerBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(738), |
| | | Y = Application.GetRealHeight(1446), |
| | | Y = Application.GetRealHeight(1466), |
| | | Width = Application.GetRealWidth(244), |
| | | Height = Application.GetRealHeight(49), |
| | | TextID = R.MyInternationalizationString.Register, |
| | |
| | | { |
| | | return; |
| | | } |
| | | this.RemoveFromParent(); |
| | | Application.MainPage?.RemoveViewByTag("Login"); |
| | | |
| | | UserPage.Instance.Fresh(); |
| | | |
| | | HomePage.Instance.ShowLoginLoadView(); |
| | | new System.Threading.Thread(async () => |
| | | { |
| | | //启动ZigBee |
| | | ZigBee.Common.Application.Init(); |
| | | var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(requestRevetLoginCodeOBJ.ResponseData.ToString()); |
| | | var revertData = responseDataObj; |
| | | Config.ReFresh(); |
| | | Config.Instance.Password = string.Empty; |
| | | Config.Instance.Account = revertData.Account; |
| | | Config.Instance.MqttKey = revertData.MqttKey; |
| | | Config.Instance.Guid = revertData.Guid; |
| | | Config.Instance.MD5PWD = revertData.MD5PWD; |
| | | Config.Instance.LoginDateTime = DateTime.Now; |
| | | Config.Instance.ConnectZigbeeMqttBrokerPwd = revertData.ConnectZigbeeMqttBrokerPwd; |
| | | Config.Instance.ConnectZigbeeMqttClientId = revertData.ConnectZigbeeMqttClientId; |
| | | Config.Instance.ZigbeeMqttBrokerLoadSubDomain = revertData.ZigbeeMqttBrokerLoadSubDomain; |
| | | Config.Instance.LoginToken = revertData.Token; |
| | | if (Config.Instance.AccountList.Find((obj) => obj == revertData.Account) == null) |
| | | { |
| | | Config.Instance.AccountList.Add(revertData.Account); |
| | |
| | | Config.Instance.MD5PWD = revertData.MD5PWD; |
| | | Config.Instance.Save(); |
| | | var resultRegID = await CommonPage.Instance.PushRegID(); |
| | | var homes = await House.GetHomeLists(); |
| | | |
| | | var homes = await House.GetHomeLists();
|
| | | //启动ZigBee
|
| | | ZigBee.Common.Application.Init(); |
| | | //刷新个人中心的内存及线程 |
| | | await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread(); |
| | | |
| | | Shared.Common.Room.CanInitAllRoom = true; |
| | | Shared.Common.Room.InitAllRoom(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | | CommonPage.Instance.RemoveViewByTag("Login"); |
| | | UserPage.Instance.Fresh(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | |
| | | private void AddPhoneOrEmailFL(FrameLayout accountCodeFrameLayout, string phoneOrEmail) |
| | | { |
| | | accountCodeFrameLayout.RemoveAll(); |
| | | |
| | | account = string.Empty; |
| | | loginErrorBtn.Text = string.Empty; |
| | | if (phoneOrEmail == "Phone") |
| | | { |
| | | phoneRow = new PhoneRowForm(); |
| | |
| | | /// <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; |
| | | if ((sender as EditText).Text.Trim().Length > 0) |
| | | { |
| | | IsRightAccount = true; |
| | | codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = true; |
| | | account= (sender as EditText).Text.Trim(); |
| | | } |
| | | else |
| | | { |
| | | IsRightAccount = false; |
| | | codeRow.SendCodeBtn.Enable = codeRow.SendCodeBtn.IsSelected = false; |
| | | } |
| | | account = (sender as EditText).Text.Trim(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | private void Register(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | this.RemoveFromParent(); |
| | | var login = new AccountLogin(); |
| | | CommonPage.Instance.AddChidren(login); |
| | | login.Show(); |
| | | var registerPage = new AccountRegister(); |
| | | CommonPage.Instance.AddChidren(registerPage); |
| | | registerPage.Show(); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private async void SendCode_MouseUpEventAsync(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | if (CheckAccount(account) == false) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | (sender as Button).Enable = (sender as Button).IsSelected = false; |
| | | CommonPage.Loading.Start(); |
| | | try |
| | |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// CheckAccount |
| | | /// </summary> |
| | | /// <param name="accountStr"></param> |
| | | /// <returns></returns> |
| | | private bool CheckAccount(string accountStr) |
| | | { |
| | | loginErrorBtn.Text = string.Empty; |
| | | if (phoneEmailForm.SelectedEmail.IsSelected) |
| | | { |
| | | if (AccountLogic.Instance.CheckEmail(accountStr) == false) |
| | | { |
| | | loginErrorBtn.TextID = R.MyInternationalizationString.TheEmailError; |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (AccountLogic.Instance.CheckPhoneWithZone(accountStr, CommonPage.PhoneZoneStr) == false) |
| | | { |
| | | loginErrorBtn.TextID = R.MyInternationalizationString.ThePhoneError; |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 验证验证码________________________ |