From 9d65c293924e4edbbc8c6c6091f55d7fc49c23eb Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 06 七月 2021 13:15:46 +0800
Subject: [PATCH] 乐橙子账号token
---
HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs | 349 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 195 insertions(+), 154 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs
index 44f8ab4..4129820 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs
@@ -1,165 +1,206 @@
-锘縰sing System;
-using Shared;
-using HDL_ON.UI.CSS;
-using System.Text.RegularExpressions;
+锘�//using System;
+//using Shared;
+//using HDL_ON.UI.CSS;
+//using System.Text.RegularExpressions;
+//using HDL_ON.DAL.Server;
-namespace HDL_ON.UI
-{
- public partial class BindAccountPage : FrameLayout
- {
- FrameLayout bodyView;
- Button btnBind;
- EditText etContent;
- Action<string> action;
- /// <summary>
- /// 鏍囬ID
- /// </summary>
- int titleId;
- public BindAccountPage()
- {
- bodyView = this;
- }
+//namespace HDL_ON.UI
+//{
+// public partial class BindAccountPage : FrameLayout
+// {
+// FrameLayout bodyView;
+// Button btnBind;
+// EditText etContent;
+// Action<string> action;
+// /// <summary>
+// /// 鏍囬ID
+// /// </summary>
+// int titleId;
+// public BindAccountPage()
+// {
+// bodyView = this;
+// }
- public void LoadPage(Action<string> act,int tId)
- {
- action = act;
- titleId = tId;
- bodyView.BackgroundColor = CSS_Color.BackgroundColor;
- new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView();
+// public void LoadPage(Action<string> act,int tId)
+// {
+// action = act;
+// titleId = tId;
+// bodyView.BackgroundColor = CSS_Color.BackgroundColor;
+// new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView();
- FrameLayout rowView = new FrameLayout()
- {
- Y = Application.GetRealHeight(72),
- Height = Application.GetRealHeight(50),
- BackgroundColor = CSS_Color.MainBackgroundColor,
- };
- bodyView.AddChidren(rowView);
+// FrameLayout rowView = new FrameLayout()
+// {
+// Y = Application.GetRealHeight(72),
+// Height = Application.GetRealHeight(50),
+// BackgroundColor = CSS_Color.MainBackgroundColor,
+// };
+// bodyView.AddChidren(rowView);
- Button btnTitle = new Button()
- {
- X = Application.GetRealWidth(16),
- Width = Application.GetRealWidth(180),
- TextColor = CSS_Color.FirstLevelTitleColor,
- TextSize = CSS_FontSize.SubheadingFontSize,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = titleId == StringId.BindEmail ? StringId.EntryBindEmail : StringId.BindPhone,
- };
- rowView.AddChidren(btnTitle);
+// Button btnTitle = new Button()
+// {
+// X = Application.GetRealWidth(16),
+// Width = Application.GetRealWidth(180),
+// TextColor = CSS_Color.FirstLevelTitleColor,
+// TextSize = CSS_FontSize.SubheadingFontSize,
+// TextAlignment = TextAlignment.CenterLeft,
+// TextID = titleId == StringId.BindEmail ? StringId.EntryNewEmail : StringId.EntryNewPhone,
+// };
+// rowView.AddChidren(btnTitle);
- etContent = new EditText()
- {
- Width = Application.GetRealWidth(359),
- TextColor = CSS_Color.PromptingColor1,
- TextSize = CSS_FontSize.TextFontSize,
- TextAlignment = TextAlignment.CenterRight,
- Foucs = true
- };
- rowView.AddChidren(etContent);
+// etContent = new EditText()
+// {
+// Width = Application.GetRealWidth(359),
+// TextColor = CSS_Color.PromptingColor1,
+// TextSize = CSS_FontSize.TextFontSize,
+// TextAlignment = TextAlignment.CenterRight,
+// Foucs = true
+// };
+// rowView.AddChidren(etContent);
- btnBind = new Button()
- {
- Y = Application.GetRealHeight(213),
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(220),
- Height = Application.GetRealHeight(44),
- BackgroundColor = CSS_Color.MainColor,
- TextAlignment = TextAlignment.Center,
- TextColor = CSS_Color.MainBackgroundColor,
- TextID = StringId.Confirm,
- TextSize = CSS_FontSize.SubheadingFontSize,
- IsBold = true,
- Radius = (uint)Application.GetRealWidth(22),
- BorderColor = 0x00000000,
- BorderWidth = 0,
- };
- bodyView.AddChidren(btnBind);
+// btnBind = new Button()
+// {
+// Y = Application.GetRealHeight(213),
+// Gravity = Gravity.CenterHorizontal,
+// Width = Application.GetRealWidth(220),
+// Height = Application.GetRealHeight(44),
+// BackgroundColor = CSS_Color.MainColor,
+// TextAlignment = TextAlignment.Center,
+// TextColor = CSS_Color.MainBackgroundColor,
+// TextID = StringId.Confirm,
+// TextSize = CSS_FontSize.SubheadingFontSize,
+// IsBold = true,
+// Radius = (uint)Application.GetRealWidth(22),
+// BorderColor = 0x00000000,
+// BorderWidth = 0,
+// };
+// bodyView.AddChidren(btnBind);
- LoadEvent_BindEmail();
+// LoadEvent_BindEmail();
- }
- }
+// }
+// }
- //--------------------------------------------
- public partial class BindAccountPage
- {
- void LoadEvent_BindEmail()
- {
- btnBind.MouseUpEventHandler = (sender, e) => {
- var account = etContent.Text.Trim();
- if (titleId == StringId.BindEmail)
- {
- if (!Regex.IsMatch(account, "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+"))
- {
- var tip = new Tip()
- {
- Text = Language.StringByID(StringId.PlsEntryCorrectEmailAddress),
- CloseTime = 3,
- Direction = AMPopTipDirection.None
- };
- tip.Show(bodyView);
- return;
- }
- }
- else if (titleId == StringId.BindPhone)
- {
- if (!Regex.IsMatch(account, @"^[1]+\d{10}") || (account.Length != 11))
- {
- var tip = new Tip()
- {
- Text = Language.StringByID(StringId.PlsEntryCorrectMobilNeumber),
- CloseTime = 3,
- Direction = AMPopTipDirection.None
- };
- tip.Show(bodyView);
- return;
- }
- }
- new System.Threading.Thread(() =>
- {
- var result = new DAL.Server.HttpServerRequest().BindAccount(account);
- if (result.ToUpper() == "SUCCESS")
- {
- Application.RunOnMainThread(() =>
- {
- if (titleId == StringId.BindEmail)
- {
- MainPage.LoginUser.userEmailInfo = account;
- }
- else if (titleId == StringId.BindPhone)
- {
- MainPage.LoginUser.userMobileInfo = account;
- }
- var page = new OperationResultDisPalyPage();
- page.Show();
- if (titleId == StringId.BindEmail)
- {
- page.LoadPage(true, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailSuccess), "");
- }
- else if (titleId == StringId.BindPhone)
- {
- page.LoadPage(true, Language.StringByID(StringId.BindPhone), Language.StringByID(StringId.BindPhoneSuccess), "");
- }
+// //--------------------------------------------
+// public partial class BindAccountPage
+// {
+// void LoadEvent_BindEmail()
+// {
+// btnBind.MouseUpEventHandler = (sender, e) => {
+// Application.HideSoftInput();
+// var account = etContent.Text.Trim();
+// if (titleId == StringId.BindEmail)
+// {
+// if (account == UserInfo.Current.userEmailInfo)
+// {
+// var tip = new Tip()
+// {
+// Text = Language.StringByID(StringId.EmailIsSameNoNeedModfiy),
+// CloseTime = 1,
+// Direction = AMPopTipDirection.None
+// };
+// tip.Show(bodyView);
+// return;
+// }
+// if (!Regex.IsMatch(account, "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+"))
+// {
+// var tip = new Tip()
+// {
+// Text = Language.StringByID(StringId.PlsEntryCorrectEmailAddress),
+// CloseTime = 1,
+// Direction = AMPopTipDirection.None
+// };
+// tip.Show(bodyView);
+// return;
+// }
+// }
+// else if (titleId == StringId.BindPhone)
+// {
+// if(account == UserInfo.Current.userMobileInfo)
+// {
+// var tip = new Tip()
+// {
+// Text = Language.StringByID(StringId.PhoneNumberIsSameNoNeedModfiy),
+// CloseTime = 1,
+// Direction = AMPopTipDirection.None
+// };
+// tip.Show(bodyView);
+// return;
+// }
+// if (!Regex.IsMatch(account, @"^[1]+\d{10}") || (account.Length != 11))
+// {
+// var tip = new Tip()
+// {
+// Text = Language.StringByID(StringId.PlsEntryCorrectMobilNeumber),
+// CloseTime = 1,
+// Direction = AMPopTipDirection.None
+// };
+// tip.Show(bodyView);
+// return;
+// }
+// }
+// new System.Threading.Thread(() =>
+// {
+// var result = new HttpServerRequest().BindAccount(account);
+// if (result.ToUpper() == StateCode.SUCCESS)
+// {
+// Application.RunOnMainThread(() =>
+// {
+// if (titleId == StringId.BindEmail)
+// {
+// UserInfo.Current.userEmailInfo = account;
+// }
+// else if (titleId == StringId.BindPhone)
+// {
+// UserInfo.Current.userMobileInfo = account;
+// }
+// var page = new OperationResultDisPalyPage();
+// page.Show();
+// if (titleId == StringId.BindEmail)
+// {
+// page.LoadPage(true, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailSuccess), "");
+// }
+// else if (titleId == StringId.BindPhone)
+// {
+// page.LoadPage(true, Language.StringByID(StringId.BindPhone), Language.StringByID(StringId.BindPhoneSuccess), "");
+// }
- for (int i = 0; i < 3; i++)
- {
- MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
- }
- action(account);
- });
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- var page = new OperationResultDisPalyPage();
- page.Show();
- page.LoadPage(false, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailFail), "");
- });
- }
- })
- { IsBackground = true }.Start();
- };
- }
- }
-}
+// for (int i = 0; i < 3; i++)
+// {
+// MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+// }
+// action(account);
+// });
+// }
+// else
+// {
+// var tipMsg = "";
+
+// Application.RunOnMainThread(() =>
+// {
+// var page = new OperationResultDisPalyPage();
+// page.Show();
+// if (titleId == StringId.BindEmail)
+// {
+// if (result == "Exist")
+// {
+// tipMsg = Language.StringByID(StringId.EmailAlreadyUse);
+// }
+// page.LoadPage(false, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailFail) + "," + tipMsg, "");
+// }
+// else
+// {
+// if (result == "Exist")
+// {
+// tipMsg = Language.StringByID(StringId.PhoneNumberAlreadyUse);
+// }
+// page.LoadPage(false, Language.StringByID(StringId.BindPhone), Language.StringByID(StringId.BindPhoneFail) + "," + tipMsg, "");
+// }
+// });
+// }
+// })
+// { IsBackground = true }.Start();
+// };
+// }
+// }
+//}
--
Gitblit v1.8.0