From 2ed75b8b337048e5d75e6d9ec8307633134f02fd Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 10 十月 2019 11:33:04 +0800
Subject: [PATCH] 个人中心添加楼层和创建房间,实装二级验证

---
 ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs |  440 +++++++++++++++++++++++++-----------------------------
 1 files changed, 203 insertions(+), 237 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs b/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
index 6287edc..145ef10 100755
--- a/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
@@ -7,6 +7,7 @@
 using Shared.IO;
 using Shared.Phone.UserView;
 using System.Net.Http;
+using Shared.Phone.Device.CommonForm;
 
 namespace Shared.Phone.Device.Account
 {
@@ -21,25 +22,26 @@
         /// </summary>
         private FrameLayout midFrameLayout;
         /// <summary>
-        /// 娉ㄥ唽鎸夐挳
+        /// 鎵嬫満閭
         /// </summary>
-        private Button registerBtn;
+        private PhoneEmailForm phoneEmailForm;
         /// <summary>
-        /// 璐﹀彿杈撳叆鎺т欢
+        /// phoneRowForm
         /// </summary>
-        private EditText accountET;
+        private PhoneLoginRowForm phoneRow;
         /// <summary>
-        /// 瀵嗙爜杈撳叆鎺т欢
+        /// emailRow
         /// </summary>
-        private EditText passwrodET;
+        private EmailLoginRowForm emailRow;
         /// <summary>
-        /// 鐧诲綍鎸夐挳
+        /// pwdRow
         /// </summary>
-        private Button loginBtn;
+        private PwdLoginRowForm pwdRow;
+
         /// <summary>
-        /// 闅愯棌瀵嗙爜
+        /// 璐﹀彿瀵嗙爜fl
         /// </summary>
-        private Button hidenPWDbtn;
+        private FrameLayout accountPwdFL;
         /// <summary>
         /// 鐧诲綍閿欒鎻愮ず鎸夐挳
         /// </summary>
@@ -49,9 +51,26 @@
         /// </summary>
         private Button forgotPasswordBtn;
         /// <summary>
+        /// 鐧诲綍鎸夐挳
+        /// </summary>
+        private Button loginBtn;
+        /// <summary>
         /// 楠岃瘉鐮佺櫥褰曟寜閽�
         /// </summary>
         private Button loginByCodeBtn;
+        /// <summary>
+        /// 娉ㄥ唽鎸夐挳
+        /// </summary>
+        private Button registerBtn;
+        /// <summary>
+        /// 璐﹀彿
+        /// </summary>
+        private string account;
+        /// <summary>
+        /// 瀵嗙爜
+        /// </summary>
+        private string password;
+
 
         #endregion
 
@@ -62,7 +81,13 @@
         /// </summary>
         public AccountLogin()
         {
-             BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
+            BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
+            Tag = "Login";
+        }
+
+        public override void RemoveFromParent()
+        {
+            base.RemoveFromParent();
         }
 
         #endregion
@@ -93,165 +118,144 @@
         /// <param name="password">Password.</param>
         public void LoginViewShow(string account = "", string password = "")
         {
+            this.account = account;
+            this.password = password;
             #region midFrameLayout
             midFrameLayout = new FrameLayout()
             {
                 Width = LayoutParams.MatchParent,
                 Height = Application.GetRealHeight(CommonPage.AppRealHeight),
-                //Y = Application.GetRealHeight(36),
                 BackgroundColor =ZigbeeColor.Current.GXCBackgroundColor
             };
             AddChidren(midFrameLayout);
             #endregion
 
             #region 甯冨眬璐︽埛锛屽瘑鐮侊紝蹇樿瀵嗙爜锛屾敞鍐�  鎵嬫満楠岃瘉鐮佺櫥褰�
-            registerBtn = new Button()
-            {
-                Width = Application.GetRealWidth(250),
-                Height = Application.GetRealHeight(80),
-                X = Application.GetRealWidth(CommonPage.AppRealWidth-250-50),
-                Y = Application.GetRealHeight(100),
-                TextID = R.MyInternationalizationString.Register,
-                TextSize = 15,
-                TextColor = ZigbeeColor.Current.GXCTextBlueColor,
-                TextAlignment = TextAlignment.CenterRight
-            };
-            midFrameLayout.AddChidren(registerBtn);
 
-             var logoBtn = new Button()
+            var logoBG = new Button()
             {
-                Width = Application.GetMinRealAverage(270),
-                Height = Application.GetMinRealAverage(270),
-                Y = Application.GetRealHeight(150)+registerBtn.Bottom,
-                UnSelectedImagePath = "Logo/Logo.png",
-                Gravity=Gravity.CenterHorizontal
+                Height = Application.GetRealHeight(619),
+                UnSelectedImagePath = "Account/Logo_loginBG.png"
             };
-            midFrameLayout.AddChidren(logoBtn);
+            midFrameLayout.AddChidren(logoBG);
 
-            var accountFL = new FrameLayout()
+            var phoneEmailBGFL = new FrameLayout()
             {
-                Width = Application.GetRealWidth(700),
-                Height = Application.GetRealHeight(110),
-                Y = Application.GetRealHeight(200) + logoBtn.Bottom,
-                Radius = (uint)Application.GetRealHeight(55),
-                BorderColor = ZigbeeColor.Current.GXCBorderColor,
-                BorderWidth = 1,
+                Y = logoBG.Bottom,
+                Height = Application.GetRealHeight(1921),
+                BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
+            };
+            midFrameLayout.AddChidren(phoneEmailBGFL);
+
+            var logo = new Button()
+            {
+                Width = Application.GetMinRealAverage(184),
+                Height = Application.GetMinRealAverage(184),
+                Y = Application.GetRealHeight(230),
+                UnSelectedImagePath = "Account/Logo_White.png",
                 Gravity = Gravity.CenterHorizontal
             };
-            midFrameLayout.AddChidren(accountFL);
+            midFrameLayout.AddChidren(logo);
 
-            accountET = new EditText()
+            var logoName = new Button()
             {
-                X=Application.GetRealWidth(20),
-                Width = Application.GetRealWidth(660),
-                PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPhoneNumberOrEmail),
-                TextAlignment = TextAlignment.Center,
-                PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
-                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
-                Text=account
+                Y = logo.Bottom,
+                Height = Application.GetRealHeight(69),
+                Width = Application.GetRealWidth(300),
+                Gravity = Gravity.CenterHorizontal,
+                TextID = R.MyInternationalizationString.AppName,
+                TextColor = ZigbeeColor.Current.GXCTextWhiteColor
             };
-            accountFL.AddChidren(accountET);
+            midFrameLayout.AddChidren(logoName);
 
-            var passwordFL = new FrameLayout()
+            phoneEmailForm = new PhoneEmailForm();
+            phoneEmailForm.Init(midFrameLayout);
+
+            //閿欒鎻愮ずBtn
+            loginErrorBtn = new Button()
             {
+                X = Application.GetRealWidth(242),
+                Y = Application.GetRealHeight(740),
                 Width = Application.GetRealWidth(700),
-                Height = Application.GetRealHeight(110),
-                Y = accountFL.Bottom + Application.GetRealHeight(100),
-                Radius = (uint)Application.GetRealHeight(55),
-                BorderColor = ZigbeeColor.Current.GXCBorderColor,
-                BorderWidth = 1,
-                Gravity = Gravity.CenterHorizontal
+                Height = Application.GetRealHeight(58),
+                TextColor = ZigbeeColor.Current.GXCTextRed,
+                TextAlignment = TextAlignment.CenterLeft,
             };
-            midFrameLayout.AddChidren(passwordFL);
+            midFrameLayout.AddChidren(loginErrorBtn);
 
-            passwrodET = new EditText()
+            accountPwdFL = new FrameLayout()
             {
-                Width = Application.GetRealWidth(450),
-                PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPWD),
-                TextAlignment = TextAlignment.Center,
-                SecureTextEntry = true,
-                PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
-                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
-                Text=password,
-                Gravity=Gravity.CenterHorizontal
+                Y = Application.GetRealHeight(801),
+                Height = Application.GetRealHeight(553),
+                Width = Application.GetRealWidth(942),
+                Gravity = Gravity.CenterHorizontal,
+                BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
+                Radius = (uint)Application.GetRealHeight(30)
             };
