| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Shared.Phone.UserCenter.Member
|
| | | {
|
| | | /// <summary>
|
| | |
| | | bodyFrameLayout.AddChidren(frame);
|
| | |
|
| | | //用户图标
|
| | | var btnUserIcon = new PicViewControl(207, 207);
|
| | | string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.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;
|
| | | if (System.IO.File.Exists(iconPath) == true)
|
| | | {
|
| | | btnUserIcon.ImagePath = iconPath;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnUserIcon.ImagePath = "Center/Admin.png";
|
| | | }
|
| | | btnUserIcon.Y = Application.GetRealHeight(45);
|
| | | btnUserIcon.Gravity = Gravity.CenterHorizontal;
|
| | | btnUserIcon.UnSelectedImagePath = "Center/Admin.png";
|
| | | frame.AddChidren(btnUserIcon);
|
| | | //获取成员头像
|
| | | this.GetMemberIcon(btnUserIcon);
|
| | |
|
| | | //权限
|
| | | btnAuthority = new NormalViewControl(800, 50, true);
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 获取成员头像_______________________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取成员头像
|
| | | /// </summary>
|
| | | private void GetMemberIcon(ImageView btnUserIcon)
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | var pra = new AccountInfoPra();
|
| | | pra.Account = memberInfo.Account;
|
| | | var result = await UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string>() { "NotSetAgain" });
|
| | | if (result == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResponsePack>(System.Text.Encoding.UTF8.GetString(result));
|
| | | if (revertObj == null || revertObj.ResponseData == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var infoResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountInfoResult>(revertObj.ResponseData.ToString());
|
| | | if (infoResult.HeadImage != null)
|
| | | {
|
| | | //写入头像内容
|
| | | string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.UserPictruePath, memberInfo.DistributedMark + ".png");
|
| | | Shared.IO.FileUtils.WriteFileByBytes(iconPath, infoResult.HeadImage);
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | btnUserIcon.ImagePath = iconPath;
|
| | | });
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 结构体_____________________________
|
| | |
|
| | | /// <summary>
|