From 0d9f64668fd7350d6a21fd157e32009a96d98134 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 16 十二月 2020 13:09:08 +0800 Subject: [PATCH] 新云端代码Ver1.2 --- ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs | 99 +++++++++++++------------------------------------ 1 files changed, 26 insertions(+), 73 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/ForgotSecondaryPasswordForm.cs index 6481e69..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 = 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(); @@ -95,15 +95,15 @@ //閿欒淇℃伅鎺т欢 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; @@ -120,8 +120,8 @@ frameTran.Visible = false; }; var frameList = new FrameLayout(); - frameList.X = ControlCommonResourse.XXLeft - Application.GetRealWidth(17); - frameList.Y = rowPhone.Bottom - ControlCommonResourse.BottomLineHeight - 1; + 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); @@ -137,7 +137,7 @@ 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) => { @@ -168,16 +168,23 @@ /// <param name="btnCode"></param> 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 = 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; //鎺т欢涓嶈兘鍐嶆鎸変笅 @@ -269,13 +276,9 @@ /// <returns></returns> 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 = 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; @@ -289,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