From e2ffb5fce53119f5cb36e3b2466becbefa096842 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 20 十一月 2020 18:09:13 +0800 Subject: [PATCH] Revert "20201120" --- HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs | 155 +++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 117 insertions(+), 38 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs index bce0ff1..5744a72 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs @@ -2,6 +2,7 @@ using Shared; using HDL_ON.UI.CSS; using System.Threading; +using HDL_ON.DAL.Server; namespace HDL_ON.UI { @@ -34,17 +35,36 @@ Action<string> action; int titleId; + /// <summary> + /// 鎿嶄綔鐩爣绫诲瀷 1:閭锛�2:鎵嬫満 + /// </summary> + int optionType; + /// <summary> + /// 鍊掕鏃舵椂闂� + /// </summary> + int time = 0; public VerificationCodePage() { bodyView = this; } - - public void LoadPage(Action<string> act,int tId) + /// <summary> + /// + /// </summary> + /// <param name="act">鍥炴帀鍑芥暟</param> + /// <param name="tId">椤甸潰鏍囬</param> + /// <param name="ot">鎿嶄綔绫诲瀷1:閭锛�2:鎵嬫満</param> + /// <param name="time">鍊掕鏃舵椂闂�</param> + public void LoadPage(Action<string> act,int tId,int ot,int t) { action = act; titleId = tId; bodyView.BackgroundColor = CSS_Color.BackgroundColor; - new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView(); + optionType = ot; + time = t; + Action backAction = () => { + Application.HideSoftInput(); + }; + new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView(backAction); Button btnTip = new Button() { @@ -75,9 +95,10 @@ X = Application.GetRealWidth(24), Y = btnNum1.Bottom, Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(1), + Height = Application.GetRealHeight(2), BackgroundColor = CSS_Color.PromptingColor2, SelectedBackgroundColor = CSS_Color.MainColor, + IsSelected = true }; bodyView.AddChidren(btnNum1Line); @@ -361,6 +382,12 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); + btnNum1.Text = ""; + btnNum2.Text = ""; + btnNum3.Text = ""; + btnNum4.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 1: btnNum2Line.IsSelected = true; @@ -376,6 +403,11 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); + btnNum2.Text = ""; + btnNum3.Text = ""; + btnNum4.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 2: btnNum3Line.IsSelected = true; @@ -391,6 +423,10 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); + btnNum3.Text = ""; + btnNum4.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 3: btnNum4Line.IsSelected = true; @@ -406,6 +442,9 @@ btnNum4Line.Height = Application.GetRealHeight(2); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); + btnNum4.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 4: btnNum5Line.IsSelected = true; @@ -421,6 +460,8 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(2); btnNum6Line.Height = Application.GetRealHeight(1); + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 5: btnNum6Line.IsSelected = true; @@ -436,6 +477,7 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(2); + btnNum6.Text = ""; break; case 6: btnNum6.Text = etCode.Substring(5, 1); @@ -448,35 +490,17 @@ { act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait)); }); - var response = new DAL.Server.HttpServerRequest().ValidatorCode(MainPage.LoginUser.userEmailInfo, etCode, MainPage.LoginUser.areaCode); - if (response.StateCode.ToUpper() == "SUCCESS") + var verAccount = optionType == 1 ? MainPage.LoginUser.userEmailInfo : MainPage.LoginUser.userMobileInfo; + var isPhone = optionType == 2; + var resultObj = new HttpServerRequest().ValidatorCode(VerifyType.REGISTER_USER_SYSTEM, verAccount, etCode, isPhone); + if (resultObj.Code == StateCode.SUCCESS) { result = true; } else { - string erorrInfo = ""; - switch (response.StateCode) - { - case "ValidCodeAndPhoneNoEqual"://楠岃瘉鐮侀敊璇� - erorrInfo = Language.StringByID(StringId.VerificationCodeWrong); - break; - case "NoRecord": - erorrInfo = Language.StringByID(StringId.PlsGetTheVerificationCode); - break; - default: - erorrInfo = "Server error"; - break; - } - Application.RunOnMainThread(() => - { - new Tip() - { - CloseTime = 3, - Direction = AMPopTipDirection.None, - Text = erorrInfo, - }.Show(bodyView); - }); + //澶辫触鎻愮ず + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Check, resultObj.Code); } Application.RunOnMainThread(() => { @@ -484,11 +508,11 @@ }); if (result) { - Application.RunOnMainThread(() => - { - new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.ValidationSuccessful), true); - }); - Thread.Sleep(1600); + //Application.RunOnMainThread(() => + //{ + // new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.ValidationSuccessful), true); + //}); + //Thread.Sleep(1600); Application.RunOnMainThread(() => { MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); @@ -507,7 +531,7 @@ new Thread(() => { var result2 = new DAL.Server.HttpServerRequest().BindAccount(account); - if (result2 == "SUCCESS") + if (result2 == StateCode.SUCCESS) { Application.RunOnMainThread(() => { @@ -519,7 +543,6 @@ for (int i = 0; i < 2; i++) { MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); - //MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1); } action(account); }); @@ -530,7 +553,7 @@ { new Tip() { - CloseTime = 3, + CloseTime = 1, Direction = AMPopTipDirection.None, Text = Language.StringByID(StringId.OperationFailed), }.Show(bodyView); @@ -538,6 +561,44 @@ } }) { IsBackground = true }.Start(); + } + else if (titleId == StringId.UnbindPhone) + { + var account = ""; + new Thread(() => + { + var result2 = new DAL.Server.HttpServerRequest().BindAccount(account); + if (result2 == StateCode.SUCCESS) + { + Application.RunOnMainThread(() => + { + MainPage.LoginUser.userEmailInfo = account; + var page = new OperationResultDisPalyPage(); + page.Show(); + page.LoadPage(true, Language.StringByID(StringId.UnbindPhone), Language.StringByID(StringId.UnbindPhoneSuccess), ""); + + for (int i = 0; i < 2; i++) + { + MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); + } + action(account); + }); + } + else + { + Application.RunOnMainThread(() => + { + new Tip() + { + CloseTime = 1, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(StringId.OperationFailed), + }.Show(bodyView); + }); + } + }) + { IsBackground = true }.Start(); + } }); } @@ -554,7 +615,24 @@ void LoadThread_SendVerCode() { btnResend.IsSelected = false; - int time = 60; + et.Foucs = true; + if (time == 0) + { + time = 60; + new Thread(() => + { + if (optionType == 1) + { + var resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, MainPage.LoginUser.userEmailInfo); + + } + else if (optionType == 2) + { + var resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, MainPage.LoginUser.userMobileInfo, true, MainPage.LoginUser.areaCode.ToString()); + } + }) + { IsBackground = true }.Start(); + } new Thread(() => { while (time > 0) @@ -570,6 +648,7 @@ { btnResend.IsSelected = true; btnResend.TextID = StringId.GetVerificationCode; + time = 0; }); }) { IsBackground = true }.Start(); @@ -584,7 +663,7 @@ }; } /// <summary> - /// 璺宠浆缁戝畾璐﹀彿閭浜嬩欢 + /// 璺宠浆缁戝畾璐﹀彿淇℃伅浜嬩欢 /// </summary> void LoadEvent_SkipBindAccountInfoPage(int skipTid) { -- Gitblit v1.8.0