From f788a1e320b8505435ed66e2456ddb2d0a838f76 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 19 十一月 2020 19:58:14 +0800 Subject: [PATCH] 2020-11-19 1.优化绑定和解绑页面。2.修改密码功能实现,UI界面实现,接口实现。 --- HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 128 ++++++++++++++++++++++++++++++++---------- 1 files changed, 97 insertions(+), 31 deletions(-) diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs index 06d12ec..68776ba 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs @@ -369,49 +369,115 @@ { if ((sender as Button).IsSelected) { - (sender as Button).IsSelected = false; string account = etAccount.Text.Trim(); - //鐭俊鍙戦�侀棿闅�60s int time = 60; new Thread(() => { - while (time > 0) + //1.鍏堟鏌ヨ处鍙锋槸鍚︽敞鍐岃繃 + var result = pm.GetRegionByAccount(account); + //2.璐﹀彿涓嶅瓨鍦紝鎵嶅厑璁哥户缁敞鍐� + if (result.Code == StateCode.ACCOUNT_NOT_EXIST) { - time--; + //璐﹀彿涓嶅瓨鍦� 鏈敞鍐屽厑璁稿彂閫侀獙璇佺爜娉ㄥ唽 Application.RunOnMainThread(() => { - (sender as Button).Text = time.ToString() + "s"; + //鐭俊鍙戦�侀棿闅�60s + (sender as Button).IsSelected = false; + }); - Thread.Sleep(1000); - } - Application.RunOnMainThread(() => - { - //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢 - (sender as Button).IsSelected = true; - (sender as Button).TextID = StringId.GetVerificationCode; - }); - }) - { IsBackground = true }.Start(); - new Thread(() => - { - ResponsePackNew resultObj; - // 鑾峰彇楠岃瘉鐮� - if (registerType == 1)//閭 - { - resultObj = pm.VerificationCodeSend(VerifyType.REGISTER, account); - } - else - { - resultObj = pm.VerificationCodeSend(VerifyType.REGISTER, account, true, phoneZoneCode); - } + //2.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(); - if (resultObj.Code != HttpUtil.SUCCESS_CODE) + //2.2 鑾峰彇楠岃瘉鐮� + ResponsePackNew resultObj; + if (registerType == 1)//閭 + { + 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(NewAPI.API_POST_Verification_Send, resultObj.Code); + } + + }else if (result.Code.ToUpper() == StateCode.SUCCESS) { - // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); + //3.鎻愮ず璐﹀彿宸插瓨鍦紝鏃犳硶閲嶅娉ㄥ唽 + Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse)); + } else + { + //4.鎻愮ず鍏跺畠寮傚父閿欒 + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); } }) { IsBackground = true }.Start(); + + //(sender as Button).IsSelected = false; + //string account = etAccount.Text.Trim(); + ////鐭俊鍙戦�侀棿闅�60s + //int time = 60; + //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(); + //new Thread(() => + //{ + // ResponsePackNew resultObj; + // // 鑾峰彇楠岃瘉鐮� + // if (registerType == 1)//閭 + // { + // resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account); + // } + // else + // { + // resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode); + // } + + // if (resultObj.Code != StateCode.SUCCESS_CODE) + // { + // // 鎻愮ず閿欒 + // IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); + // } + //}) + //{ IsBackground = true }.Start(); } }; @@ -460,7 +526,7 @@ //鏍¢獙楠岃瘉鐮佸苟娉ㄥ唽璐﹀彿 var isPhone = registerType == 0; var validateSmsResult = pm.ValidataCodeAndRegister(account, password, verCode, isPhone); - if (validateSmsResult.Code == HttpUtil.SUCCESS_CODE) + if (validateSmsResult.Code == StateCode.SUCCESS) { //娉ㄥ唽鎴愬姛 //鎵ц鍥炶皟浜嬩欢 -- Gitblit v1.8.0