From 017af840d60fd6a56da9711308bf8239cb7fc1e6 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 13 十一月 2020 11:01:01 +0800 Subject: [PATCH] 2020-11-13 1.部分接口替换备份 --- HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs | 55 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 48 insertions(+), 7 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..ee082c7 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs @@ -2,6 +2,7 @@ using Shared; using HDL_ON.UI.CSS; using System.Text.RegularExpressions; +using HDL_ON.DAL.Server; namespace HDL_ON.UI { @@ -42,7 +43,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, TextAlignment = TextAlignment.CenterLeft, - TextID = titleId == StringId.BindEmail ? StringId.EntryBindEmail : StringId.BindPhone, + TextID = titleId == StringId.BindEmail ? StringId.EntryNewEmail : StringId.EntryNewPhone, }; rowView.AddChidren(btnTitle); @@ -86,15 +87,27 @@ void LoadEvent_BindEmail() { btnBind.MouseUpEventHandler = (sender, e) => { + Application.HideSoftInput(); var account = etContent.Text.Trim(); if (titleId == StringId.BindEmail) { + if (account == MainPage.LoginUser.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 = 3, + CloseTime = 1, Direction = AMPopTipDirection.None }; tip.Show(bodyView); @@ -103,12 +116,23 @@ } else if (titleId == StringId.BindPhone) { + if(account == MainPage.LoginUser.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 = 3, + CloseTime = 1, Direction = AMPopTipDirection.None }; tip.Show(bodyView); @@ -117,8 +141,8 @@ } new System.Threading.Thread(() => { - var result = new DAL.Server.HttpServerRequest().BindAccount(account); - if (result.ToUpper() == "SUCCESS") + var result = new HttpServerRequest().BindAccount(account); + if (result.ToUpper() == HttpUtil.SUCCESS_CODE) { Application.RunOnMainThread(() => { @@ -143,18 +167,35 @@ for (int i = 0; i < 3; i++) { - MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1); + MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); } action(account); }); } else { + var tipMsg = ""; + Application.RunOnMainThread(() => { var page = new OperationResultDisPalyPage(); page.Show(); - page.LoadPage(false, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailFail), ""); + 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, ""); + } }); } }) -- Gitblit v1.8.0