| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Shared.Phone.UserCenter.Member
|
| | | {
|
| | | /// <summary>
|
| | |
| | | btnTopIcon.InitControl();
|
| | | btnTopIcon.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //确定取消「{0}」管理员权限?
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uDownSubAccountLevel);
|
| | | if (memberInfo.AccountType != 1)
|
| | | {
|
| | | //确定授权「{0}」成为管理员?
|
| | | msg = Language.StringByID(R.MyInternationalizationString.uUpSubAccountLevel);
|
| | | if (msg.Contains("{0}") == true)
|
| | | {
|
| | | msg = string.Format(msg, string.IsNullOrEmpty(memberInfo.UserName) == true ? memberInfo.Account : memberInfo.UserName);
|
| | | }
|
| | | }
|
| | | msg = msg.Replace("{0}", string.IsNullOrEmpty(memberInfo.UserName) == true ? memberInfo.Account : memberInfo.UserName);
|
| | |
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | {
|
| | | //二次安全验证,如果没有设置有,直接跳过验证
|
| | |
| | | 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.ImageBytes = Shared.IO.FileUtils.ReadFile(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);
|
| | |
| | | var memberShardInfo = new MemberShardInfoData();
|
| | | row.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new SharedContent.SearchConfigureSharedListRoomForm();
|
| | | var form = new SharedContent.LookSharedListRoomForm();
|
| | | form.AddForm(memberInfo, memberShardInfo);
|
| | | };
|
| | | }
|
| | |
| | | btnAuthority.TextID = memberInfo.AccountType == 1 ? R.MyInternationalizationString.uMemberHadActionAuthority : R.MyInternationalizationString.uMember;
|
| | |
|
| | | //打开显示成功的画面
|
| | | if (memberInfo.AccountType == 1)
|
| | | {
|
| | | var form = new SubAccountLevelUpSuccessForm();
|
| | | form.AddForm(memberInfo);
|
| | | }
|
| | | var form = new SubAccountLevelUpSuccessForm();
|
| | | form.AddForm(memberInfo);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | |
|
| | | #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.ImageBytes = Shared.IO.FileUtils.ReadFile(iconPath);
|
| | | });
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 结构体_____________________________
|
| | |
|
| | | /// <summary>
|