-            passwordFL.AddChidren(passwrodET);
+            midFrameLayout.AddChidren(accountPwdFL);
 
-            hidenPWDbtn = new Button()
-            {
-                X = passwrodET.Right + Application.GetRealWidth(20),
-                Width = Application.GetMinReal(72),
-                Height = Application.GetMinReal(72),
-                UnSelectedImagePath = "Account/HidenPWD.png",
-                SelectedImagePath = "Account/UnHidenPWD.png",
-                Gravity=Gravity.CenterVertical
-            };
-            passwordFL.AddChidren(hidenPWDbtn);
+            AddPhoneOrEmailFL(accountPwdFL, "Phone");
 
             forgotPasswordBtn = new Button()
             {
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(110),
-                Y = passwordFL.Bottom + Application.GetRealHeight(100),
-                TextID = R.MyInternationalizationString.ForgotPassword,
-                TextSize = 15,
-                TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor,
-                TextAlignment = TextAlignment.Center,
-                Gravity=Gravity.CenterHorizontal
+                X = Application.GetRealWidth(CommonPage.AppRealWidth - 115 - 250),
+                Y = Application.GetRealHeight(1198),
+                Width = Application.GetRealWidth(250),
+                Height = Application.GetRealHeight(58),
+                TextID = R.MyInternationalizationString.ForgotPWD,
+                TextSize = CommonFormResouce.loginTextSize,
+                TextColor = Shared.Common.ZigbeeColor.Current.GXCTextGrayColor,
+                TextAlignment = TextAlignment.CenterRight
             };
             midFrameLayout.AddChidren(forgotPasswordBtn);
 
             loginBtn = new Button()
             {
-                Width = Application.GetRealWidth(700),
-                Height = Application.GetRealHeight(110),
-                Y = Application.GetRealHeight(100) + forgotPasswordBtn.Bottom,
+                Y = Application.GetRealHeight(1293),
+                Width = Application.GetRealWidth(688),
+                Height = Application.GetRealHeight(127),
+                Gravity = Gravity.CenterHorizontal,
                 TextID = R.MyInternationalizationString.Login,
                 TextSize = 15,
-                TextColor = Shared.Common.ZigbeeColor.Current.GXCTextWhiteColor,
-                Radius = (uint)Application.GetRealHeight(55),
-                BorderWidth = 0,
-                BackgroundColor = ZigbeeColor.Current.GXCButtonUnselectedColor,
-                SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonBlueColor,
-                Gravity = Gravity.CenterHorizontal,
-                Enable = !string.IsNullOrEmpty(passwrodET.Text),
-                IsSelected = !string.IsNullOrEmpty(passwrodET.Text)
+                TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+                SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+                SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor,
+                BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor,
+                Radius = (uint)Application.GetRealHeight(127 / 2),
+                Enable = !string.IsNullOrEmpty(pwdRow.PasswrodET?.Text),
+                IsSelected = !string.IsNullOrEmpty(pwdRow.PasswrodET?.Text)
             };
             midFrameLayout.AddChidren(loginBtn);
 
