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 | 97 +++++++++++++++++++++++++++++++++++------------- 1 files changed, 70 insertions(+), 27 deletions(-) diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index e24e26d..fbd3b48 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -1,4 +1,5 @@ 锘縰sing System; +using System.Text.RegularExpressions; using System.Threading; using HDL_ON.DAL.Server; using HDL_ON.UI.CSS; @@ -36,15 +37,15 @@ /// 0:鎵嬫満 /// 1:閭 /// </summary> - int logintType = 0; + int loginType = 0; /// <summary> /// 鐧诲綍鏂瑰紡 /// 0:瀵嗙爜 /// 1:楠岃瘉鐮� /// </summary> int logintMode = 0; - string account; - string password; + string account = ""; + string password = ""; #endregion #region 鎺т欢鍒楄〃 @@ -142,11 +143,21 @@ HttpServerRequest pm; #endregion + string verAccount = ""; + + /// <summary> + /// + /// </summary> + string registerPhone; + string registerEmail; + /// <summary> /// 鍔犺浇瑙嗗浘 /// </summary> - public void LoadView() + public void LoadView(UserInfo userInfo = null) { + Language.CurrentLanguage = "Chinese"; + var btnIcon = new Button() { X = Application.GetRealWidth(28), @@ -157,7 +168,8 @@ }; bodyView.AddChidren(btnIcon); - var btnIcon_bg = new Button() { + var btnIcon_bg = new Button() + { X = Application.GetRealWidth(171), Y = Application.GetRealHeight(69), Width = Application.GetMinRealAverage(254), @@ -169,11 +181,9 @@ btnIcon.MouseUpEventHandler += (sender, e) => { #if DEBUG - UserConfig.Instance.SkinCode = UserConfig.Instance.SkinCode > 1 ? 0 : 1; - SharedMethod.SharedMethod.ChangeSkin(); - MainPage.Log($"UserConfig.skincode{UserConfig.Instance.SkinCode}"); - etAccount.Text = "464027401@qq.com"; + etAccount.Text = "464027401@qq.com"; //"2791308028@qq.com";// etPassword.Text = "qqqqqq"; + btnLogin.IsSelected = true; #endif }; @@ -184,7 +194,7 @@ Y = Application.GetRealHeight(177), Width = Application.GetRealWidth(120), Height = Application.GetRealHeight(40), - TextID = R.InternationalizationString.LoginByPhone, + TextID = StringId.LoginByPhone, TextColor = CSS_Color.MainColor, TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.EmphasisFontSize_Secondary, @@ -193,11 +203,11 @@ btnEmailLogin = new Button() { - X = btnPhoneLogin.Right, + X = btnPhoneLogin.Right + Application.GetRealWidth(20), Y = Application.GetRealHeight(177), Width = Application.GetRealWidth(100), Height = Application.GetRealHeight(40), - TextID = R.InternationalizationString.LoginByEmail, + TextID = StringId.LoginByEmail, TextColor = CSS_Color.PromptingColor1, TextAlignment = TextAlignment.Center, TextSize = CSS_FontSize.TextFontSize, @@ -222,8 +232,9 @@ TextColor = CSS_Color.FirstLevelTitleColor, Text = "+86", TextSize = CSS_FontSize.TextFontSize, + Enable = false, }; - if (logintType == 0) + if (loginType == 0) accountView.AddChidren(btnGlobalRoaming); btnDividingLineVertical_AccountView = new Button() @@ -240,14 +251,19 @@ { X = Application.GetRealWidth(78), Width = Application.GetRealWidth(319 - 78), - TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, PlaceholderTextColor = CSS_Color.PromptingColor1, - PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryAccount), + 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() { @@ -257,7 +273,6 @@ }; accountView.AddChidren(btnAccountViewBottomLine); - btnAccountIcon = new Button() { X = Application.GetRealWidth(21), @@ -266,7 +281,7 @@ Height = Application.GetMinRealAverage(20), UnSelectedImagePath = "LoginIcon/AccountIcon.png", }; - if (logintType == 1) + if (loginType == 1) { accountView.AddChidren(btnAccountIcon); } @@ -308,12 +323,12 @@ { X = Application.GetRealWidth(78), Width = Application.GetRealWidth(61 + 84), - TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, PlaceholderTextColor = CSS_Color.PromptingColor1, - PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryPassword), + PlaceholderText = Language.StringByID(StringId.PlsEntryPassword), SecureTextEntry = true, + TextAlignment = TextAlignment.CenterLeft, }; passwordView.AddChidren(etPassword); @@ -345,7 +360,7 @@ Width = Application.GetRealWidth(56), TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.CenterLeft, - TextID = R.InternationalizationString.ForgetPassword, + TextID = StringId.ForgetPassword, TextSize = 12, }; passwordView.AddChidren(btnForgetPassword); @@ -356,11 +371,15 @@ { X = Application.GetRealWidth(219), Width = Application.GetRealWidth(100), - TextID = R.InternationalizationString.GetVerificationCode, - TextColor = CSS_Color.MainColor, + 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() @@ -374,7 +393,6 @@ #endregion - #region 娉ㄥ唽涓庡揩鎹风櫥褰� btnRegister = new Button() { @@ -384,7 +402,7 @@ Height = Application.GetRealHeight(17 + 12 + 12), TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextID = R.InternationalizationString.SingUp, + TextID = StringId.SingUp, TextAlignment = TextAlignment.CenterLeft, }; bodyView.AddChidren(btnRegister); @@ -397,7 +415,7 @@ Height = Application.GetRealHeight(51), TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextID = R.InternationalizationString.VerificationCodeLogin, + TextID = StringId.VerificationCodeLogin, TextAlignment = TextAlignment.CenterRight, }; bodyView.AddChidren(btnSwitchLoginMode); @@ -413,15 +431,40 @@ Radius = (uint)Application.GetRealHeight(22), SelectedBackgroundColor = CSS_Color.MainColor, BackgroundColor = CSS_Color.PromptingColor1, - TextID = R.InternationalizationString.Login, + 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