From e6a26ee148587327478d9a82624a820c907b6e16 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 04 十一月 2020 14:58:15 +0800 Subject: [PATCH] 20201104 --- HDL_ON/UI/UI1-Login/LoginPage.cs | 470 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 470 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs new file mode 100644 index 0000000..fbd3b48 --- /dev/null +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -0,0 +1,470 @@ +锘縰sing System; +using System.Text.RegularExpressions; +using System.Threading; +using HDL_ON.DAL.Server; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public partial class LoginPage : FrameLayout + { + public LoginPage() + { + //bodyView = new FrameLayout(); + //AddChidren(bodyView); + bodyView = this; + pm = new HttpServerRequest(); + } + + public override void RemoveFromParent() + { + //濡傛灉褰撳墠鐣岄潰瀛樺湪姝e湪绛夊緟鏁版嵁鐨勬儏鍐碉紝鍏堝皢璇ュ姩浣滃叧鎺� + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + else + { + base.RemoveFromParent(); + } + } + + #region 灞�閮ㄥ彉閲� + /// <summary> + /// 鐧诲綍绫诲瀷 + /// 0:鎵嬫満 + /// 1:閭 + /// </summary> + int loginType = 0; + /// <summary> + /// 鐧诲綍鏂瑰紡 + /// 0:瀵嗙爜 + /// 1:楠岃瘉鐮� + /// </summary> + int logintMode = 0; + string account = ""; + string password = ""; + #endregion + + #region 鎺т欢鍒楄〃 + /// <summary> + /// 绛夊緟鎻愮ず + /// </summary> + Loading waitPage; + /// <summary> + /// 褰撳墠鐣岄潰 + /// </summary> + FrameLayout bodyView; + /// <summary> + /// 閫夋嫨鎵嬫満鐧诲綍鎸夐挳 + /// </summary> + Button btnPhoneLogin; + /// <summary> + /// 閫夋嫨閭鐧诲綍鎸夐挳 + /// </summary> + Button btnEmailLogin; + /// <summary> + /// 璐﹀彿瀛愬尯鍩� + /// </summary> + FrameLayout accountView; + /// <summary> + /// 鍥介檯鍖哄彿鎸夐挳 + /// </summary> + Button btnGlobalRoaming; + /// <summary> + /// 璐﹀彿瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾� + /// </summary> + Button btnDividingLineVertical_AccountView; + /// <summary> + /// 璐﹀彿鏂囨湰妗� + /// </summary> + EditText etAccount; + /// <summary> + /// 璐﹀彿Icon鎸夐挳 + /// </summary> + Button btnAccountIcon; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩� + /// </summary> + FrameLayout passwordView; + /// <summary> + /// 瀵嗙爜Icon鎸夐挳 + /// </summary> + Button btnPasswordIcon; + /// <summary> + /// 瀵嗙爜鏂囨湰妗� + /// </summary> + EditText etPassword; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾�1 + /// </summary> + Button btnDividingLineVertical_PasswordView1; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾�2 + /// </summary> + Button btnDividingLineVertical_PasswordView2; + /// <summary> + /// 蹇樿瀵嗙爜鎸夐挳 + /// </summary> + Button btnForgetPassword; + /// <summary> + /// 鑾峰彇鎵嬫満楠岃瘉鐮佹寜閽� + /// </summary> + Button btnGetVerificationCode; + /// <summary> + /// 瀵嗙爜鏄惁鍙鎸夐挳 + /// </summary> + Button btnVisiblePassword; + /// <summary> + /// 璐﹀彿瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnAccountViewBottomLine; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnPasswordViewBottomLine; + /// <summary> + /// 娉ㄥ唽鎸夐挳 + /// </summary> + Button btnRegister; + /// <summary> + /// 楠岃瘉鐮佺櫥褰曟寜閽� + /// </summary> + Button btnSwitchLoginMode; + /// <summary> + /// 鐧诲綍鎸夐挳 + /// </summary> + Button btnLogin; + /// <summary> + /// 鏈嶅姟鍣ㄨ姹傚璞� + /// </summary> + HttpServerRequest pm; + #endregion + + string verAccount = ""; + + /// <summary> + /// + /// </summary> + string registerPhone; + string registerEmail; + + /// <summary> + /// 鍔犺浇瑙嗗浘 + /// </summary> + public void LoadView(UserInfo userInfo = null) + { + Language.CurrentLanguage = "Chinese"; + + var btnIcon = new Button() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(73), + Width = Application.GetMinRealAverage(62), + Height = Application.GetMinRealAverage(62), + UnSelectedImagePath = "Public/Logo.png", + }; + bodyView.AddChidren(btnIcon); + + var btnIcon_bg = new Button() + { + X = Application.GetRealWidth(171), + Y = Application.GetRealHeight(69), + Width = Application.GetMinRealAverage(254), + Height = Application.GetMinRealAverage(156), + UnSelectedImagePath = "Public/Logo-bg.png" + }; + bodyView.AddChidren(btnIcon_bg); + + btnIcon.MouseUpEventHandler += (sender, e) => + { +#if DEBUG + etAccount.Text = "464027401@qq.com"; //"2791308028@qq.com";// + etPassword.Text = "qqqqqq"; + btnLogin.IsSelected = true; +#endif + }; + + #region 鐧诲綍鏂瑰紡閫夋嫨 + btnPhoneLogin = new Button() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(177), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(40), + TextID = StringId.LoginByPhone, + TextColor = CSS_Color.MainColor, + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + bodyView.AddChidren(btnPhoneLogin); + + btnEmailLogin = new Button() + { + X = btnPhoneLogin.Right + Application.GetRealWidth(20), + Y = Application.GetRealHeight(177), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(40), + TextID = StringId.LoginByEmail, + TextColor = CSS_Color.PromptingColor1, + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + }; + bodyView.AddChidren(btnEmailLogin); + #endregion + + #region 璐﹀彿濉啓 + accountView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(232), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(accountView); + + btnGlobalRoaming = new Button() + { + Width = Application.GetRealWidth(65), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.FirstLevelTitleColor, + Text = "+86", + TextSize = CSS_FontSize.TextFontSize, + Enable = false, + }; + if (loginType == 0) + accountView.AddChidren(btnGlobalRoaming); + + btnDividingLineVertical_AccountView = new Button() + { + X = Application.GetRealWidth(65), + Gravity = Gravity.CenterVertical, + Width = 1, + Height = Application.GetRealHeight(20), + BackgroundColor = CSS_Color.DividingLineColor, + }; + accountView.AddChidren(btnDividingLineVertical_AccountView); + + etAccount = new EditText() + { + X = Application.GetRealWidth(78), + Width = Application.GetRealWidth(319 - 78), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber), + TextAlignment = TextAlignment.CenterLeft, + }; + accountView.AddChidren(etAccount); + + if (userInfo != null) + { + registerEmail = userInfo.userEmailInfo; + etAccount.Text = registerPhone = userInfo.userMobileInfo; + } + + btnAccountViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + Height = Application.GetRealHeight(1), + }; + accountView.AddChidren(btnAccountViewBottomLine); + + btnAccountIcon = new Button() + { + X = Application.GetRealWidth(21), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/AccountIcon.png", + }; + if (loginType == 1) + { + accountView.AddChidren(btnAccountIcon); + } + + #endregion + + #region 瀵嗙爜濉啓 + passwordView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(288), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(passwordView); + + + btnPasswordIcon = new Button() + { + X = Application.GetRealWidth(21), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/PasswordIcon.png", + SelectedImagePath = "LoginIcon/VerificationCodeIcon.png", + }; + passwordView.AddChidren(btnPasswordIcon); + btnDividingLineVertical_PasswordView1 = new Button() + { + X = Application.GetRealWidth(65), + Gravity = Gravity.CenterVertical, + Width = 1, + Height = Application.GetRealHeight(20), + BackgroundColor = CSS_Color.DividingLineColor, + }; + passwordView.AddChidren(btnDividingLineVertical_PasswordView1); + + etPassword = new EditText() + { + X = Application.GetRealWidth(78), + Width = Application.GetRealWidth(61 + 84), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(StringId.PlsEntryPassword), + SecureTextEntry = true, + TextAlignment = TextAlignment.CenterLeft, + }; + passwordView.AddChidren(etPassword); + + #region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇 + btnVisiblePassword = new Button() + { + X = Application.GetRealWidth(223), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", + SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", + }; + passwordView.AddChidren(btnVisiblePassword); + + btnDividingLineVertical_PasswordView2 = new Button() + { + X = Application.GetRealWidth(253), + Gravity = Gravity.CenterVertical, + Width = 1, + Height = Application.GetRealHeight(20), + BackgroundColor = CSS_Color.DividingLineColor, + }; + passwordView.AddChidren(btnDividingLineVertical_PasswordView2); + + btnForgetPassword = new Button() + { + X = Application.GetRealWidth(263), + Width = Application.GetRealWidth(56), + TextColor = CSS_Color.FirstLevelTitleColor, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.ForgetPassword, + TextSize = 12, + }; + passwordView.AddChidren(btnForgetPassword); + #endregion + + #region 楠岃瘉鐮佺櫥褰�-鎺т欢鍔犺浇 + btnGetVerificationCode = new Button() + { + X = Application.GetRealWidth(219), + Width = Application.GetRealWidth(100), + TextID = StringId.GetVerificationCode, + SelectedTextColor = CSS_Color.MainColor, + TextAlignment = TextAlignment.CenterRight, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextColor = CSS_Color.PromptingColor1, + Visible = false, + IsSelected = false, + }; + passwordView.AddChidren(btnGetVerificationCode); + #endregion + + btnPasswordViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + SelectedBackgroundColor = CSS_Color.MainColor, + Height = Application.GetRealHeight(1), + }; + passwordView.AddChidren(btnPasswordViewBottomLine); + + #endregion + + #region 娉ㄥ唽涓庡揩鎹风櫥褰� + btnRegister = new Button() + { + X = Application.GetRealWidth(28), + Y = passwordView.Bottom, + Width = Application.GetRealWidth(60), + Height = Application.GetRealHeight(17 + 12 + 12), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = StringId.SingUp, + TextAlignment = TextAlignment.CenterLeft, + }; + bodyView.AddChidren(btnRegister); + + btnSwitchLoginMode = new Button() + { + X = Application.GetRealWidth(223 + 28), + Y = passwordView.Bottom, + Width = Application.GetRealWidth(96), + Height = Application.GetRealHeight(51), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = StringId.VerificationCodeLogin, + TextAlignment = TextAlignment.CenterRight, + }; + bodyView.AddChidren(btnSwitchLoginMode); + + #endregion + + btnLogin = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(403), + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Radius = (uint)Application.GetRealHeight(22), + SelectedBackgroundColor = CSS_Color.MainColor, + BackgroundColor = CSS_Color.PromptingColor1, + TextID = StringId.Login, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.MainBackgroundColor, + TextAlignment = TextAlignment.Center, + }; + bodyView.AddChidren(btnLogin); + + LoadEventList(); + account = etAccount.Text.Trim(); + + #if DEBUG1211 + //鏈湴妯″紡 + Button btnLocalMode = new Button() + { + Y = Application.GetRealHeight(600), + Height = Application.GetRealHeight(67), + Text = "Local Mode", + TextAlignment = TextAlignment.Center, + BackgroundColor = CSS_Color.MainColor, + TextColor = CSS_Color.TextualColor, + }; + bodyView.AddChidren(btnLocalMode); + + btnLocalMode.MouseUpEventHandler = (sender, e) => + { + MainPage.LocalMode = true; + MainPage.LoginUser = new UserInfo(); + MainPage.GoUserPage(); + }; + + MainPage.Log("etAccount.TextAlignment : " + etAccount.TextAlignment.ToString()); + + #endif + + } + } +} \ No newline at end of file -- Gitblit v1.8.0