-            //閿欒鎻愮ずBtn
-            loginErrorBtn = new Button()
-            {
-                Y=loginBtn.Bottom+Application.GetRealHeight(50),
-                Width=Application.GetRealWidth(1080-100),
-                Height=Application.GetRealHeight(110),
-                TextColor=ZigbeeColor.Current.GXCRedColor,
-                Gravity=Gravity.CenterHorizontal
-            };
-            midFrameLayout.AddChidren(loginErrorBtn);
-
             loginByCodeBtn = new Button()
             {
+                X=Application.GetRealWidth(98),
+                Y = Application.GetRealHeight(1431),
                 Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(110),
-                Y = midFrameLayout.Bottom - Application.GetRealHeight(100+110),
+                Height = Application.GetRealHeight(49),
                 TextID = R.MyInternationalizationString.LoginByCode,
-                TextColor = ZigbeeColor.Current.GXCTextBlueColor,
-                TextAlignment = TextAlignment.Center,
-                TextSize = 15,
-                Gravity = Gravity.CenterHorizontal
+                TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CommonFormResouce.loginTextSize
             };
             midFrameLayout.AddChidren(loginByCodeBtn);
-            #endregion
 
-            #region event
-            passwrodET.EditorEnterAction = (ae) =>
+            registerBtn = new Button()
             {
-                Application.HideSoftInput();
+                X = Application.GetRealWidth(738),
+                Y = Application.GetRealHeight(1431),
+                Width = Application.GetRealWidth(244),
+                Height = Application.GetRealHeight(49),
+                TextID = R.MyInternationalizationString.Register,
+                TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+                TextAlignment = TextAlignment.CenterRight,
+                TextSize = CommonFormResouce.loginTextSize
             };
