From fe3b2466c68b5db70d38e78039703add3b8b1dfe Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 31 十二月 2020 19:29:43 +0800 Subject: [PATCH] 合并了代码 --- ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs | 99 ++++++++++++++++++++++++++++++++++++------------- 1 files changed, 73 insertions(+), 26 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs index 12e0827..6481e69 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 = -HdlControlResourse.XXLeft; + rowPhone.RightOffset = -ControlCommonResourse.XXLeft; rowPhone.Y = Application.GetRealHeight(23); rowPhone.Width = this.GetPictrueRealSize(628); bodyFrameLayout.AddChidren(rowPhone); //璇疯緭鍏ラ偖绠辨垨鎵嬫満鍙� - 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); + 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); txtPhone.TextColor = UserCenterColor.Current.TextGrayColor2; //搴曠嚎 rowPhone.AddBottomLine(); @@ -95,15 +95,15 @@ //閿欒淇℃伅鎺т欢 btnMsgControl = new NormalViewControl(800, 58, true); - btnMsgControl.X = HdlControlResourse.XXLeft; + btnMsgControl.X = ControlCommonResourse.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(HdlUserCenterResourse.UserInfo.UserPhone) == true - || string.IsNullOrEmpty(HdlUserCenterResourse.UserInfo.UserEmail) == true) + if (string.IsNullOrEmpty(UserCenterResourse.UserInfo.Phone) == true + || string.IsNullOrEmpty(UserCenterResourse.UserInfo.Email) == true) { rowPhone.UseClickStatu = false; return; @@ -120,8 +120,8 @@ frameTran.Visible = false; }; var frameList = new FrameLayout(); - frameList.X = HdlControlResourse.XXLeft - Application.GetRealWidth(17); - frameList.Y = rowPhone.Bottom - HdlControlResourse.BottomLineHeight - 1; + frameList.X = ControlCommonResourse.XXLeft - Application.GetRealWidth(17); + frameList.Y = rowPhone.Bottom - ControlCommonResourse.BottomLineHeight - 1; frameList.Width = this.GetPictrueRealSize(628); frameList.Height = this.GetPictrueRealSize(176); frameTran.AddChidren(frameList); @@ -137,7 +137,7 @@ btnEmail.X = this.GetPictrueRealSize(46); btnEmail.Y = this.GetPictrueRealSize(32); btnEmail.TextColor = UserCenterColor.Current.TextGrayColor3; - btnEmail.Text = HdlUserCenterResourse.UserInfo.UserEmail; + btnEmail.Text = UserCenterResourse.UserInfo.Email; frameAnimate.AddChidren(btnEmail); frameAnimate.ButtonClickEvent += (sender, e) => { @@ -168,23 +168,16 @@ /// <param name="btnCode"></param> private void SetVerificationCode(NormalViewControl btnCode) { - var errorMsg = string.Empty; - if (this.strPhoneEmail.StartsWith("+") == true) + 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 = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ForgetPassword", false, sendCodePra); + if (flage == false) { - //鎵嬫満 - 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; //鎺т欢涓嶈兘鍐嶆鎸変笅 @@ -276,9 +269,13 @@ /// <returns></returns> private void CheckVerificationCode(TextInputControl txtCode, string code) { - string account = this.strPhoneEmail.StartsWith("+") == true ? HdlUserCenterResourse.UserInfo.UserPhone : HdlUserCenterResourse.UserInfo.UserEmail; - var result = HdlAccountLogic.Current.CheckVeriCode(account, VerCodeType.A鍏朵粬, code); - if (result == false) + string account = this.strPhoneEmail.StartsWith("+") == true ? UserCenterResourse.UserInfo.Phone : UserCenterResourse.UserInfo.Email; + var checkCodePra = new CheckCodePra(); + checkCodePra.Code = code; + checkCodePra.Account = account; + + bool flage = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ValidatorCode", false, checkCodePra); + if (flage == false) { //楠岃瘉鐮侀敊璇紝璇烽噸鏂拌緭鍏� this.btnMsgControl.Visible = true; @@ -295,5 +292,55 @@ } #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