From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs | 129 +++++++++++++----------------------------- 1 files changed, 40 insertions(+), 89 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs index 8cb52a4..12e0827 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs @@ -55,13 +55,13 @@ var rowPhone = new FrameRowControl(); //鍙宠竟鍋忕Щ閲�->澧炲姞瀹藉害 - rowPhone.RightOffset = -ControlCommonResourse.XXLeft; + rowPhone.RightOffset = -HdlControlResourse.XXLeft; rowPhone.Y = Application.GetRealHeight(23); - rowPhone.Width = Application.GetMinRealAverage(628); + rowPhone.Width = this.GetPictrueRealSize(628); bodyFrameLayout.AddChidren(rowPhone); //璇疯緭鍏ラ偖绠辨垨鎵嬫満鍙� - string phoneValue = string.IsNullOrEmpty(UserCenterResourse.UserInfo.Phone) == true ? string.Empty : "+" + UserCenterResourse.UserInfo.AreaCode + " " + UserCenterResourse.UserInfo.Phone; - var txtPhone = rowPhone.AddLeftCaption(string.IsNullOrEmpty(phoneValue) == true ? UserCenterResourse.UserInfo.Email : phoneValue, 600); + string phoneValue = string.IsNullOrEmpty(HdlUserCenterResourse.UserInfo.UserPhone) == true ? string.Empty : "+" + HdlUserCenterResourse.UserInfo.PhoneAreaCode + " " + HdlUserCenterResourse.UserInfo.UserPhone; + var txtPhone = rowPhone.AddLeftCaption(string.IsNullOrEmpty(phoneValue) == true ? HdlUserCenterResourse.UserInfo.UserEmail : phoneValue, 600); txtPhone.TextColor = UserCenterColor.Current.TextGrayColor2; //搴曠嚎 rowPhone.AddBottomLine(); @@ -70,7 +70,7 @@ var rowCode = new FrameRowControl(); rowCode.Y = rowPhone.Bottom + Application.GetRealHeight(20); - rowCode.Width = Application.GetMinRealAverage(628); + rowCode.Width = this.GetPictrueRealSize(628); bodyFrameLayout.AddChidren(rowCode); //璇疯緭鍏ラ獙璇佺爜 var txtCode = rowCode.AddLeftInput("", 600); @@ -81,7 +81,7 @@ var btnCode = new NormalViewControl(302, 127, true); btnCode.X = rowPhone.Right + Application.GetRealWidth(35); btnCode.Y = Application.GetRealHeight(23); - btnCode.Radius = 4; + btnCode.RadiusEx = 12; btnCode.TextID = R.MyInternationalizationString.uGetVerificationCode; btnCode.TextColor = UserCenterColor.Current.White; btnCode.BackgroundColor = UserCenterColor.Current.TextOrangeColor; @@ -95,22 +95,22 @@ //閿欒淇℃伅鎺т欢 btnMsgControl = new NormalViewControl(800, 58, true); - btnMsgControl.X = ControlCommonResourse.XXLeft; + btnMsgControl.X = HdlControlResourse.XXLeft; btnMsgControl.Y = rowCode.Bottom + Application.GetRealHeight(46); btnMsgControl.TextColor = 0xfff75858; btnMsgControl.TextID = R.MyInternationalizationString.uVerificationCodeErrorInputAgain; bodyFrameLayout.AddChidren(btnMsgControl); btnMsgControl.Visible = false; - if (string.IsNullOrEmpty(UserCenterResourse.UserInfo.Phone) == true - || string.IsNullOrEmpty(UserCenterResourse.UserInfo.Email) == true) + if (string.IsNullOrEmpty(HdlUserCenterResourse.UserInfo.UserPhone) == true + || string.IsNullOrEmpty(HdlUserCenterResourse.UserInfo.UserEmail) == true) { rowPhone.UseClickStatu = false; return; } //鏄剧ず鍙互鍒囨崲閭->涓�涓彲浠ラ伄浣廈ody鐨勪笢瑗� - var frameTran = new FrameLayoutControl(); + var frameTran = new FrameLayoutStatuControl(); frameTran.UseClickStatu = false; frameTran.BackgroundColor = UserCenterColor.Current.Transparent; bodyFrameLayout.AddChidren(frameTran); @@ -120,13 +120,13 @@ frameTran.Visible = false; }; var frameList = new FrameLayout(); - frameList.X = ControlCommonResourse.XXLeft - Application.GetRealWidth(17); - frameList.Y = rowPhone.Bottom - ControlCommonResourse.BottomLineHeight - 1; - frameList.Width = Application.GetMinRealAverage(628); - frameList.Height = Application.GetMinRealAverage(176); + frameList.X = HdlControlResourse.XXLeft - Application.GetRealWidth(17); + frameList.Y = rowPhone.Bottom - HdlControlResourse.BottomLineHeight - 1; + frameList.Width = this.GetPictrueRealSize(628); + frameList.Height = this.GetPictrueRealSize(176); frameTran.AddChidren(frameList); //鍔ㄧ敾鐢� - var frameAnimate = new FrameLayoutControl(); + var frameAnimate = new FrameLayoutStatuControl(); frameAnimate.UseClickStatu = false; frameList.AddChidren(frameAnimate); @@ -134,10 +134,10 @@ btnPic.UnSelectedImagePath = "Item/ForgotPswList.png"; frameAnimate.AddChidren(btnPic); var btnEmail = new NormalViewControl(450, 58, true); - btnEmail.X = Application.GetMinRealAverage(46); - btnEmail.Y = Application.GetMinRealAverage(32); + btnEmail.X = this.GetPictrueRealSize(46); + btnEmail.Y = this.GetPictrueRealSize(32); btnEmail.TextColor = UserCenterColor.Current.TextGrayColor3; - btnEmail.Text = UserCenterResourse.UserInfo.Email; + btnEmail.Text = HdlUserCenterResourse.UserInfo.UserEmail; frameAnimate.AddChidren(btnEmail); frameAnimate.ButtonClickEvent += (sender, e) => { @@ -154,8 +154,6 @@ if (frameTran.Visible == false) { frameTran.Visible = true; - //鍔ㄧ敾鏁堟灉 - frameAnimate.Animate = Animate.UpToDown; } }; } @@ -168,18 +166,25 @@ /// 鍙戦�侀獙璇佺爜 /// </summary> /// <param name="btnCode"></param> - private async void SetVerificationCode(NormalViewControl btnCode) + private void SetVerificationCode(NormalViewControl btnCode) { - string account = this.strPhoneEmail.StartsWith("+") == true ? UserCenterResourse.UserInfo.Phone : UserCenterResourse.UserInfo.Email; - var sendCodePra = new SendCodePra(); - sendCodePra.Account = account; - sendCodePra.AreaCode = Convert.ToInt32(UserCenterResourse.UserInfo.AreaCode); - bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ForgetPassword", false, sendCodePra); - if (flage == false) + var errorMsg = string.Empty; + if (this.strPhoneEmail.StartsWith("+") == true) { + //鎵嬫満 + errorMsg = HdlAccountLogic.Current.SendVeriCodeToPhone(HdlUserCenterResourse.UserInfo.PhoneAreaCode, HdlUserCenterResourse.UserInfo.UserPhone, VerCodeType.A鍏朵粬); + } + else + { + //閭 + errorMsg = HdlAccountLogic.Current.SendVeriCodeToEmail(HdlUserCenterResourse.UserInfo.UserEmail, VerCodeType.A鍏朵粬); + } + if (errorMsg != null) + { + this.ShowMassage(ShowMsgType.Tip, errorMsg); return; } - + //鍙互寮�濮嬫牎楠岄獙璇佺爜浜� this.canCheckCode = true; //鎺т欢涓嶈兘鍐嶆鎸変笅 @@ -199,7 +204,7 @@ System.Threading.Thread.Sleep(1000); if (waitime == 0) { - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { if (btnCode != null) { @@ -212,13 +217,13 @@ }); break; } - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { if (btnCode != null) { btnCode.Text = waitime + "s" + repeat; } - }); + }, ShowErrorMode.NO); } }); } @@ -269,15 +274,11 @@ /// 楠岃瘉楠岃瘉鐮� /// </summary> /// <returns></returns> - private async void CheckVerificationCode(TextInputControl txtCode, string code) + private void CheckVerificationCode(TextInputControl txtCode, string code) { - string account = this.strPhoneEmail.StartsWith("+") == true ? UserCenterResourse.UserInfo.Phone : UserCenterResourse.UserInfo.Email; - var checkCodePra = new CheckCodePra(); - checkCodePra.Code = code; - checkCodePra.Account = account; - - bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ValidatorCode", false, checkCodePra); - if (flage == false) + string account = this.strPhoneEmail.StartsWith("+") == true ? HdlUserCenterResourse.UserInfo.UserPhone : HdlUserCenterResourse.UserInfo.UserEmail; + var result = HdlAccountLogic.Current.CheckVeriCode(account, VerCodeType.A鍏朵粬, code); + if (result == false) { //楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏� this.btnMsgControl.Visible = true; @@ -291,56 +292,6 @@ //鎸囧畾鏂板缓瀵嗙爜妯″紡 this.LoadFormMethodByName("EditorSecondaryPasswordForm", "SetNewPasswordFormMode"); this.LoadFormMethodByName("EditorGesturePasswordForm", "SetNewPasswordFormMode"); - } - - #endregion - - #region 鈻� 缁撴瀯浣揰____________________________ - - /// <summary> - /// 鍙戦�侀獙璇佺爜鐨勫惎鍔ㄥ弬鏁� - /// </summary> - private class SendCodePra - { - /// <summary> - /// 鐢ㄦ埛璐﹀彿 - /// </summary> - public string Account = UserCenterResourse.UserInfo.Phone; - /// <summary> - /// 鍏徃缂栧彿,鍥藉唴浣跨敤鎵嬫満鐭俊楠岃瘉鐮佹椂锛屾瀛楁濉叆0锛屽浗澶栨墜鏈虹煭淇¢獙璇佺爜锛屾瀛楁濉叆4 - /// </summary> - public int Company = Common.CommonPage.PhoneZoneStr == "86" ? 0 : 4; - /// <summary> - /// 璇█ - /// </summary> - public string Language = Shared.Language.CurrentLanguage; - /// <summary> - /// 鍥藉鍦板尯浠g爜锛屾墜鏈哄彿鍙戦�侀獙璇佺爜鏃朵娇鐢� - /// </summary> - public int AreaCode = 0; - } - - /// <summary> - /// 鍙戦�侀獙璇佺爜鐨勫惎鍔ㄥ弬鏁� - /// </summary> - private class CheckCodePra - { - /// <summary> - /// 鐢ㄦ埛璐﹀彿 - /// </summary> - public string Account = UserCenterResourse.UserInfo.Phone; - /// <summary> - /// 楠岃瘉鐮� - /// </summary> - public string Code = "0"; - /// <summary> - /// 璇█ - /// </summary> - public string Language = Shared.Language.CurrentLanguage; - /// <summary> - /// 鍥藉鍦板尯浠g爜锛屾墜鏈哄彿鍙戦�侀獙璇佺爜鏃朵娇鐢� - /// </summary> - public int AreaCode = Convert.ToInt32(UserCenterResourse.UserInfo.AreaCode); } #endregion -- Gitblit v1.8.0