+            midFrameLayout.AddChidren(registerBtn);
+
+            #endregion
 
             BindEvent();
-            #endregion
         }
 
         #endregion
@@ -263,20 +267,17 @@
         /// </summary>
         private void BindEvent()
         {
+            //閫夋嫨鎵嬫満閭
+            phoneEmailForm.SelectedPhone.MouseUpEventHandler += SelectPhoneOrEmail_MouseUpEvent;
+            phoneEmailForm.SelectedEmail.MouseUpEventHandler += SelectPhoneOrEmail_MouseUpEvent;
             //鐧诲綍浜嬩欢
             loginBtn.MouseUpEventHandler += LoginBtnEvent;
             //鐭俊鐧诲綍
             loginByCodeBtn.MouseUpEventHandler += LoginByCode;
-            //蹇樿瀵嗙爜
-            forgotPasswordBtn.MouseUpEventHandler += ForgetPWD;
             //娉ㄥ唽浜嬩欢
             registerBtn.MouseUpEventHandler += Register;
-            //璐﹀彿鐩戝惉
-            accountET.TextChangeEventHandler += Account_TextChange;
-            //瀵嗙爜鐩戝惉浜嬩欢
-            passwrodET.TextChangeEventHandler += Pwd_TextChange;
-            //闅愯棌瀵嗙爜
-            hidenPWDbtn.MouseUpEventHandler += HidePWD;
+            //蹇樿瀵嗙爜
+            forgotPasswordBtn.MouseUpEventHandler += ForgetPWD_MouseUpEvent;
 
         }
 
@@ -291,15 +292,23 @@
         /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
         private void LoginBtnEvent(object sender,MouseEventArgs mouseEventArgs)
         {
-            Login(accountET.Text.Trim(), passwrodET.Text.Trim());
+            if (phoneEmailForm.SelectedPhone.IsSelected)
+            {
+                Login(phoneRow.AccountET.Text.Trim(), pwdRow.PasswrodET.Text.Trim());
+            }
+            else
+            {
+                Login(phoneRow.AccountET.Text.Trim(), pwdRow.PasswrodET.Text.Trim());
+            }
+
         }
 
         /// <summary>
         /// 鐧诲綍
         /// </summary>
