From dc840e2d67654781ebc9c7640e6c44a63a6d04d0 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 11 十二月 2020 09:44:37 +0800 Subject: [PATCH] 2020-12-11 1.注册、忘记密码、重置密码、点击返回到时候屏蔽检测错误提示。底部按钮使能效果优化修改。邮箱变密码输入问题修复。2.网络请求底层增加token过期检测刷新方法。3.更新控件库,iOS EditText取消默认密码输入方式。 --- HDL_ON/Common/Constant.cs | 19 + DLL/Shared.IOS.TBL.dll | 0 HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs | 10 DLL/Shared.Droid.xml | 11 HDL-ON_iOS/AppDelegate.cs | 1 HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs | 174 ++++++++++-- HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs | 29 ++ DLL/Shared.IOS.xml | 47 ++ HDL_ON/UI/UI1-Login/RegisterPage.cs | 29 + DLL/Shared.IOS.dll | 0 HDL_ON/Common/HDLCommon.cs | 34 ++ HDL_ON/DAL/Server/HttpUtil.cs | 78 +++++ HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 242 +++++++++++------ DLL/Shared.Droid.HDLWidget.dll | 0 HDL_ON/DAL/Server/HttpServerRequest.cs | 10 .vs/HDL_APP_Project/xs/UserPrefs.xml | 47 +-- DLL/Shared.Droid.dll | 0 HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs | 2 18 files changed, 540 insertions(+), 193 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index fd11f76..4cc64f7 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,37 +1,26 @@ -锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> - <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" /> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Common/HDLCommon.cs"> +锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> + <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.08FD445C-3EE8-4ED2-BF28-B42ADD0DA92C" /> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs"> <Files> - <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="324" Column="17" /> - <File FileName="HDL_ON/UI/UI0-Public/Widget/LineView.cs" Line="27" Column="24" /> - <File FileName="HDL_ON/DAL/Server/NewAPI.cs" Line="346" Column="1" /> - <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="1830" Column="76" /> - <File FileName="HDL_ON/Common/Utlis.cs" Line="29" Column="28" /> - <File FileName="HDL_ON/Common/HDLCommon.cs" Line="1" Column="1" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs" Line="1" Column="1" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="HDL_APP_Project" expanded="True"> <Node name="HDL_ON" expanded="True"> - <Node name="Common" expanded="True"> - <Node name="HDLCommon.cs" selected="True" /> - </Node> - <Node name="DAL" expanded="True"> - <Node name="Server" expanded="True" /> - </Node> - <Node name="Entity" expanded="True" /> <Node name="UI" expanded="True"> - <Node name="UI0-Public" expanded="True"> - <Node name="Widget" expanded="True" /> - </Node> + <Node name="UI0-Public" expanded="True" /> + <Node name="UI1-Login" expanded="True" /> <Node name="UI2" expanded="True"> - <Node name="1-HomePage" expanded="True" /> + <Node name="4-PersonalCenter" expanded="True"> + <Node name="AccountBindInfo" expanded="True" /> + <Node name="ResetAccountPassword" expanded="True"> + <Node name="ResetPasswordVerificationCodePage.cs" selected="True" /> + </Node> + </Node> </Node> </Node> - </Node> - <Node name="HDL-ON_iOS" expanded="True"> - <Node name="Resources" expanded="True" /> </Node> </Node> </State> @@ -44,16 +33,10 @@ <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> <String>Shared.IOS/Shared.IOS.csproj</String> </DisabledProjects> - <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> - <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" /> + <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> + <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.4b65c4650918" /> <MonoDevelop.Ide.DebuggingService.Breakpoints> - <BreakpointStore> - <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="529" column="1" /> - <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL-ON_iOS/ViewController.cs" relfile="HDL-ON_iOS/ViewController.cs" line="87" column="1" /> - <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL-ON_iOS/ViewController.cs" relfile="HDL-ON_iOS/ViewController.cs" line="75" column="1" /> - <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs" line="101" column="1" /> - <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/DAL/Server/HttpUtil.cs" relfile="HDL_ON/DAL/Server/HttpUtil.cs" line="550" column="1" /> - </BreakpointStore> + <BreakpointStore /> </MonoDevelop.Ide.DebuggingService.Breakpoints> <MultiItemStartupConfigurations /> </Properties> \ No newline at end of file diff --git a/DLL/Shared.Droid.HDLWidget.dll b/DLL/Shared.Droid.HDLWidget.dll index edc580f..e2a1608 100644 --- a/DLL/Shared.Droid.HDLWidget.dll +++ b/DLL/Shared.Droid.HDLWidget.dll Binary files differ diff --git a/DLL/Shared.Droid.dll b/DLL/Shared.Droid.dll index 9379ed5..8c4fcf4 100644 --- a/DLL/Shared.Droid.dll +++ b/DLL/Shared.Droid.dll Binary files differ diff --git a/DLL/Shared.Droid.xml b/DLL/Shared.Droid.xml index 608df93..8443fe6 100644 --- a/DLL/Shared.Droid.xml +++ b/DLL/Shared.Droid.xml @@ -2681,6 +2681,17 @@ 璁剧疆PickerView 閫変腑鏂囧瓧鐨勯鑹� </summary> </member> + <member name="P:Shared.UIPickerView.TextSize"> + <summary> + 鏂囧瓧澶у皬 + </summary> + <value>The size of the text.</value> + </member> + <member name="P:Shared.UIPickerView.PickerBackgroundColor"> + <summary> + 鑳屾櫙棰滆壊 + </summary> + </member> <member name="F:Shared.UIPickerView.mOnSelectChangeListener"> <summary> OnProgressChangeListener 缁ф壙鍝嶅簲浜嬩欢 diff --git a/DLL/Shared.IOS.TBL.dll b/DLL/Shared.IOS.TBL.dll index de9322f..d96cc12 100644 --- a/DLL/Shared.IOS.TBL.dll +++ b/DLL/Shared.IOS.TBL.dll Binary files differ diff --git a/DLL/Shared.IOS.dll b/DLL/Shared.IOS.dll index 74dd958..1575ccf 100644 --- a/DLL/Shared.IOS.dll +++ b/DLL/Shared.IOS.dll Binary files differ diff --git a/DLL/Shared.IOS.xml b/DLL/Shared.IOS.xml index 23e0121..ff15121 100644 --- a/DLL/Shared.IOS.xml +++ b/DLL/Shared.IOS.xml @@ -129,6 +129,11 @@ UI澶勭悊绫� </summary> </member> + <member name="F:Shared.Application.IsEditTextContentTypePassword"> + <summary> + EditText鏄惁榛樿瀵嗙爜杈撳叆鏂瑰紡 + </summary> + </member> <member name="P:Shared.Application.IsFullScreen"> <summary> 2020-06-23 @@ -276,6 +281,12 @@ <summary> 鍏抽棴瀹氫綅鏈嶅姟 </summary> + </member> + <member name="M:Shared.Application.SetStatusBarTextBlack(System.Boolean)"> + <summary> + 璁剧疆椤堕儴鐘舵�佹爮瀛椾綋棰滆壊 + </summary> + <param name="isBlack">鏄惁璁剧疆榛戣壊</param> </member> <member name="T:Shared.Button"> <summary> @@ -2971,6 +2982,17 @@ 璁剧疆PickerView 閫変腑鏂囧瓧鐨勯鑹� </summary> </member> + <member name="P:Shared.UIPickerView.TextSize"> + <summary> + 鏂囧瓧澶у皬 + </summary> + <value>The size of the text.</value> + </member> + <member name="P:Shared.UIPickerView.PickerBackgroundColor"> + <summary> + 鑳屾櫙棰滆壊 + </summary> + </member> <member name="F:Shared.UIPickerView.OnSelectChangeEvent"> <summary> Action @@ -3240,16 +3262,6 @@ 褰撳墠杩涘害鍊� </summary> <value>杩涘害鍊�</value> - </member> - <member name="P:Shared.CurtainRollSeekBar.CurtainPaddingLeftRight"> - <summary> - 杩涘害鏉′笌宸﹀彸杈规杈硅窛 - </summary> - </member> - <member name="P:Shared.CurtainRollSeekBar.CurtainPaddingTop"> - <summary> - 椤堕儴padding - </summary> </member> <member name="P:Shared.CurtainRollSeekBar.IsOffline"> <summary> @@ -4285,6 +4297,11 @@ </summary> <value>X鍧愭爣</value> </member> + <member name="P:Shared.DiyImageSeekBar.IsInvertedProgress"> + <summary> + 杩涘害鍊兼槸鍚﹀彇鍙� + </summary> + </member> <member name="F:Shared.DiyImageSeekBar.OnProgressChangedEvent"> <summary> EventHandler @@ -4721,6 +4738,11 @@ 璁剧疆鏄惁涓虹櫨鍙剁獥鏍峰紡 </summary> </member> + <member name="P:Shared.CurtainRollSeekBarOn.IsInvertedProgress"> + <summary> + 杩涘害鍊兼槸鍚﹀彇鍙� + </summary> + </member> <member name="F:Shared.CurtainRollSeekBarOn.OnProgressChangedEvent"> <summary> EventHandler @@ -4828,6 +4850,11 @@ </summary> <value>X鍧愭爣</value> </member> + <member name="P:Shared.CurtainSeekBarOn.IsInvertedProgress"> + <summary> + 杩涘害鍊兼槸鍚﹀彇鍙� + </summary> + </member> <member name="F:Shared.CurtainSeekBarOn.OnProgressChangedEvent"> <summary> EventHandler diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs index c10be06..c1567e0 100644 --- a/HDL-ON_iOS/AppDelegate.cs +++ b/HDL-ON_iOS/AppDelegate.cs @@ -211,6 +211,7 @@ { //Shared.Application.FontSize = 12; + Shared.Application.IsEditTextContentTypePassword = false; Shared.Application.IsUsePingFang = true; Window = new UIWindow(UIScreen.MainScreen.Bounds); rootViewController = new UINavigationController(new ViewController()) { NavigationBarHidden = true }; diff --git a/HDL_ON/Common/Constant.cs b/HDL_ON/Common/Constant.cs index df7d457..ff3f1b5 100644 --- a/HDL_ON/Common/Constant.cs +++ b/HDL_ON/Common/Constant.cs @@ -235,6 +235,25 @@ Prompt, } + /// <summary> + /// BottomLine 绫诲瀷 + /// </summary> + public enum BottomLineType + { + /// <summary> + /// 鏅�� + /// </summary> + Normal = 0, + /// <summary> + /// 鑾峰彇鐒︾偣 + /// </summary> + GotFocus, + /// <summary> + /// 閿欒 + /// </summary> + Error, + } + #endregion } diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index 47cc846..7656e26 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -69,7 +69,7 @@ #endregion - #region 妫�娴嬫洿鏂� + #region 鈻� 妫�娴嬫洿鏂癬______________________ /// <summary> /// 妫�娴嬫洿鏂扮嚎绋� /// </summary> @@ -238,7 +238,7 @@ } } - #region 鎺ㄩ�佸鐞� + #region 鈻� 鎺ㄩ�佸鐞哶______________________ /// <summary> /// 鎺ㄩ�佹秷鎭鐞� /// </summary> @@ -337,5 +337,35 @@ #endregion + #region 鈻� 甯哥敤鏂规硶_______________________ + /// <summary> + /// 璁剧疆涓嬪垝绾挎寜閽姸鎬� + /// 缁熶竴灏佽璁剧疆鏂规硶 + /// </summary> + /// <param name="button">涓嬪垝绾挎寜閽�</param> + /// <param name="bottomLineType">鐘舵��</param> + public void BottomLineShowType(Button button, BottomLineType bottomLineType) + { + switch (bottomLineType) + { + case BottomLineType.GotFocus: + button.BackgroundColor = CSS_Color.MainColor; + button.Height = Application.GetRealHeight(2); + break; + case BottomLineType.Error: + button.BackgroundColor = CSS_Color.AuxiliaryColor2; + button.Height = Application.GetRealHeight(2); + break; + case BottomLineType.Normal: + button.BackgroundColor = CSS_Color.DividingLineColor; + button.Height = Application.GetRealHeight(1); + break; + default: + button.BackgroundColor = CSS_Color.DividingLineColor; + button.Height = Application.GetRealHeight(1); + break; + } + } + #endregion } } diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index f7166f9..22a67d0 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -480,10 +480,10 @@ homeRegionId = mHome.homeRegionId, Address = mHome.homeAddress, }; - if (home.IsOthreShare) - { - continue; - } + //if (home.IsOthreShare) + //{ + // continue; + //} UserInfo.Current.regionList.Add(home); } @@ -1807,7 +1807,7 @@ { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID); - d.Add("gatewayId", DB_ResidenceData.residenceData.HomeGateway.gatewayId); + //d.Add("gatewayId", DB_ResidenceData.residenceData.HomeGateway.gatewayId); //d.Add("roomId", DB_ResidenceData.residenceData.residecenInfo.RegionID);//鍙帶鍙傛暟锛屽綋闇�瑕佸垎椤佃幏鍙栵紝鎬庝箞鐭ラ亾鍒嗛〉鎬绘暟 //d.Add("searchType", DB_ResidenceData.residenceData.residecenInfo.RegionID); //d.Add("pageSize", DB_ResidenceData.residenceData.residecenInfo.RegionID); diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 1cca265..3b85363 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -12,7 +12,7 @@ public class HttpUtil { - #region HttpUtil 鍏ㄥ眬甯搁噺 + #region **********鍏ㄥ眬甯搁噺********** ///// <summary> ///// API_HTTPS ///// </summary> @@ -36,6 +36,7 @@ #endregion + #region **********缃戠粶璇锋眰灏佽********** /// <summary> /// 鍥哄畾鍩熷悕,姝e紡鐜 /// </summary> @@ -145,7 +146,7 @@ /// <param name="replaceToken"></param> /// <param name="mTimeout"></param> /// <returns></returns> - public static ResponsePackNew RequestHttps(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10) + static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10) { #region HttpWebRequest try @@ -167,7 +168,6 @@ RestRequest request = new RestRequest(method); request.Timeout = mTimeout * 1000; request.AddHeader("content-type", "application/json"); - //request.AddHeader ("cache-control", "no-cache"); if (string.IsNullOrEmpty(replaceToken)) { @@ -207,7 +207,6 @@ { try { - ResponsePackNew revertObj = new ResponsePackNew() { }; revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content); //*****涓�浜涘垽绌哄鐞�***************** @@ -222,8 +221,6 @@ } //*****涓�浜涘垽绌哄鐞�***************** - ////缁熶竴杞垚澶у啓 - //revertObj.StateCode = revertObj.StateCode.ToUpper (); return revertObj; } catch (Exception ex) @@ -247,6 +244,69 @@ #endregion + } + + /// <summary> + /// 閫氱敤 璇锋眰鏈嶅姟鍣ㄦ柟娉� + /// 澧炲姞token杩囨湡澶勭悊 + /// </summary> + /// <param name="method"></param> + /// <param name="apiPath"></param> + /// <param name="bodyParameterJson"></param> + /// <param name="queryDictionary"></param> + /// <param name="urlSegmentDictionary"></param> + /// <param name="urlHead"></param> + /// <param name="replaceToken"></param> + /// <param name="mTimeout"></param> + /// <returns></returns> + public static ResponsePackNew RequestHttps(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10) + { + var responsePackNew = RequestHttpsBase(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout); + //*****************Token杩囨湡澶勭悊***************** + if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) + { + //鍒锋柊Token + if (RefreshToken()) { + return RequestHttpsBase(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout); + } + else + { + return responsePackNew; + } + } + //*****************Token杩囨湡澶勭悊***************** + return responsePackNew; + } + + + /// <summary> + /// 鍒锋柊Token + /// </summary> + /// <returns></returns> + static bool RefreshToken() + { + try + { + var requestJson = GetSignRequestJson(new RefreshTokenObj() + { + refreshToken = UserInfo.Current.RefreshToken, + }); + var revertObj = RequestHttpsBase(Method.POST, NewAPI.API_POST_Login, requestJson); + if (revertObj.Code == StateCode.SUCCESS) + { + var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString()); + UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; + UserInfo.Current.RefreshToken = revertData.refreshToken; + UserInfo.Current.LastTime = DateTime.Now; + UserInfo.Current.SaveUserInfo(); + return true; + } + return false; + } + catch + { + return false; + } } /// <summary> @@ -275,7 +335,6 @@ ////**************娴嬭瘯************** RestClient client = new RestClient(requestFullUrl); - //client.Timeout = mTimeout * 1000; RestRequest request = new RestRequest(Method.POST); request.Timeout = mTimeout * 1000; request.AddHeader("content-type", "application/json"); @@ -454,7 +513,9 @@ } + #endregion + #region **********绛惧悕鏍¢獙********** /// <summary> /// /// </summary> @@ -551,6 +612,7 @@ } } + #endregion } /// <summary> @@ -586,7 +648,5 @@ } - - } diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs index 224574b..d91c3d4 100644 --- a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs +++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs @@ -165,6 +165,10 @@ /// </summary> string registerPhone; string registerEmail; + /// <summary> + /// 鏄惁鐐瑰嚮浜嗚繑鍥烇紝鐢ㄤ簬灞忚斀EditText澶卞幓鐒︾偣妫�娴嬩簨浠� + /// </summary> + bool isHitBack; #endregion /// <summary> @@ -185,7 +189,11 @@ public void ShowDialog() { - new TopViewDiv(this, bodyView, Language.StringByID(StringId.ForgetPassword)).LoadTopView(); + Action backAction = () => + { + isHitBack = true; + }; + new TopViewDiv(this, bodyView, Language.StringByID(StringId.ForgetPassword)).LoadTopView(backAction); //new PublicAssmebly().LoadTopView(this, bodyView, Language.StringByID(StringId.ForgetPassword)); #region 淇敼鏂瑰紡閫夋嫨 diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs index e04a6a4..47cfc1e 100644 --- a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs @@ -32,6 +32,12 @@ { if (registerType == 0) return; + + if (!string.IsNullOrEmpty(etAccount.Text.Trim())) + { + //璁板綍涔嬪墠鐨勯偖绠� + registerEmail = etAccount.Text.Trim(); + } etAccount.IsNumberKeyboardType = true; etAccount.Text = registerPhone; etPassword.Text = ""; @@ -61,7 +67,14 @@ { if (registerType == 1) return; + + if (!string.IsNullOrEmpty(etAccount.Text.Trim())) + { + //璁板綍涔嬪墠鐨勬墜鏈哄彿 + registerPhone = etAccount.Text.Trim(); + } etAccount.IsNumberKeyboardType = false; + etAccount.SecureTextEntry = false;//2020-12-10 瑙e喅Android鏁板瓧鍒囨崲鍥炶矾鏅�氶敭鐩樺彉鍔犲瘑闂 etAccount.Text = registerEmail; etPassword.Text = ""; etRepeatPassword.Text = ""; @@ -120,7 +133,26 @@ btnGetVerificationCode_Mail.IsSelected = true; } } + + LoadMothed_EnableResetButton(); }; + + //etVerificationCode.TextChangeEventHandler = (sender, e) => { + + // if (etVerificationCode.Text.Length > 1) + // { + // LoadMothed_EnableResetButton(); + // } + //}; + + Action<View, string> textChangeEventHandler = (view, textStr) => + { + LoadMothed_EnableResetButton(); + }; + //etAccount.TextChangeEventHandler += textChangeEventHandler; + etPassword.TextChangeEventHandler += textChangeEventHandler; + etRepeatPassword.TextChangeEventHandler += textChangeEventHandler; + etVerificationCode.TextChangeEventHandler += textChangeEventHandler; } /// <summary> @@ -133,22 +165,22 @@ { if (etAccount.Foucs) { - btnAccountViewBottomLine.BackgroundColor = CSS_Color.MainColor; - btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.GotFocus); } else { - //鏍囪鎵嬫満鍙风爜鏃犳晥 - btnAccountViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnAccountViewBottomLine.Height = Application.GetRealHeight(1); + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Normal); + if (etAccount.Text.Length == 0) return;//娌¤緭鍏ヤ笉妫�娴嬫彁绀� + //鎵嬫満鏂瑰紡-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘ if (registerType == 0) { btnGetVerificationCode_Phone.IsSelected = false; if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) { - btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Error); new Tip() { CloseTime = 1, @@ -158,7 +190,7 @@ } else { - if (btnGetVerificationCode_Phone.Text == Language.StringByID( StringId.GetVerificationCode)) + if (btnGetVerificationCode_Phone.Text == Language.StringByID(StringId.GetVerificationCode)) { btnGetVerificationCode_Phone.IsSelected = true; } @@ -171,8 +203,7 @@ //閭鏂瑰紡-楠岃瘉閭鏄惁姝g‘ if (!Utlis.CheckEmail(etAccount.Text.Trim())) { - btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Error); new Tip() { CloseTime = 1, @@ -197,16 +228,19 @@ { if (etPassword.Foucs) { - btnPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; - btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.GotFocus); } else { - btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnPasswordViewBottomLine.Height = Application.GetRealHeight(1); + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.Normal); + if (etPassword.Text.Length == 0) return;//娌¤緭鍏ヤ笉妫�娴嬫彁绀� + //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰 if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13) { + HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.Error); new Tip() { CloseTime = 1, @@ -222,18 +256,17 @@ { if (etRepeatPassword.Foucs) { - btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; - btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.GotFocus); } else { - btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(1); + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.Normal); //鏍¢獙涓ゆ杈撳叆鐨勫瘑鐮佹槸鍚︿竴鑷� if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) { - btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.Error); new Tip() { CloseTime = 1, @@ -253,13 +286,13 @@ { if (etVerificationCode.Foucs) { - btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.MainColor; - btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.GotFocus); } else { - btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(1); + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.Normal); if (etVerificationCode.Text.Length > 4) { LoadMothed_EnableResetButton(); @@ -292,7 +325,8 @@ /// 妫�娴嬪綋鍓嶉厤缃煙鍚嶆槸鍚︿竴鑷达紝涓嶄竴鑷村垯鏇挎崲 /// </summary> /// <param name="result"></param> - void CheckAndSetUserRequestHost(ResponsePackNew result) { + void CheckAndSetUserRequestHost(ResponsePackNew result) + { try { var mGlobalRegionListObj = Newtonsoft.Json.JsonConvert.DeserializeObject<GlobalRegionListRes>(result.Data.ToString()); @@ -361,8 +395,8 @@ //3.鍙戦�侀獙璇佺爜鎴愬姛锛屽紑濮嬭鏃� Application.RunOnMainThread(() => { - //鐭俊鍙戦�侀棿闅�60s - (sender as Button).IsSelected = false; + //鐭俊鍙戦�侀棿闅�60s + (sender as Button).IsSelected = false; etVerificationCode.Foucs = true; }); //2.1鑾峰彇楠岃瘉鐮佸�掕鏃� @@ -379,8 +413,8 @@ } Application.RunOnMainThread(() => { - //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢 - (sender as Button).IsSelected = true; + //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢 + (sender as Button).IsSelected = true; (sender as Button).TextID = StringId.GetVerificationCode; }); }) @@ -419,6 +453,13 @@ { if (btnReset.IsSelected) { + //妫�娴嬭处鍙� + if (!CheckAccount()) return; + //妫�娴嬪瘑鐮� + if (!CheckPassword()) return; + //妫�娴嬮獙璇佺爜 + if (!CheckVerificationCode()) return; + //鍒涘缓淇敼瀵嗙爜绾跨▼ var loginThread = LoadMothed_ResetThread(); waitPage = new Loading(); @@ -472,8 +513,7 @@ // 楠岃瘉鐮侀敊璇� 璀﹀憡鎻愮ず if (resultObj.Code == StateCode.VERIFICATION_CODE_WRONG) { - btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.Error); } }); // 鎻愮ず閿欒 @@ -498,6 +538,76 @@ } /// <summary> + /// 妫�娴嬭处鍙� + /// </summary> + /// <returns></returns> + bool CheckAccount() + { + //鎵嬫満鏂瑰紡-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘ + if (registerType == 0) + { + if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) + { + Utlis.ShowTip(Language.StringByID(StringId.PlsEntryCorrectMobilNeumber)); + } + else + { + return true; + } + + } + else if (registerType == 1) + { + //閭鏂瑰紡-楠岃瘉閭鏄惁姝g‘ + if (!Utlis.CheckEmail(etAccount.Text.Trim())) + { + Utlis.ShowTip(Language.StringByID(StringId.PlsEntryCorrectEmailAddress)); + } + else + { + return true; + } + } + + return false; + } + + /// <summary> + /// 妫�娴嬪瘑鐮佹槸鍚︽纭� + /// </summary> + /// <returns></returns> + bool CheckPassword() + { + //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰 + if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13) + { + Utlis.ShowTip(Language.StringByID(StringId.PasswordIsUnqualified)); + return false; + } + + if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) + { + Utlis.ShowTip(Language.StringByID(StringId.IncorrectRepeatPassword)); + return false; + } + return true; + } + + /// <summary> + /// 妫�娴嬮獙璇佺爜鏄惁杈撳叆 + /// </summary> + /// <returns></returns> + bool CheckVerificationCode() + { + if (string.IsNullOrEmpty(etVerificationCode.Text)) + { + Utlis.ShowTip(Language.StringByID(StringId.PlsEntryVerificationCode)); + return false; + } + return true; + } + + /// <summary> /// 鏄剧ず鑷姩鑷姩鐧诲綍浜嬩欢 /// </summary> void ShowAutoLoginDialog(string account, string password, bool isPhone) @@ -514,7 +624,7 @@ FrameLayout contentView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealWidth(200), + Y = Application.GetRealWidth(200), Width = Application.GetRealWidth(288), Height = Application.GetRealWidth(270), Radius = (uint)Application.GetRealWidth(6), diff --git a/HDL_ON/UI/UI1-Login/RegisterPage.cs b/HDL_ON/UI/UI1-Login/RegisterPage.cs index eb9b2f2..a21adac 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPage.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPage.cs @@ -166,12 +166,12 @@ #endregion #region 灞�閮ㄥ彉閲忓垪琛� - /// <summary> - /// 璐﹀彿绫诲瀷 - /// 0:鎵嬫満 - /// 1:閭 - /// </summary> - int accountType = 0; + ///// <summary> + ///// 璐﹀彿绫诲瀷 + ///// 0:鎵嬫満 + ///// 1:閭 + ///// </summary> + //int accountType = 0; /// <summary> /// 鎵嬫満鍙风爜鏄惁鏈夋晥 /// </summary> @@ -193,7 +193,7 @@ /// 0:鎵嬫満 /// 1:閭 /// </summary> - int registerType; + int registerType = 0; /// <summary> /// 鎵嬫満鍖哄彿 /// </summary> @@ -205,6 +205,10 @@ string registerPhone; string registerEmail; + /// <summary> + /// 鏄惁鐐瑰嚮浜嗚繑鍥烇紝鐢ㄤ簬灞忚斀EditText澶卞幓鐒︾偣妫�娴嬩簨浠� + /// </summary> + bool isHitBack; #endregion /// <summary> @@ -244,7 +248,12 @@ public void ShowDialog() { - new TopViewDiv(this, bodyView, Language.StringByID(StringId.Register)).LoadTopView(); + Action backAction = () => + { + isHitBack = true; + }; + + new TopViewDiv(this, bodyView, Language.StringByID(StringId.Register)).LoadTopView(backAction); //new PublicAssmebly().LoadTopView(this, bodyView, Language.StringByID(StringId.Register)); #region 娉ㄥ唽鏂瑰紡閫夋嫨 @@ -362,7 +371,7 @@ }; btnGlobalRoaming.MouseUpEventHandler += eHandler; - if (accountType == 0) + if (registerType == 0) { accountView.AddChidren(btnGlobalRoaming); } @@ -406,7 +415,7 @@ Height = Application.GetMinRealAverage(20), UnSelectedImagePath = "LoginIcon/AccountIcon.png", }; - if (accountType == 1) + if (registerType == 1) { accountView.AddChidren(btnAccountIcon); } diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs index 324c450..e398c75 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs @@ -24,6 +24,27 @@ LoadEvent_Server(); //var areaCodeList = pm.GetAreaCode(); } + + + + /// <summary> + /// 浣胯兘淇敼娉ㄥ唽鎸夐挳 + /// 鏈夊唴瀹规墠鏄剧ず娉ㄥ唽鎸夐挳 + /// </summary> + void CheckEnableRegisterButton() + { + if (!string.IsNullOrEmpty(etAccount.Text) && !string.IsNullOrEmpty(etPassword.Text) && !string.IsNullOrEmpty(etVerificationCode.Text) && (etPassword.Text.Trim() == etRepeatPassword.Text.Trim())) + { + btnRegister.IsSelected = true; + } + else + { + btnRegister.IsSelected = false; + } + + //Utlis.WriteLine(" btnRegister.IsSelected:" + btnRegister.IsSelected.ToString()); + } + /// <summary> /// 鍔犺浇鏂囨湰鍙樺寲浜嬩欢 /// </summary> @@ -57,7 +78,12 @@ btnGetVerificationCode_Mail.IsSelected = true; } } + CheckEnableRegisterButton(); + }; + etVerificationCode.TextChangeEventHandler = (sender, e) => + { + CheckEnableRegisterButton(); }; } @@ -73,6 +99,13 @@ { return; } + + if (!string.IsNullOrEmpty(etAccount.Text.Trim())) + { + //璁板綍涔嬪墠鐨勯偖绠� + registerEmail = etAccount.Text.Trim(); + } + etAccount.IsNumberKeyboardType = true; etAccount.Text = registerPhone; etPassword.Text = ""; @@ -103,7 +136,13 @@ if (registerType == 1) return; + if (!string.IsNullOrEmpty(etAccount.Text.Trim())) + { + //璁板綍涔嬪墠鐨勬墜鏈哄彿 + registerPhone = etAccount.Text.Trim(); + } etAccount.IsNumberKeyboardType = false; + etAccount.SecureTextEntry = false;//2020-12-10 瑙e喅Android鏁板瓧鍒囨崲鍥炶矾鏅�氶敭鐩樺彉鍔犲瘑闂 etAccount.Text = registerEmail; etPassword.Text = ""; etRepeatPassword.Text = ""; @@ -139,14 +178,14 @@ { if (etAccount.Foucs) { - btnAccountViewBottomLine.BackgroundColor = CSS_Color.MainColor; - btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.GotFocus); } else { + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + //鏍囪鎵嬫満鍙风爜鏃犳晥 - btnAccountViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnAccountViewBottomLine.Height = Application.GetRealHeight(1); + HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Normal); //鎵嬫満娉ㄥ唽-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘ if (etAccount.Text.Trim().Length > 0) { @@ -154,8 +193,7 @@ { if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) { - btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Error); btnGetVerificationCode_Phone.IsSelected = false; new Tip() { @@ -183,8 +221,7 @@ //閭娉ㄥ唽-楠岃瘉閭鏄惁姝g‘ if (!Utlis.CheckEmail(etAccount.Text.Trim())) { - btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnAccountViewBottomLine, BottomLineType.Error); btnGetVerificationCode_Mail.IsSelected = false; new Tip() { @@ -207,14 +244,7 @@ } } } - if (accountType == 0) - { - registerPhone = etAccount.Text.Trim(); - } - else - { - registerEmail = etAccount.Text.Trim(); - } + } }; @@ -223,23 +253,19 @@ { if (etPassword.Foucs) { - btnPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; - btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.GotFocus); } else { - if (etPassword.Text.Length == 0) - { - btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnPasswordViewBottomLine.Height = Application.GetRealHeight(1); - return; - } + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.Normal); + if (etPassword.Text.Length == 0) return;//娌¤緭鍏ヤ笉妫�娴嬫彁绀� + //闇�瑕佽緭鍏�6浣嶄互涓婄殑瀵嗙爜 if (etPassword.Text.Length < 6 || etPassword.Text.Length > 13) { - btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); - + HDLCommon.Current.BottomLineShowType(btnPasswordViewBottomLine, BottomLineType.Error); new Tip() { CloseTime = 1, @@ -247,11 +273,7 @@ Text = Language.StringByID(StringId.PlsRegisterPassword) }.Show(bodyView); } - else - { - btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnPasswordViewBottomLine.Height = Application.GetRealHeight(1); - } + } }; @@ -260,20 +282,19 @@ { if (etRepeatPassword.Foucs) { - btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; - btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.GotFocus); } else { - btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(1); + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.Normal); //鏍¢獙涓ゆ杈撳叆鐨勫瘑鐮佹槸鍚︿竴鑷� if (etPassword.Text.Trim().Length > 5) { if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) { - btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnRepeatPasswordViewBottomLine, BottomLineType.Error); new Tip() { CloseTime = 1, @@ -299,13 +320,13 @@ { if (etVerificationCode.Foucs) { - btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.MainColor; - btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.GotFocus); } else { - btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(1); + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.Normal); if (etVerificationCode.Text.Length > 1) { //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮娉ㄥ唽 @@ -316,6 +337,7 @@ } } }; + } /// <summary> @@ -329,6 +351,7 @@ { etPassword.Text = etPassword.Text.Remove(15); } + CheckEnableRegisterButton(); }; etRepeatPassword.TextChangeEventHandler = (sender, e) => @@ -337,6 +360,7 @@ { etRepeatPassword.Text = etRepeatPassword.Text.Remove(15); } + CheckEnableRegisterButton(); }; } @@ -519,20 +543,16 @@ { btnRegister.MouseUpEventHandler = (sender, e) => { - if (etPassword.Text.Trim().Length > 13 || etPassword.Text.Trim().Length < 6) - { - new Tip() - { - CloseTime = 1, - Direction = AMPopTipDirection.None, - Text = Language.StringByID(StringId.PlsRegisterPassword) - }.Show(bodyView); - return; - } if (btnRegister.IsSelected) { //鍒ゆ柇鏄惁閫夋嫨浜嗘湇鍔″櫒锛岄�夋嫨浜嗘墠鑳藉彂閫侀獙璇佺爜 if (CheckIfSelectServer() == false) return; + //妫�娴嬭处鍙� + if (!CheckAccount()) return; + //妫�娴嬪瘑鐮� + if (!CheckPassword()) return; + //妫�娴嬮獙璇佺爜 + if (!CheckVerificationCode()) return; waitPage = new Loading(); new PublicAssmebly().LoadPage_WaitPage(LoadMethod_RegisterThread(), bodyView, waitPage); @@ -572,40 +592,13 @@ // 鎻愮ず閿欒 IMessageCommon.Current.ShowErrorInfoAlter(validateSmsResult.Code); - //2020-11-13 寰呬慨鏀� - //string erorrInfo = ""; - //switch (validateSmsResult.StateCode) - //{ - // case "Exist": - // erorrInfo = Language.StringByID(StringId.AccountAlreadyUse); - // break; - // case "PwdNoConfirm": - // erorrInfo = Language.StringByID(StringId.IncorrectRepeatPassword); - // break; - // case "ValidCodeAndPhoneNoEqual": - // erorrInfo = Language.StringByID(StringId.VerificationCodeWrong); - // break; - // case "NoRecord": - // erorrInfo = Language.StringByID(StringId.PlsGetTheVerificationCode); - // Application.RunOnMainThread(() => - // { - // btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - // btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2); - // }); - // break; - // default: - // erorrInfo = Language.StringByID(StringId.RegistrationFailedPleaseTryAgain); - // break; - //} - //Application.RunOnMainThread(() => - //{ - // new Tip() - // { - // CloseTime = 1, - // Direction = AMPopTipDirection.None, - // Text = erorrInfo, - // }.Show(bodyView); - //}); + Application.RunOnMainThread(() => + { + if (validateSmsResult.Code == StateCode.VERIFICATION_CODE_WRONG) + { + HDLCommon.Current.BottomLineShowType(btnVerificationCodeViewBottomLine, BottomLineType.Error); + } + }); } } catch (Exception ex) @@ -673,13 +666,11 @@ { if (isError) { - btnServerBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - btnServerBottomLine.Height = Application.GetRealHeight(2); + HDLCommon.Current.BottomLineShowType(btnServerBottomLine, BottomLineType.Error); } else { - btnServerBottomLine.BackgroundColor = CSS_Color.DividingLineColor; - btnServerBottomLine.Height = Application.GetRealHeight(1); + HDLCommon.Current.BottomLineShowType(btnServerBottomLine, BottomLineType.Normal); } } @@ -694,5 +685,76 @@ btnServerText.TextColor = CSS_Color.FirstLevelTitleColor; btnServerText.Text = UserInfo.Current.GlobalRegion.regionName; } + + + /// <summary> + /// 妫�娴嬭处鍙� + /// </summary> + /// <returns></returns> + bool CheckAccount() + { + //鎵嬫満鏂瑰紡-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘ + if (registerType == 0) + { + if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) + { + Utlis.ShowTip(Language.StringByID(StringId.PlsEntryCorrectMobilNeumber)); + } + else + { + return true; + } + + } + else if (registerType == 1) + { + //閭鏂瑰紡-楠岃瘉閭鏄惁姝g‘ + if (!Utlis.CheckEmail(etAccount.Text.Trim())) + { + Utlis.ShowTip(Language.StringByID(StringId.PlsEntryCorrectEmailAddress)); + } + else + { + return true; + } + } + + return false; + } + + /// <summary> + /// 妫�娴嬪瘑鐮佹槸鍚︽纭� + /// </summary> + /// <returns></returns> + bool CheckPassword() + { + //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰 + if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13) + { + Utlis.ShowTip(Language.StringByID(StringId.PasswordIsUnqualified)); + return false; + } + + if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) + { + Utlis.ShowTip(Language.StringByID(StringId.IncorrectRepeatPassword)); + return false; + } + return true; + } + + /// <summary> + /// 妫�娴嬮獙璇佺爜鏄惁杈撳叆 + /// </summary> + /// <returns></returns> + bool CheckVerificationCode() + { + if (string.IsNullOrEmpty(etVerificationCode.Text)) + { + Utlis.ShowTip(Language.StringByID(StringId.PlsEntryVerificationCode)); + return false; + } + return true; + } } } \ No newline at end of file diff --git a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs index 4ea4cbd..076aa4c 100644 --- a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs @@ -323,7 +323,7 @@ { new Alert(pushMessageInfo.messageTitle, pushMessageInfo.messageContent, Language.StringByID(StringId.Close)).Show(); }; - + rowView.MouseUpEventHandler = eventHandler; btnTilte.MouseUpEventHandler = eventHandler; btnSubtitle.MouseUpEventHandler = eventHandler; } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs index 35f59a2..54bad8f 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs @@ -40,6 +40,12 @@ /// /// </summary> FrameLayout bodyView; + + /// <summary> + /// 鏄惁鐐瑰嚮浜嗚繑鍥烇紝鐢ㄤ簬灞忚斀EditText澶卞幓鐒︾偣妫�娴嬩簨浠� + /// </summary> + bool isHitBack; + #endregion public ResetPasswordPage() @@ -50,7 +56,13 @@ public void LoadPage() { bodyView.BackgroundColor = CSS_Color.BackgroundColor; - new TopViewDiv(bodyView, Language.StringByID(StringId.ModifyPassword)).LoadTopView(); + + Action backAction = () => + { + isHitBack = true; + }; + + new TopViewDiv(bodyView, Language.StringByID(StringId.ModifyPassword)).LoadTopView(backAction); #region 鏂板瘑鐮� FrameLayout rowView = new FrameLayout() @@ -257,6 +269,10 @@ } else { + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + if (etPassword.Text.Length == 0) return;//娌¤緭鍏ヤ笉妫�娴嬫彁绀� + //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰 if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13) { @@ -283,6 +299,10 @@ } else { + if (isHitBack) return;//鐐瑰嚮杩斿洖鍏抽棴椤甸潰涓嶆娴嬫彁绀� + + if (etRepeatPassword.Text.Length == 0) return;//娌¤緭鍏ヤ笉妫�娴嬫彁绀� + //鏍¢獙涓ゆ杈撳叆鐨勫瘑鐮佹槸鍚︿竴鑷� if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) { @@ -300,6 +320,13 @@ } }; + Action<View, string> textChangeEventHandler = (view, textStr) => + { + LoadMothed_EnableResetButton(); + }; + etPassword.TextChangeEventHandler += textChangeEventHandler; + etRepeatPassword.TextChangeEventHandler += textChangeEventHandler; + } /// <summary> -- Gitblit v1.8.0