From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3
---
ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs | 124 +++++++++++++----------------------------
1 files changed, 39 insertions(+), 85 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs
index 36ed38d..eb9aa90 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/MemberListForm.cs
@@ -111,7 +111,7 @@
btnUserIcon.Height = this.GetPictrueRealSize(207);
btnUserIcon.Width = this.GetPictrueRealSize(207);
btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2;
- btnUserIcon.ImagePath = UserCenterResourse.UserInfo.UserIconFile;
+ btnUserIcon.ImagePath = HdlFileNameResourse.UserHeadIconFile;
btnUserIcon.Y = Application.GetRealHeight(46);
btnUserIcon.Gravity = Gravity.CenterHorizontal;
frameBack.AddChidren(btnUserIcon);
@@ -121,7 +121,7 @@
btnName.TextAlignment = TextAlignment.Center;
btnName.Y = btnUserIcon.Bottom + Application.GetRealHeight(20);
btnName.TextSize = 16;
- btnName.Text = UserCenterResourse.UserInfo.UserName; ;
+ btnName.Text = HdlUserCenterResourse.UserInfo.NickName; ;
frameBack.AddChidren(btnName);
//韬唤
@@ -130,7 +130,7 @@
btnAuthority.Y = btnName.Bottom + Application.GetRealHeight(10);
btnAuthority.TextSize = 12;
btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor1;
- btnAuthority.Text = UserCenterResourse.UserInfo.AuthorityText;
+ btnAuthority.Text = HdlUserCenterResourse.ResidenceOption.AuthorityText;
frameBack.AddChidren(btnAuthority);
}
@@ -145,7 +145,7 @@
{
//鏍囬:鎴愬憳鍒楄〃
var btnMenberTile = new NormalViewControl(800, 60, true);
- btnMenberTile.X = ControlCommonResourse.XXLeft;
+ btnMenberTile.X = HdlControlResourse.XXLeft;
btnMenberTile.Y = Application.GetRealHeight(480);
btnMenberTile.TextColor = UserCenterColor.Current.TextColor1;
btnMenberTile.TextID = R.MyInternationalizationString.MenberList;
@@ -168,7 +168,7 @@
HdlThreadLogic.Current.RunThread(() =>
{
//鎬讳箣鍏堟竻绌哄叡浜枃浠跺す鍑嗘病閿�
- HdlShardLogic.Current.ClearShardDirectory();
+ HdlShardLogic.Current.Dispone();
//鍒濆鍖栨垚鍛樺垪琛�
this.InitMemberList();
});
@@ -182,23 +182,8 @@
//寮�鍚繘搴︽潯
this.ShowProgressBar();
- var pra = new MemberListInfoPra();
- string result = UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
- if (string.IsNullOrEmpty(result) == true)
- {
- //鍏抽棴杩涘害鏉�
- this.CloseProgressBar(ShowReLoadMode.YES);
- return;
- }
- if (this.Parent == null)
- {
- //鍏抽棴杩涘害鏉�
- this.CloseProgressBar();
- return;
- }
-
- List<MemberInfoRes> listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MemberInfoRes>>(result);
- if (listInfo == null)
+ var listShowInfo = HdlMemberLogic.Current.GetMemberListInfo();
+ if (listShowInfo == null)
{
//鍏抽棴杩涘害鏉�
this.CloseProgressBar(ShowReLoadMode.YES);
@@ -207,27 +192,6 @@
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
- List<string> listCheck = new List<string>();
- List<MemberInfoRes> listShowInfo = new List<MemberInfoRes>();
- foreach (MemberInfoRes infoRes in listInfo)
- {
- if (listCheck.Contains(infoRes.DistributedMark) == true
- || infoRes.Account == UserCenterResourse.UserInfo.Phone
- || infoRes.Account == UserCenterResourse.UserInfo.Email)
- {
- //濡傛灉鏄畠鑷繁鐨勮瘽锛屼笉鏄剧ず
- continue;
- }
- if (UserCenterResourse.UserInfo.AuthorityNo != 1 && infoRes.AccountType != 0)
- {
- //涓嶈兘澶熻幏鍙栨潈闄愮瓑绾ф瘮浠栭珮鐨�(涓讳汉鑷繁鍙互鏃犺杩欎釜鍒ゆ柇)
- continue;
- }
-
- listCheck.Add(infoRes.DistributedMark);
- //娣诲姞鎴愬憳淇℃伅鐨勭紦瀛�
- listShowInfo.Add(infoRes);
- }
if (listShowInfo.Count == 0)
{
return;
@@ -278,9 +242,9 @@
listView.AddChidren(rowlayout);
//鎴愬憳澶村儚鍥炬爣
- string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, info.DistributedMark + ".png");
+ string iconPath = System.IO.Path.Combine(HdlFileNameResourse.UserPictrueDirectory, info.ChildAccountId + ".png");
var btnIcon = new ImageView();
- btnIcon.X = ControlCommonResourse.XXLeft;
+ btnIcon.X = HdlControlResourse.XXLeft;
btnIcon.Gravity = Gravity.CenterVertical;
btnIcon.Height = this.GetPictrueRealSize(115);
btnIcon.Width = this.GetPictrueRealSize(115);
@@ -292,15 +256,15 @@
else
{
btnIcon.ImagePath = "Center/Admin.png";
- this.dicIconControl[info.DistributedMark] = btnIcon;
- this.dicMemberAccount[info.DistributedMark] = info.Account;
+ this.dicIconControl[info.ChildAccountId] = btnIcon;
+ this.dicMemberAccount[info.ChildAccountId] = info.Account;
}
rowlayout.AddChidren(btnIcon);
//鎴愬憳鏄电О
- string memberName = string.IsNullOrEmpty(info.UserName) == true ? info.Account : info.UserName;
+ string memberName = info.ShowName;
var btnName = rowlayout.AddLeftCaption(memberName, 600, true);
- btnName.X = ControlCommonResourse.XXLeft + btnIcon.Height + Application.GetRealWidth(35);
+ btnName.X = HdlControlResourse.XXLeft + btnIcon.Height + Application.GetRealWidth(35);
btnName.TextSize = 15;
rowlayout.AddChidren(btnName);
@@ -350,30 +314,18 @@
}
HdlThreadLogic.Current.RunThread(() =>
{
- var pra = new AccountInfoPra();
foreach (var keys in dicMemberAccount.Keys)
{
if (this.Parent == null)
{
return;
}
- pra.Account = dicMemberAccount[keys];
- var result = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra);
- if (result == null)
- {
- continue;
- }
- var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResponsePack>(System.Text.Encoding.UTF8.GetString(result));
- if (revertObj == null || revertObj.ResponseData == null)
- {
- continue;
- }
- var infoResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountInfoResult>(revertObj.ResponseData.ToString());
- if (infoResult.HeadImage != null)
+ var imageData = HdlAccountLogic.Current.DownLoadAccountPictrue(dicMemberAccount[keys]);
+ if (imageData != null && imageData.Length > 0)
{
//鍐欏叆澶村儚鍐呭
- string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, keys + ".png");
- Shared.IO.FileUtils.WriteFileByBytes(iconPath, infoResult.HeadImage);
+ string iconPath = System.IO.Path.Combine(HdlFileNameResourse.UserPictrueDirectory, keys + ".png");
+ Shared.IO.FileUtils.WriteFileByBytes(iconPath, imageData);
HdlThreadLogic.Current.RunMain(() =>
{
dicIconControl[keys].ImageBytes = Shared.IO.FileUtils.ReadFile(iconPath);
@@ -422,30 +374,32 @@
/// <param name="txtMsg">淇℃伅鎺т欢</param>
private void SearchMemberInfo(string accountId)
{
- var pra = new AccountInfoPra();
- pra.Account = accountId;
- var byteData = UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string>() { "AccountNoExists" });
- if (byteData == null)
- {
- //寮傚父
- return;
- }
- var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResponsePack>(System.Text.Encoding.UTF8.GetString(byteData));
- if (revertObj.StateCode == "AccountNoExists")
- {
- //鎴愬憳涓嶅瓨鍦�
- var form = new MemberNotEsixtForm();
- form.AddForm();
- return;
- }
+ //寮�鍚繘搴︽潯
+ this.ShowProgressBar();
- var infoResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountInfoResult>(revertObj.ResponseData.ToString());
- infoResult.Account = accountId;
+ var result = HdlMemberLogic.Current.SearchNormalInfoByAccount(accountId);
+ //鍏抽棴杩涘害鏉�
+ this.CloseProgressBar();
+
+ if (result == null)
+ {
+ return;
+ }
+ if (result.Account == string.Empty)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鎴愬憳涓嶅瓨鍦�
+ var form = new MemberNotEsixtForm();
+ form.AddForm(Language.StringByID(R.MyInternationalizationString.uMemberInformation));
+ });
+ return;
+ }
HdlThreadLogic.Current.RunMain(() =>
{
var form = new AddMemberInfoForm();
- form.AddForm(infoResult);
+ form.AddForm(result);
});
}
@@ -459,7 +413,7 @@
public override int FormActionAgainEvent()
{
//娓呯┖鍏变韩鏂囦欢澶�
- HdlShardLogic.Current.ClearShardDirectory();
+ HdlShardLogic.Current.Dispone();
return 1;
}
--
Gitblit v1.8.0