From 273bd8b4fb918a4303207215b2b8369fbc275000 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 08 十二月 2020 18:58:44 +0800 Subject: [PATCH] Merge branch 'CJL-NEW' --- HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 117 +++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 70 insertions(+), 47 deletions(-) diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs index b6dc594..324c450 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs @@ -373,68 +373,91 @@ string account = etAccount.Text.Trim(); int time = 60; + //鍔犺浇Loading鏁堟灉 + var waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + new Thread(() => { - //1.鍏堟鏌ヨ处鍙锋槸鍚︽敞鍐岃繃 - var result = pm.GetRegionByAccount(account); - //2.璐﹀彿涓嶅瓨鍦紝鎵嶅厑璁哥户缁敞鍐� - if (result.Code == StateCode.ACCOUNT_NOT_EXIST) + try { - //璐﹀彿涓嶅瓨鍦� 鏈敞鍐屽厑璁稿彂閫侀獙璇佺爜娉ㄥ唽 - Application.RunOnMainThread(() => + //1.鍏堟鏌ヨ处鍙锋槸鍚︽敞鍐岃繃 + var result = pm.GetRegionByAccount(account); + //2.璐﹀彿涓嶅瓨鍦紝鎵嶅厑璁哥户缁敞鍐� + if (result.Code == StateCode.ACCOUNT_NOT_EXIST) { - //鐭俊鍙戦�侀棿闅�60s - (sender as Button).IsSelected = false; + //璐﹀彿涓嶅瓨鍦� 鏈敞鍐屽厑璁稿彂閫侀獙璇佺爜娉ㄥ唽 - }); - //2.1 寮�濮嬪�掕鏃� - new Thread(() => - { - while (time > 0) + //2.2 鑾峰彇楠岃瘉鐮� + ResponsePackNew resultObj; + if (registerType == 1)//閭 { - time--; + resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account); + } + else + { + resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode); + } + + if (resultObj.Code != StateCode.SUCCESS) + { + // 鎻愮ず閿欒 + IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); + } + else + { + //2.1 寮�濮嬪�掕鏃� Application.RunOnMainThread(() => { - (sender as Button).Text = time.ToString() + "s"; - }); - Thread.Sleep(1000); - } - Application.RunOnMainThread(() => - { - //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢 - (sender as Button).IsSelected = true; - (sender as Button).TextID = StringId.GetVerificationCode; - }); - }) - { IsBackground = true }.Start(); + //鐭俊鍙戦�侀棿闅�60s + (sender as Button).IsSelected = false; - //2.2 鑾峰彇楠岃瘉鐮� - ResponsePackNew resultObj; - if (registerType == 1)//閭 + }); + new Thread(() => + { + while (time > 0) + { + time--; + Application.RunOnMainThread(() => + { + (sender as Button).Text = time.ToString() + "s"; + }); + Thread.Sleep(1000); + } + Application.RunOnMainThread(() => + { + //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢 + (sender as Button).IsSelected = true; + (sender as Button).TextID = StringId.GetVerificationCode; + }); + }) + { IsBackground = true }.Start(); + } + + } + else if (result.Code.ToUpper() == StateCode.SUCCESS) { - resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account); + //3.鎻愮ず璐﹀彿宸插瓨鍦紝鏃犳硶閲嶅娉ㄥ唽 + Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse)); } else { - resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode); + //4.鎻愮ず鍏跺畠寮傚父閿欒 + IMessageCommon.Current.ShowErrorInfoAlter(result.Code); } - - if (resultObj.Code != StateCode.SUCCESS) + } + catch { } + finally + { + Application.RunOnMainThread(() => { - // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); - } - - } - else if (result.Code.ToUpper() == StateCode.SUCCESS) - { - //3.鎻愮ず璐﹀彿宸插瓨鍦紝鏃犳硶閲嶅娉ㄥ唽 - Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse)); - } - else - { - //4.鎻愮ず鍏跺畠寮傚父閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(result.Code); + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + }); } }) { IsBackground = true }.Start(); -- Gitblit v1.8.0