From e87985ec1dcb69beedaf9f95e8e7aba14b7c08d6 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 09 十二月 2020 18:50:14 +0800
Subject: [PATCH] 2020-12-09 1.信息中心,增加下划线和点击Alter提醒详情。
---
HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 203 ++++++++++++++++++++++++++++++++++++++------------
1 files changed, 154 insertions(+), 49 deletions(-)
diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
index 25fd27b..324c450 100644
--- a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
@@ -21,6 +21,7 @@
LoadEvent_Register();
LoadEvent_LimtPasswordLength();
LoadEvent_TextChange();
+ LoadEvent_Server();
//var areaCodeList = pm.GetAreaCode();
}
/// <summary>
@@ -68,7 +69,7 @@
//閫夋嫨鎵嬫満娉ㄥ唽
btnPhoneLogin.MouseUpEventHandler = (sender, e) =>
{
- if(registerType == 0)
+ if (registerType == 0)
{
return;
}
@@ -206,7 +207,7 @@
}
}
}
- if(accountType ==0)
+ if (accountType == 0)
{
registerPhone = etAccount.Text.Trim();
}
@@ -367,68 +368,96 @@
{
if ((sender as Button).IsSelected)
{
+ //鍒ゆ柇鏄惁閫夋嫨浜嗘湇鍔″櫒锛岄�夋嫨浜嗘墠鑳藉彂閫侀獙璇佺爜
+ if (CheckIfSelectServer() == false) return;
+
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();
@@ -490,7 +519,7 @@
{
btnRegister.MouseUpEventHandler = (sender, e) =>
{
- if(etPassword.Text.Trim().Length > 13 || etPassword.Text.Trim().Length<6)
+ if (etPassword.Text.Trim().Length > 13 || etPassword.Text.Trim().Length < 6)
{
new Tip()
{
@@ -502,6 +531,9 @@
}
if (btnRegister.IsSelected)
{
+ //鍒ゆ柇鏄惁閫夋嫨浜嗘湇鍔″櫒锛岄�夋嫨浜嗘墠鑳藉彂閫侀獙璇佺爜
+ if (CheckIfSelectServer() == false) return;
+
waitPage = new Loading();
new PublicAssmebly().LoadPage_WaitPage(LoadMethod_RegisterThread(), bodyView, waitPage);
}
@@ -589,5 +621,78 @@
}
});
}
+
+ /// <summary>
+ /// 鍔犺浇鏈嶅姟鍣ㄩ�夋嫨鎸夐挳浜嬩欢
+ /// </summary>
+ void LoadEvent_Server()
+ {
+ //鍒ゆ柇涔嬪墠鏄惁閫夋嫨杩�
+ if (UserInfo.Current.GlobalRegion != null && !string.IsNullOrEmpty(UserInfo.Current.GlobalRegion.regionUrl))
+ {
+
+ SetServerText();
+ }
+
+ EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+ {
+ Action selectAction = () =>
+ {
+ //鏈嶅姟鍣ㄩ�夋嫨杩囨爣璁颁负true
+ SetServerText();
+ };
+ new SelectServerDialog(selectAction).LoadPage();
+
+ };
+
+ btnServerGo.MouseUpEventHandler = eventHandler;
+ btnServerText.MouseUpEventHandler = eventHandler;
+ }
+
+ /// <summary>
+ /// 妫�娴嬫槸鍚﹂�夋嫨浜嗘湇鍔″櫒
+ /// </summary>
+ /// <returns></returns>
+ private bool CheckIfSelectServer()
+ {
+ if (isSelectServer == false)
+ {
+ //璇峰厛閫夋嫨鍥藉/鍖哄煙
+ Utlis.ShowTip(Language.StringByID(StringId.PleaseSelectCountryOrRegion));
+ ShowServerBottomLineState(true);
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// 鏈嶅姟鍣ㄤ笅鍒掔嚎鏍峰紡
+ /// </summary>
+ /// <param name="isError"></param>
+ void ShowServerBottomLineState(bool isError)
+ {
+ if (isError)
+ {
+ btnServerBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
+ btnServerBottomLine.Height = Application.GetRealHeight(2);
+ }
+ else
+ {
+ btnServerBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
+ btnServerBottomLine.Height = Application.GetRealHeight(1);
+ }
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ void SetServerText()
+ {
+ //鏈嶅姟鍣ㄩ�夋嫨杩囨爣璁颁负true
+ isSelectServer = true;
+ ShowServerBottomLineState(false);
+ btnServerText.TextColor = CSS_Color.FirstLevelTitleColor;
+ btnServerText.Text = UserInfo.Current.GlobalRegion.regionName;
+ }
}
}
\ No newline at end of file
--
Gitblit v1.8.0