-        /// <param name="account">Account.</param>
-        /// <param name="password">Password.</param>
-        private void Login(string account, string password)
+        /// <param name="accountStr">Account.</param>
+        /// <param name="passwordStr">Password.</param>
+        private void Login(string accountStr, string passwordStr)
         {
             //Application.RunOnMainThread( () =>
             //{
@@ -311,8 +320,8 @@
 
                     var requestObj = new SendDataToServer.LoginObj
                     {
-                        Account = account,
-                        Password = password,
+                        Account = accountStr,
+                        Password = passwordStr,
                         Source = CommonPage.Source,
                         Company = CommonPage.Company
                     };
@@ -321,6 +330,7 @@
                     if (revertObj == null)
                     {
                         CommonPage.Instance.FailureToServer();
+                        CommonPage.Loading.Hide();
                         return;
                     }
                     var stateCodeStr = revertObj.StateCode.ToUpper();
@@ -343,12 +353,10 @@
                             var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString());
                             var revertData = responseDataObj;
                             Config.ReFresh();
-                            Config.Instance.UserID = revertData.UserID;
-                            Config.Instance.MasterID = revertData.MainUserID;
-                            Config.Instance.AccountType = revertData.UserType;
                             Config.Instance.Account = revertData.Account;
                             Config.Instance.MqttKey = revertData.MqttKey;
-                            Config.Instance.Password = password;
+                            Config.Instance.Password = passwordStr;
+                            Config.Instance.MD5PWD = revertData.MD5PWD;
                             Config.Instance.Guid = revertData.Guid;
                             Config.Instance.LoginDateTime = DateTime.Now;
                             Config.Instance.ConnectZigbeeMqttBrokerPwd = revertData.ConnectZigbeeMqttBrokerPwd;
@@ -364,7 +372,7 @@
                             var homes = await House.GetHomeLists();
                             //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
                             await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
-                            Shared.Common.Room.canInitAllRoom = true;
+                            Shared.Common.Room.CanInitAllRoom = true;
                             Shared.Common.Room.InitAllRoom();
                             Application.RunOnMainThread(() =>
                             {
@@ -379,28 +387,24 @@
                         CommonPage.Loading.Hide();
                         //鏈縺娲�
                         loginErrorBtn.TextID = R.MyInternationalizationString.NOTVERIFY;
-                        CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.NOTVERIFY);
                     }
                     else if (stateCodeStr == "NOTENABLE")
                     {
                         CommonPage.Loading.Hide();
                         //璇ョ敤鎴峰睘浜庤皟璇曡处鍙凤紝骞舵湭鍚敤
                         loginErrorBtn.TextID = R.MyInternationalizationString.NOTENABLE;
-                        CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.NOTENABLE);
                     }
                     else if (stateCodeStr == "USERNAMEORPWDERROR")
                     {
                         CommonPage.Loading.Hide();
                         //璐﹀彿鎴栧瘑鐮侀敊璇�
                         loginErrorBtn.TextID = R.MyInternationalizationString.USERNAMEORPWDERROR;
-                        CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.USERNAMEORPWDERROR);
                     }
                     else if (stateCodeStr == "ACCOUNTNOEXISTS")
                     {
                         CommonPage.Loading.Hide();
                         //璐﹀彿涓嶅瓨鍦�
                         loginErrorBtn.TextID = R.MyInternationalizationString.ACCOUNTNOEXISTS;
-                        CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.ACCOUNTNOEXISTS);
                     }
                     else if (stateCodeStr == "YOUDATANOISLOCALREGION")
                     {
@@ -413,12 +417,11 @@
                         var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginLocalRegionRes>(revertObj.ResponseData.ToString());
                         CommonPage.RequestHttpsHost = responseDataObj.RegionServer;
                         //鍐嶆鐧诲綍
-                        Login(account, password);
+                        Login(accountStr, passwordStr);
                     }
                     else
                     {
                         loginErrorBtn.TextID = R.MyInternationalizationString.RequestServerFailed;
-                        CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.RequestServerFailed);
                     }
                 }
                 catch (Exception ex)
