From 544c4f40fe66dd03d8e014a3a0ff74c2801e9abc Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 08 六月 2020 15:22:10 +0800
Subject: [PATCH] 2020-06-08-2
---
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs | 99 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 99 insertions(+), 0 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
index 0820be1..f88fa3e 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
@@ -12,6 +12,8 @@
{
LoadEvent_ChangeHeadImageView();
LoadEvent_Logout();
+ LoadEvent_EditUserName();
+ LoadEvent_SkipInterpretationSettings();
}
/// <summary>
@@ -97,6 +99,103 @@
};
}
+ /// <summary>
+ /// 鍔犺浇淇敼鐢ㄦ埛鍚嶇О浜嬩欢
+ /// </summary>
+ void LoadEvent_EditUserName()
+ {
+ EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+ {
+ Action<string> callBack = (str) =>
+ {
+ if (string.IsNullOrEmpty(str))
+ {
+ new Tip()
+ {
+ CloseTime = 3,
+ Text = Language.StringByID(StringId.UesrNameCannotBeEmpty),
+ Direction = AMPopTipDirection.None,
+ }.Show(bodyView);
+ return;
+ }
+ var waitPage = new Loading();
+ waitPage.Start(Language.StringByID(StringId.PleaseWait));
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ var responsePack = new DAL.Server.HttpServerRequest().EditUserName(str);
+ if (responsePack.StateCode.ToUpper() == "SUCCESS")
+ {
+ MainPage.LoginUser.userName = str;
+ MainPage.LoginUser.SaveUserInfo();
+ Application.RunOnMainThread(() =>
+ {
+ btnUserName.Text = str;
+ updataUserName();
+ });
+ }
+ else
+ {
+ var tipStr = "Server erorr";
+ switch (responsePack.StateCode)
+ {
+ case "NoLogin":
+ tipStr = Language.StringByID(StringId.InvalidLoginCertificate);
+ break;
+ case "AccountNoExists":
+ tipStr = "";
+ break;
+ }
+ Application.RunOnMainThread(() =>
+ {
+ //鎻愮ず鍘熷洜
+ var tip = new Tip()
+ {
+ Text = tipStr,
+ CloseTime = 3,
+ Direction = AMPopTipDirection.None
+ };
+ tip.Show(bodyView);
+ });
+ }
+ }catch (Exception ex)
+ {
+ MainPage.Log($"update user name error : {ex.Message}");
+ }
+ finally
+ {
+ Application.RunOnMainThread(() => {
+ waitPage.Hide();
+ });
+ }
+ })
+ { IsBackground = true }.Start();
+ };
+ // new PublicAssmebly().LoadDialog_EditParater(StringId.UesrName, MainPage.LoginUser.userName, callBack);
+ };
+ btnUserName.MouseUpEventHandler = eventHandler;
+ btnEditUserNameIcon.MouseUpEventHandler = eventHandler;
+ }
+
+
+ #region 瑙i攣璁剧疆鍖哄煙
+ void LoadEvent_SkipInterpretationSettings()
+ {
+ EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+ {
+ var page = new AppUnlockSettingsPage();
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ };
+
+ btnInterpretationSettingsRight.MouseUpEventHandler = eventHandler;
+ btnInterpretationSettingsTitle.MouseUpEventHandler = eventHandler;
+ btnInterpretationSettingsTip.MouseUpEventHandler = eventHandler;
+ }
+
+ #endregion
}
}
--
Gitblit v1.8.0