From 017af840d60fd6a56da9711308bf8239cb7fc1e6 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 13 十一月 2020 11:01:01 +0800 Subject: [PATCH] 2020-11-13 1.部分接口替换备份 --- HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs | 116 ++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 68 insertions(+), 48 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs index f007f98..44aaebd 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 { @@ -38,19 +39,32 @@ /// 鎿嶄綔鐩爣绫诲瀷 1:閭锛�2:鎵嬫満 /// </summary> int optionType; - + /// <summary> + /// 鍊掕鏃舵椂闂� + /// </summary> + int time = 0; public VerificationCodePage() { bodyView = this; } - - public void LoadPage(Action<string> act,int tId,int ot) + /// <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; optionType = ot; - new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView(); + time = t; + Action backAction = () => { + Application.HideSoftInput(); + }; + new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView(backAction); Button btnTip = new Button() { @@ -368,12 +382,12 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum1Line.Text = ""; - btnNum2Line.Text = ""; - btnNum3Line.Text = ""; - btnNum4Line.Text = ""; - btnNum5Line.Text = ""; - btnNum6Line.Text = ""; + btnNum1.Text = ""; + btnNum2.Text = ""; + btnNum3.Text = ""; + btnNum4.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 1: btnNum2Line.IsSelected = true; @@ -389,11 +403,11 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum2Line.Text = ""; - btnNum3Line.Text = ""; - btnNum4Line.Text = ""; - btnNum5Line.Text = ""; - btnNum6Line.Text = ""; + btnNum2.Text = ""; + btnNum3.Text = ""; + btnNum4.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 2: btnNum3Line.IsSelected = true; @@ -409,10 +423,10 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum3Line.Text = ""; - btnNum4Line.Text = ""; - btnNum5Line.Text = ""; - btnNum6Line.Text = ""; + btnNum3.Text = ""; + btnNum4.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 3: btnNum4Line.IsSelected = true; @@ -428,9 +442,9 @@ btnNum4Line.Height = Application.GetRealHeight(2); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum4Line.Text = ""; - btnNum5Line.Text = ""; - btnNum6Line.Text = ""; + btnNum4.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 4: btnNum5Line.IsSelected = true; @@ -446,8 +460,8 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(2); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum5Line.Text = ""; - btnNum6Line.Text = ""; + btnNum5.Text = ""; + btnNum6.Text = ""; break; case 5: btnNum6Line.IsSelected = true; @@ -463,7 +477,7 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(2); - btnNum6Line.Text = ""; + btnNum6.Text = ""; break; case 6: btnNum6.Text = etCode.Substring(5, 1); @@ -476,8 +490,9 @@ { 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 response = new HttpServerRequest().ValidatorCode(verAccount, etCode, MainPage.LoginUser.areaCode); + if (response.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE) { result = true; } @@ -500,7 +515,7 @@ { new Tip() { - CloseTime = 3, + CloseTime = 1, Direction = AMPopTipDirection.None, Text = erorrInfo, }.Show(bodyView); @@ -512,11 +527,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(); @@ -535,7 +550,7 @@ new Thread(() => { var result2 = new DAL.Server.HttpServerRequest().BindAccount(account); - if (result2 == "SUCCESS") + if (result2 == HttpUtil.SUCCESS_CODE) { Application.RunOnMainThread(() => { @@ -557,7 +572,7 @@ { new Tip() { - CloseTime = 3, + CloseTime = 1, Direction = AMPopTipDirection.None, Text = Language.StringByID(StringId.OperationFailed), }.Show(bodyView); @@ -572,7 +587,7 @@ new Thread(() => { var result2 = new DAL.Server.HttpServerRequest().BindAccount(account); - if (result2 == "SUCCESS") + if (result2 == HttpUtil.SUCCESS_CODE) { Application.RunOnMainThread(() => { @@ -594,7 +609,7 @@ { new Tip() { - CloseTime = 3, + CloseTime = 1, Direction = AMPopTipDirection.None, Text = Language.StringByID(StringId.OperationFailed), }.Show(bodyView); @@ -619,19 +634,23 @@ void LoadThread_SendVerCode() { btnResend.IsSelected = false; - int time = 60; - new Thread(() => + et.Foucs = true; + if (time == 0) { - if (optionType == 1) + time = 60; + new Thread(() => { - var result = new DAL.Server.HttpServerRequest().GetLoginVerCode(MainPage.LoginUser.userEmailInfo); - } - else if (optionType == 2) - { - var result = new DAL.Server.HttpServerRequest().GetLoginVerCode(MainPage.LoginUser.userMobileInfo); - } - }) - { IsBackground = true }.Start(); + if (optionType == 1) + { + var result = new DAL.Server.HttpServerRequest().GetLoginVerCode(MainPage.LoginUser.userEmailInfo); + } + else if (optionType == 2) + { + var result = new DAL.Server.HttpServerRequest().GetLoginVerCode(MainPage.LoginUser.userMobileInfo); + } + }) + { IsBackground = true }.Start(); + } new Thread(() => { while (time > 0) @@ -647,6 +666,7 @@ { btnResend.IsSelected = true; btnResend.TextID = StringId.GetVerificationCode; + time = 0; }); }) { IsBackground = true }.Start(); -- Gitblit v1.8.0