From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs | 116 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
index 382f98c..9ffe23b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberManagementForm.cs
@@ -114,11 +114,11 @@
bodyFrameLayout.AddChidren(frame);
//鐢ㄦ埛鍥炬爣
- string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.UserPictruePath, memberInfo.DistributedMark + ".png");
+ string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, memberInfo.DistributedMark + ".png");
var btnUserIcon = new ImageView();
- btnUserIcon.Height = Application.GetMinRealAverage(207);
- btnUserIcon.Width = Application.GetMinRealAverage(207);
- btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2;
+ btnUserIcon.Height = this.GetPictrueRealSize(207);
+ btnUserIcon.Width = this.GetPictrueRealSize(207);
+ btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2;
if (System.IO.File.Exists(iconPath) == true)
{
btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(iconPath);
@@ -219,7 +219,10 @@
this.ShowMassage(ShowMsgType.Confirm, msg, () =>
{
//鍒犻櫎瀛愯处鍙�
- this.DeleteSubAccount();
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ this.DeleteSubAccount();
+ });
});
};
}
@@ -251,7 +254,8 @@
}
btnSwitch.ButtonClickEvent += (sender, e) =>
{
- HdlThreadLogic.Current.RunThread(async () =>
+ btnSwitch.CanClick = false;
+ HdlThreadLogic.Current.RunThread(() =>
{
var pra = new
{
@@ -261,7 +265,7 @@
};
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
- var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ChangeSubAccountIsAllowRemoteCtrl", false, pra);
+ var result = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ChangeSubAccountIsAllowRemoteCtrl", false, pra);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
@@ -271,8 +275,9 @@
}
this.memberInfo.IsAllowRemoteCtrl = !btnSwitch.IsSelected;
- Application.RunOnMainThread(() =>
+ HdlThreadLogic.Current.RunMain(() =>
{
+ btnSwitch.CanClick = true;
btnSwitch.IsSelected = !btnSwitch.IsSelected;
});
});
@@ -319,46 +324,49 @@
/// <summary>
/// 鍗囩骇鎴栬�呴檷绾у瓙璐﹀彿
/// </summary>
- public async void UpOrDownSubAccountLevel()
+ public void UpOrDownSubAccountLevel()
{
- //寮�鍚繘搴︽潯
- this.ShowProgressBar();
-
- var pra = new UpOrDownLevelPra();
- pra.DistributedMark = memberInfo.DistributedMark;
-
- bool result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpSubAccount", false, pra);
- if (result == false)
+ HdlThreadLogic.Current.RunThread(() =>
{
- this.CloseProgressBar();
- return;
- }
- this.CloseProgressBar();
+ //寮�鍚繘搴︽潯
+ this.ShowProgressBar();
- //鍙樻洿鏉冮檺
- memberInfo.AccountType = memberInfo.AccountType == 1 ? 0 : 1;
+ var pra = new UpOrDownLevelPra();
+ pra.DistributedMark = memberInfo.DistributedMark;
- Application.RunOnMainThread(() =>
- {
- if (this.Parent == null)
+ bool result = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpSubAccount", false, pra);
+ if (result == false)
{
+ this.CloseProgressBar();
return;
}
- //鍙樻洿鏉冮檺鍥炬爣
- if (memberInfo.AccountType == 1)
- {
- btnTopIcon.UnSelectedImagePath = "Item/HadAuthority.png";
- }
- else
- {
- btnTopIcon.UnSelectedImagePath = "Item/NotAuthority.png";
- }
- //鍙樻洿鏉冮檺鏂囧瓧
- btnAuthority.TextID = memberInfo.AccountType == 1 ? R.MyInternationalizationString.uMemberHadActionAuthority : R.MyInternationalizationString.uMember;
+ this.CloseProgressBar();
- //鎵撳紑鏄剧ず鎴愬姛鐨勭敾闈�
- var form = new SubAccountLevelUpSuccessForm();
- form.AddForm(memberInfo);
+ //鍙樻洿鏉冮檺
+ memberInfo.AccountType = memberInfo.AccountType == 1 ? 0 : 1;
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ if (this.Parent == null)
+ {
+ return;
+ }
+ //鍙樻洿鏉冮檺鍥炬爣
+ if (memberInfo.AccountType == 1)
+ {
+ btnTopIcon.UnSelectedImagePath = "Item/HadAuthority.png";
+ }
+ else
+ {
+ btnTopIcon.UnSelectedImagePath = "Item/NotAuthority.png";
+ }
+ //鍙樻洿鏉冮檺鏂囧瓧
+ btnAuthority.TextID = memberInfo.AccountType == 1 ? R.MyInternationalizationString.uMemberHadActionAuthority : R.MyInternationalizationString.uMember;
+
+ //鎵撳紑鏄剧ず鎴愬姛鐨勭敾闈�
+ var form = new SubAccountLevelUpSuccessForm();
+ form.AddForm(memberInfo);
+ });
});
}
@@ -369,7 +377,7 @@
/// <summary>
/// 鍒犻櫎瀛愯处鍙�
/// </summary>
- private async void DeleteSubAccount()
+ private void DeleteSubAccount()
{
//寮�鍚繘搴︽潯
this.ShowProgressBar();
@@ -377,7 +385,7 @@
var pra = new DeleteSubAccountPra();
pra.SubAccount = memberInfo.SubAccountDistributedMark;
- bool result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/DeletedSubAccount", false, pra);
+ bool result = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/DeletedSubAccount", false, pra);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
@@ -386,21 +394,13 @@
return;
}
- //绉婚櫎缂撳瓨
- UserCenterResourse.ListMemberInfo.RemoveAll((obj) =>
+ HdlThreadLogic.Current.RunMain(() =>
{
- if (obj.SubAccountDistributedMark == memberInfo.SubAccountDistributedMark)
- {
- return true;
- }
- return false;
+ //浠庢垚鍛樹竴瑙堢敾闈㈢Щ闄�
+ this.LoadFormMethodByName("MemberListForm", "DeleteRowByAccount", memberInfo.Account);
+ //鑷韩鍏抽棴
+ this.CloseForm();
});
- UserCenterLogic.SaveLocalMemberListInfo();
-
- //浠庢垚鍛樹竴瑙堢敾闈㈢Щ闄�
- this.LoadFormMethodByName("MemberListForm", "DeleteRowByAccount", memberInfo.Account);
- //鑷韩鍏抽棴
- this.CloseForm();
}
#endregion
@@ -412,11 +412,11 @@
/// </summary>
private void GetMemberIcon(ImageView btnUserIcon)
{
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
var pra = new AccountInfoPra();
pra.Account = memberInfo.Account;
- var result = await UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string>() { "NotSetAgain" });
+ var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string> { "NotCheck" }, false);
if (result == null)
{
return;
@@ -430,7 +430,7 @@
if (infoResult.HeadImage != null)
{
//鍐欏叆澶村儚鍐呭
- string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.UserPictruePath, memberInfo.DistributedMark + ".png");
+ string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, memberInfo.DistributedMark + ".png");
Shared.IO.FileUtils.WriteFileByBytes(iconPath, infoResult.HeadImage);
HdlThreadLogic.Current.RunMain(() =>
{
--
Gitblit v1.8.0