From 84e76cf2fcbe26142750131d3c27eaac0335e40a Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 11 三月 2021 11:04:08 +0800
Subject: [PATCH] 上传一个添加红外宝 Ios 版本
---
HDL_ON/UI/UI1-Login/LoginPage.cs | 306 ++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 267 insertions(+), 39 deletions(-)
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index e24e26d..327f2ee 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;
@@ -13,6 +14,10 @@
//bodyView = new FrameLayout();
//AddChidren(bodyView);
bodyView = this;
+ //2020-12-22 澧炲姞鐐瑰嚮闅愯棌閿洏浜嬩欢
+ bodyView.MouseDownEventHandler += (sender, e) => {
+ Application.HideSoftInput();
+ };
pm = new HttpServerRequest();
}
@@ -24,10 +29,11 @@
waitPage.RemoveFromParent();
waitPage = null;
}
- else
- {
- base.RemoveFromParent();
- }
+
+ base.RemoveFromParent();
+
+ ////2020-12-22 澧炲姞鐐瑰嚮闅愯棌閿洏浜嬩欢
+ //Application.HideSoftInput();
}
#region 灞�閮ㄥ彉閲�
@@ -36,15 +42,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,10 +148,22 @@
HttpServerRequest pm;
#endregion
+ string verAccount = "";
+
+ /// <summary>
+ ///
+ /// </summary>
+ string registerPhone;
+ string registerEmail;
+ /// <summary>
+ /// 鎵嬫満鍖哄彿
+ /// </summary>
+ string phoneZoneCode = "86";
+
/// <summary>
/// 鍔犺浇瑙嗗浘
/// </summary>
- public void LoadView()
+ public void LoadView(UserInfo userInfo = null)
{
var btnIcon = new Button()
{
@@ -157,7 +175,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),
@@ -166,25 +185,35 @@
};
bodyView.AddChidren(btnIcon_bg);
+#if DEBUG
+ bool b = false;
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";
- etPassword.Text = "qqqqqq";
-#endif
+ //return;
+ if (b)
+ {
+ etAccount.Text = "15622703419";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654";
+ // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568
+ }
+ else
+ {
+ etAccount.Text = "18316672920";//鍑夐湼"18666455392";//13375012446//13602944661//tzy 18778381374
+ //15971583093 gs
+ }
+ b = !b;
+ etPassword.Text = "123456";
+ btnLogin.IsSelected = true;
};
+ #endif
#region 鐧诲綍鏂瑰紡閫夋嫨
btnPhoneLogin = new Button()
{
X = Application.GetRealWidth(28),
Y = Application.GetRealHeight(177),
- Width = Application.GetRealWidth(120),
+ Width = Application.GetRealWidth(150),
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 +222,11 @@
btnEmailLogin = new Button()
{
- X = btnPhoneLogin.Right,
+ X = btnPhoneLogin.Right ,//+ Application.GetRealWidth(20),
Y = Application.GetRealHeight(177),
- Width = Application.GetRealWidth(100),
+ Width = Application.GetRealWidth(140),
Height = Application.GetRealHeight(40),
- TextID = R.InternationalizationString.LoginByEmail,
+ TextID = StringId.LoginByEmail,
TextColor = CSS_Color.PromptingColor1,
TextAlignment = TextAlignment.Center,
TextSize = CSS_FontSize.TextFontSize,
@@ -220,11 +249,29 @@
Width = Application.GetRealWidth(65),
TextAlignment = TextAlignment.Center,
TextColor = CSS_Color.FirstLevelTitleColor,
- Text = "+86",
+ Text = "+" + phoneZoneCode,
TextSize = CSS_FontSize.TextFontSize,
+ Enable = true,
};
- if (logintType == 0)
+
+ //璺宠浆鍥藉鍖哄彿閫夋嫨鐣岄潰
+ EventHandler<MouseEventArgs> eHandler = (sender, e) =>
+ {
+ JLCountrycode.CountryCodeView.Current.Show((countryName, code) =>
+ {
+ if (!string.IsNullOrEmpty(code))
+ {
+ phoneZoneCode = code;
+ btnGlobalRoaming.Text = "+" + phoneZoneCode;
+ }
+ });
+ };
+ btnGlobalRoaming.MouseUpEventHandler += eHandler;
+
+ if (loginType == 0)
+ {
accountView.AddChidren(btnGlobalRoaming);
+ }
btnDividingLineVertical_AccountView = new Button()
{
@@ -240,14 +287,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 +309,6 @@
};
accountView.AddChidren(btnAccountViewBottomLine);
-
btnAccountIcon = new Button()
{
X = Application.GetRealWidth(21),
@@ -266,7 +317,7 @@
Height = Application.GetMinRealAverage(20),
UnSelectedImagePath = "LoginIcon/AccountIcon.png",
};
- if (logintType == 1)
+ if (loginType == 1)
{
accountView.AddChidren(btnAccountIcon);
}
@@ -308,12 +359,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 +396,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 +407,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 +429,6 @@
#endregion
-
#region 娉ㄥ唽涓庡揩鎹风櫥褰�
btnRegister = new Button()
{
@@ -384,7 +438,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 +451,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);
@@ -409,19 +463,193 @@
Gravity = Gravity.CenterHorizontal,
Y = Application.GetRealHeight(403),
Width = Application.GetRealWidth(220),
- Height = Application.GetRealHeight(44),
- Radius = (uint)Application.GetRealHeight(22),
+ Height = Application.GetRealWidth(44),
+ Radius = (uint)Application.GetRealWidth(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();
- LoadEventList();
+ #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;
+ UserInfo.Current = new UserInfo();
+ MainPage.GoUserPage();
+ };
+
+ MainPage.Log("etAccount.TextAlignment : " + etAccount.TextAlignment.ToString());
+
+ #endif
+
+ #region 闅愮鏀跨瓥
+ AddServiceAgreementControl(bodyView);
+ #endregion
+
}
+
+ #region 鈻� 鏈嶅姟鍗忚___________________________
+ bool isAgreePrivacyPolicy = false;
+ /// <summary>
+ /// 娣诲姞鏈嶅姟鍗忚鎺т欢
+ /// </summary>
+ /// <param name="frameBack"></param>
+ private void AddServiceAgreementControl(FrameLayout frameLayout)
+ {
+ isAgreePrivacyPolicy = OnAppConfig.Instance.isAgreePrivacyPolicy;
+ var frameRow = new FrameLayout()
+ {
+ Height = Application.GetRealHeight(28),
+ Y = Application.GetRealHeight(628),
+ };
+ frameLayout.AddChidren(frameRow);
+
+ //鍚屾剰鎸夐挳鑳屾櫙
+ var agreeView = new FrameLayout()
+ {
+ Height = Application.GetRealHeight(28),
+ Width = Application.GetRealWidth(28),
+ X = Application.GetRealWidth(22),
+ };
+ frameRow.AddChidren(agreeView);
+ if(Language.CurrentLanguage == "Chinese")
+ {
+ agreeView.X = Application.GetRealWidth(82);
+ }
+ //鍚屾剰鍥炬爣鎸夐挳
+ var agreeBtn = new Button()
+ {
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "Public/ChooseIcon.png",
+ SelectedImagePath = "Public/ChooseOnIcon.png",
+ IsSelected = isAgreePrivacyPolicy,
+ Gravity = Gravity.Center
+ };
+ agreeView.AddChidren(agreeBtn);
+
+ EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+ {
+ isAgreePrivacyPolicy = !isAgreePrivacyPolicy;
+ agreeBtn.IsSelected = isAgreePrivacyPolicy;
+ OnAppConfig.Instance.isAgreePrivacyPolicy = isAgreePrivacyPolicy;
+ OnAppConfig.Instance.SaveConfig();
+ };
+
+ agreeBtn.MouseUpEventHandler = eventHandler;
+ agreeView.MouseUpEventHandler = eventHandler;
+
+ //int btnWidth = 0;
+ //鍚屾剰鏂囨湰
+ var agreeTextBtn = new TextButton()
+ {
+ X = agreeView.Right,
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealHeight(28),
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ TextID = StringId.Agree
+ };
+ frameRow.AddChidren(agreeTextBtn);
+ agreeTextBtn.Width = Utlis.GetRealWidthByTextButton(agreeTextBtn);
+
+ //鐢ㄦ埛鍗忚鎸夐挳
+ var userAgreementBtn = new TextButton()
+ {
+ X = agreeTextBtn.Right,
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealHeight(28),
+ TextColor = CSS_Color.MainColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ Text = "銆�" + Language.StringByID(StringId.UserAgreement) + "銆�"
+ };
+ frameRow.AddChidren(userAgreementBtn);
+ userAgreementBtn.Width = Utlis.GetRealWidthByTextButton(userAgreementBtn);
+
+ //鍜屾枃鏈�
+ var andTextBtn = new TextButton()
+ {
+ X = userAgreementBtn.Right,
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealHeight(28),
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ TextID = StringId.And
+ };
+ frameRow.AddChidren(andTextBtn);
+ andTextBtn.Width = Utlis.GetRealWidthByTextButton(andTextBtn);
+
+ //闅愮鏀跨瓥鎸夐挳
+ var privacyPolicyBtn = new TextButton()
+ {
+ X = andTextBtn.Right,
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealHeight(28),
+ TextColor = CSS_Color.MainColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ Text = "銆�" + Language.StringByID(StringId.PrivacyPolicy) + "銆�"
+ };
+ frameRow.AddChidren(privacyPolicyBtn);
+ privacyPolicyBtn.Width = Utlis.GetRealWidthByTextButton(privacyPolicyBtn);
+
+ //鎵撳紑鐢ㄦ埛鍗忚
+ userAgreementBtn.MouseUpEventHandler = (sender, e) =>
+ {
+ OpenWebViewPage(false);
+ };
+
+ //鎵撳紑闅愮鏀跨瓥
+ privacyPolicyBtn.MouseUpEventHandler = (sender, e) =>
+ {
+ OpenWebViewPage(true);
+ };
+ }
+
+ /// <summary>
+ /// OpenWebViewPage
+ /// </summary>
+ /// <param name="isOpenPrivacyPolicy">鏄惁闅愮鏀跨瓥</param>
+ private void OpenWebViewPage(bool isOpenPrivacyPolicy)
+ {
+ string url = isOpenPrivacyPolicy ? Constant.URL_PRIVACYPOLICY : Constant.URL_USERAGREEMENT;
+ string titleStr = isOpenPrivacyPolicy ? Language.StringByID(StringId.PrivacyPolicy) : Language.StringByID(StringId.UserAgreement);
+ new WebViewDialog().LoadPage(titleStr, url);
+ }
+
+ /// <summary>
+ /// 妫�娴嬮殣绉佸崗璁�
+ /// </summary>
+ /// <returns></returns>
+ private bool CheckPrivacyPolicy()
+ {
+ if (isAgreePrivacyPolicy == false)
+ {
+ //璇峰悓鎰忋�婄敤鎴峰崗璁�嬪拰銆婇殣绉佹斂绛栥��
+ Utlis.ShowTip(Language.StringByID(StringId.PleaseReadAndAgreePrivacyPolicyMsg));
+ return false;
+ }
+ return true;
+ }
+
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.8.0