From f60ce72c3c29c7d31a046795c88ec39a69e73d45 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期三, 06 一月 2021 17:33:54 +0800 Subject: [PATCH] 2021-01-06 1.替换新云端前期准备相关接口,和修改相关参数。 --- Crabtree/SmartHome/UI/SimpleControl/Phone/Register/ForgotPassword.cs | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/ForgotPassword.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/ForgotPassword.cs index d6f3709..29eb9f2 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/ForgotPassword.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/ForgotPassword.cs @@ -69,7 +69,7 @@ if (bodyPageView.ChildrenCount - 2 == e) { bodyPageView.RemoveAt (bodyPageView.ChildrenCount - 1); } - Console.WriteLine ("D" + e.ToString ()); + Utlis.WriteLine ("D" + e.ToString ()); }; FrameLayout bodyView = new FrameLayout (); @@ -139,14 +139,15 @@ void EmailForgot (FrameLayout FrameLayoutView) { FrameLayoutView.RemoveAll (); + var viewX = (Application.GetRealWidth (640) - Application.GetMinRealAverage (500)) / 2; EditText Register_Email_Address = new EditText () { - Width = Application.GetRealWidth (500), - Height = Application.GetRealHeight (85), - X = Application.GetRealWidth (70), + Width = Application.GetMinRealAverage (500), + Height = Application.GetMinRealAverage (85), + X = viewX, Y = Application.GetRealHeight (100), UnSelectedImagePath = "Register/Register_Email_Address.png", - PlaceholderText = Language.StringByID (R.MyInternationalizationString.EmailAddress), PlaceholderTextColor = SkinStyle.Current.PlaceholderTextColor, + PlaceholderText = Language.StringByID (R.MyInternationalizationString.EmailAddress), TextAlignment = TextAlignment.Center, Radius = (uint)Application.GetRealHeight (0), TextColor = SkinStyle.Current.TextColor1, @@ -193,10 +194,10 @@ try { Register_Send.IsSelected = false; - var reg = new Regex ("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); - var ss = reg.Match (emailAccount); + //var reg = new Regex ("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); + //var ss = reg.Match (emailAccount); - if (!ss.Success) { + if (!CommonUtlis.Current.CheckEmail (emailAccount)) { Application.RunOnMainThread (() => { new Alert ("", Language.StringByID (R.MyInternationalizationString.PleaseCheckEmailAddressCorrectly), Language.StringByID (R.MyInternationalizationString.Close)).Show (); @@ -204,8 +205,8 @@ } else { var requestObj = new YdForgetPasswordObj () { Account = emailAccount, Company = MainPage.SoftSmsType }; var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); - var requestRevertObj = MainPage.RequestHttps (API.YdForgetPassword, requestJson, false); - if (requestRevertObj.StateCode.ToUpper() == "SUCCESS") { + var requestRevertObj = MainPage.RequestHttps (API.YdForgetPassword, requestJson); + if (requestRevertObj.StateCode.ToUpper() == StateCode.SUCCESS) { Application.RunOnMainThread (() => { this.Close (); new Alert ("", "A reset link has been sent to you email ID, Please check.", Language.StringByID (R.MyInternationalizationString.Close)).Show (); @@ -314,7 +315,7 @@ var requestObj = new SignPhoneObj () { Phone = phoneNum, Company = MainPage.SoftSmsType }; var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); var requestRevertObj = MainPage.RequestHttps ("SignPhone", requestJson); - if (requestRevertObj.StateCode.ToUpper() == "SUCCESS") { + if (requestRevertObj.StateCode.ToUpper() == StateCode.SUCCESS) { Application.RunOnMainThread (() => { InitSMSView (phoneNum); bodyPageView.PageIndex = bodyPageView.ChildrenCount - 1; @@ -413,8 +414,8 @@ try { var requestObj = new ValidateSmsCodeObj () { Phone = mobileNumber, Code = vCode }; var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); - var requestRevertObj = MainPage.RequestHttps ("ValidateSmsCode", requestJson, false); - if (requestRevertObj.StateCode.ToUpper() == "SUCCESS") { + var requestRevertObj = MainPage.RequestHttps ("ValidateSmsCode", requestJson); + if (requestRevertObj.StateCode.ToUpper() == StateCode.SUCCESS) { Application.RunOnMainThread (() => { InitMobilePasswrod (mobileNumber); bodyPageView.PageIndex = bodyPageView.ChildrenCount - 1; @@ -516,8 +517,8 @@ try { var requestObj = new ForgetPasswordActionObj () { Account = mobileNumber, Password = newpw }; var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); - var revertObj = MainPage.RequestHttps ("ForgetPasswordAction", requestJson, false); - if (revertObj.StateCode.ToUpper() == "SUCCESS") { + var revertObj = MainPage.RequestHttps ("ForgetPasswordAction", requestJson); + if (revertObj.StateCode.ToUpper() == StateCode.SUCCESS) { Application.RunOnMainThread (() => { new Alert ("", Language.StringByID (R.MyInternationalizationString.ThePerationWasSuccessful), Language.StringByID (R.MyInternationalizationString.Close)).Show (); -- Gitblit v1.8.0