@@ -449,91 +452,65 @@
             loginByCodePage.Show();
         }
 
+        /// <summary>
+        /// phone/email 閫夋嫨
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="mouseEventArgs"></param>
+        private void SelectPhoneOrEmail_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
+        {
+            phoneEmailForm.SelectedPhone.IsSelected = phoneEmailForm.SelectedEmail.IsSelected = false;
+            loginBtn.Enable = loginBtn.IsSelected = false;
+            (sender as Button).IsSelected = true;
+            if((sender as Button).Tag.ToString()=="Phone")
+            {
+                AddPhoneOrEmailFL(accountPwdFL, "Phone");
+            }
+            else
+            {
+                AddPhoneOrEmailFL(accountPwdFL, "Email");
+            }
+        }
+        /// <summary>
+        /// AddPhoneOrEmailFL
+        /// </summary>
+        /// <param name="accountPwdFrameLayout"></param>
+        /// <param name="phoneOrEmail"></param>
+        private void AddPhoneOrEmailFL(FrameLayout accountPwdFrameLayout,string phoneOrEmail)
+        {
+            accountPwdFrameLayout.RemoveAll();
+
+            if (phoneOrEmail == "Phone")
+            {
+                phoneRow = new PhoneLoginRowForm();
+                phoneRow.Init(accountPwdFrameLayout, this, this.account, 29, 29);
+                phoneRow.AccountET.TextChangeEventHandler += Account_TextChange;
+            }
+            else
+            {
+                emailRow = new EmailLoginRowForm();
+                emailRow.Init(accountPwdFrameLayout, this.account, 29, 29);
+                emailRow.AccountET.TextChangeEventHandler += Account_TextChange;
+            }
+
+            pwdRow = new PwdLoginRowForm();
+            pwdRow.Init(accountPwdFrameLayout, 29, 225);
+            pwdRow.PasswrodET.TextChangeEventHandler += Pwd_TextChange;
+
+
+        }
         #endregion
+
 
         #region 鈼� 蹇樿瀵嗙爜________________________
         /// <summary>
         /// 蹇樿瀵嗙爜
         /// </summary>
-        private void ForgetPWD(object sender, MouseEventArgs mouseEventArgs)
+        private void ForgetPWD_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
         {
-            var forgetWPDDialog = new Dialog()
-            {
-                BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
-            };
-            forgetWPDDialog.Show();
-            var forgetSelectedView = new FrameLayout()
-            {
-                BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor,
-                Gravity = Gravity.Center,
-                Width = Application.GetRealWidth(700),
-                Height = Application.GetRealHeight(700),
-                Radius = (uint)Application.GetRealHeight(30),
-            };
-            forgetWPDDialog.AddChidren(forgetSelectedView);
-
-            var forgetByPhone = new Button()
-            {
-                Y = Application.GetRealHeight(100),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(100),
-                TextID = R.MyInternationalizationString.FindPWDByPhone,
-                TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
-                TextAlignment = TextAlignment.Center,
-                BackgroundColor = ZigbeeColor.Current.GXCButtonBlueColor,
-                Radius = (uint)Application.GetRealHeight(50),
-                Gravity = Gravity.CenterHorizontal
-            };
-            forgetSelectedView.AddChidren(forgetByPhone);
-
-            var forgetByEmail = new Button()
-            {
-                Y = Application.GetRealHeight(100) + forgetByPhone.Bottom,
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(100),
-                TextID = R.MyInternationalizationString.FindPWDByEmail,
-                TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
-                TextAlignment = TextAlignment.Center,
-                BackgroundColor = ZigbeeColor.Current.GXCButtonBlueColor,
-                Radius = (uint)Application.GetRealHeight(50),
-                Gravity = Gravity.CenterHorizontal
-            };
-            forgetSelectedView.AddChidren(forgetByEmail);
-
-            var cancleBtn = new Button()
-            {
-                Y = Application.GetRealHeight(100) + forgetByEmail.Bottom,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(100),
-                TextID = R.MyInternationalizationString.Cancel,
-                TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
-                TextAlignment = TextAlignment.Center,
-                BackgroundColor = ZigbeeColor.Current.GXCButtonBlueColor,
-                Radius = (uint)Application.GetRealHeight(50),
-                Gravity = Gravity.CenterHorizontal
-            };
-            forgetSelectedView.AddChidren(cancleBtn);
-
-            forgetByPhone.MouseUpEventHandler += (sender1, e1) =>
-            {
-                forgetWPDDialog.Close();
-                this.RemoveFromParent();
-                var forgot = new Account.ForgotPasswordByPhone();
-                CommonPage.Instance.AddChidren(forgot);
-                forgot.Show();
-            };
-            forgetByEmail.MouseUpEventHandler += (sender1, e1) =>
-            {
-                forgetWPDDialog.Close();
-                this.RemoveFromParent();
-                var forgot = new Account.ForgotPasswordByEmail();
-                CommonPage.Instance.AddChidren(forgot);
-                forgot.Show();
-            };
-            cancleBtn.MouseUpEventHandler += (sender1, e1) =>
-            {
-                forgetWPDDialog.Close();
-            };
+            var forgot = new AccountForgetPWD();
+            CommonPage.Instance.AddChidren(forgot);
+            forgot.Show();
         }
 
         #endregion
@@ -547,8 +524,7 @@
         /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
         private void Register(object sender,MouseEventArgs mouseEventArgs)
         {
-            this.RemoveFromParent();
-            var registerPage = new RegistrationPhoneOREmail();
+            var registerPage = new AccountRegister();
             Shared.Common.CommonPage.Instance.AddChidren(registerPage);
             registerPage.Show();
         }
@@ -574,18 +550,18 @@
         private void Pwd_TextChange(object sender,string mouseEventArgs)
         {
             loginErrorBtn.Text = "";
-            if (1 <= passwrodET.Text.Trim().Length && passwrodET.Text.Trim().Length <= 16 && accountET.Text.Trim().Length > 0)
+            if (1 <= pwdRow.PasswrodET.Text.Trim().Length && pwdRow.PasswrodET.Text.Trim().Length <= 16 && phoneRow.AccountET.Text.Trim().Length > 0)
             {
                 loginBtn.Enable = loginBtn.IsSelected = true;
             }
-            else if (passwrodET.Text.Trim().Length > 16)
+            else if (pwdRow.PasswrodET.Text.Trim().Length > 16)
             {
-                passwrodET.Text = mouseEventArgs.Remove(16);
+                pwdRow.PasswrodET.Text = mouseEventArgs.Remove(16);
             }
-            else if (passwrodET.Text.Trim().Length > 16 && accountET.Text.Trim().Length > 0)
+            else if (pwdRow.PasswrodET.Text.Trim().Length > 16 && phoneRow.AccountET.Text.Trim().Length > 0)
             {
                 loginBtn.Enable = loginBtn.IsSelected = true;
-                passwrodET.Text = mouseEventArgs.Remove(16);
+                pwdRow.PasswrodET.Text = mouseEventArgs.Remove(16);
             }
             else
             {
@@ -594,17 +570,7 @@
         }
 
 
-
         #endregion
 
-        #region 鈼� 瀵嗙爜闅愯棌__________________________
-
-        private void HidePWD(object sender, MouseEventArgs mouseEventArgs)
-        {
-            passwrodET.SecureTextEntry = !passwrodET.SecureTextEntry;
-            hidenPWDbtn.IsSelected = !hidenPWDbtn.IsSelected;
-        }
-
-        #endregion
     }
 }

--
Gitblit v1.8.0