| | |
| | | /// 列表控件
|
| | | /// </summary>
|
| | | private VerticalListControl listView = null;
|
| | | /// <summary>
|
| | | /// 成员头像控件
|
| | | /// </summary>
|
| | | private Dictionary<string, ImageView> dicIconControl = new Dictionary<string, ImageView>();
|
| | | /// <summary>
|
| | | /// 成员的账号(获取头像用)
|
| | | /// </summary>
|
| | | private Dictionary<string, string> dicMemberAccount = new Dictionary<string, string>();
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | string msg1 = Language.StringByID(R.MyInternationalizationString.uScanQRcode);
|
| | | menuContr.AddRowMenu(msg1, "Item/ScanQRcodeIcon.png", "Item/ScanQRcodeIconSelected.png", () =>
|
| | | {
|
| | | var form = new AddMemberByIdForm();
|
| | | form.AddForm();
|
| | | QRCode.ScanQRcode((qrCode) =>
|
| | | {
|
| | | if (string.IsNullOrEmpty(qrCode) == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //搜索ID
|
| | | this.SearchMemberInfo(qrCode);
|
| | | });
|
| | | });
|
| | | //输入账号
|
| | | string msg2 = Language.StringByID(R.MyInternationalizationString.uInputAccount);
|
| | |
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //用户图标
|
| | | var btnUserIcon = new PicViewControl(207, 207);
|
| | | btnUserIcon.Y = Application.GetRealHeight(46);
|
| | | var btnUserIcon = new ImageView();
|
| | | btnUserIcon.Height = Application.GetMinRealAverage(207);
|
| | | btnUserIcon.Width = Application.GetMinRealAverage(207);
|
| | | btnUserIcon.Radius = (uint)Application.GetMinRealAverage(207) / 2;
|
| | | btnUserIcon.ImagePath = UserCenterResourse.UserInfo.UserIconFile;
|
| | | btnUserIcon.Y = Application.GetRealHeight(46);
|
| | | btnUserIcon.Gravity = Gravity.CenterHorizontal;
|
| | | btnUserIcon.UnSelectedImagePath = "Center/Admin.png";
|
| | | frameBack.AddChidren(btnUserIcon);
|
| | |
|
| | | //昵称
|
| | |
| | | listView.Y = frameBack.Bottom;
|
| | | bodyFrameLayout.AddChidren(listView);
|
| | |
|
| | | HdlThreadLogic.Current.RunMainInThread(() =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //总之先清空共享文件夹准没错
|
| | | HdlShardLogic.Current.ClearShardDirectory();
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //添加成员列表
|
| | | this.AddMemberListRowByData();
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //添加成员列表
|
| | | this.AddMemberListRowByData();
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | }
|
| | | //调整列表控件的高度
|
| | | listView.AdjustRealHeight(Application.GetRealHeight(23));
|
| | | //获取成员头像
|
| | | this.GetMemberIcon();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | listView.AddChidren(rowlayout);
|
| | |
|
| | | //成员头像图标
|
| | | var btnIcon = rowlayout.AddLeftIcon(115);
|
| | | btnIcon.Radius = (uint)btnIcon.IconSize / 2;
|
| | | btnIcon.UnSelectedImagePath = "Center/Admin.png";
|
| | | string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.UserPictruePath, info.DistributedMark + ".png");
|
| | | var btnIcon = new ImageView();
|
| | | btnIcon.X = ControlCommonResourse.XXLeft;
|
| | | btnIcon.Gravity = Gravity.CenterVertical;
|
| | | btnIcon.Height = Application.GetMinRealAverage(115);
|
| | | btnIcon.Width = Application.GetMinRealAverage(115);
|
| | | btnIcon.Radius = (uint)Application.GetMinRealAverage(115) / 2;
|
| | | if (System.IO.File.Exists(iconPath) == true)
|
| | | {
|
| | | btnIcon.ImagePath = iconPath;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnIcon.ImagePath = "Center/Admin.png";
|
| | | this.dicIconControl[info.DistributedMark] = btnIcon;
|
| | | this.dicMemberAccount[info.DistributedMark] = info.Account;
|
| | | }
|
| | | rowlayout.AddChidren(btnIcon);
|
| | |
|
| | | //成员昵称
|
| | | string memberName = string.IsNullOrEmpty(info.UserName) == true ? info.Account : info.UserName;
|
| | | var btnName = rowlayout.AddLeftCaption(memberName, 600, true);
|
| | | btnName.X = ControlCommonResourse.XXLeft + btnIcon.Height + Application.GetRealWidth(35);
|
| | | btnName.TextSize = 15;
|
| | | rowlayout.AddChidren(btnName);
|
| | |
|
| | |
| | | var form = new MemberManagementForm();
|
| | | form.AddForm(info);
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 获取成员头像_______________________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取成员头像
|
| | | /// </summary>
|
| | | private void GetMemberIcon()
|
| | | {
|
| | | if (dicIconControl.Count == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | var pra = new AccountInfoPra();
|
| | | foreach (var keys in dicMemberAccount.Keys)
|
| | | {
|
| | | if (this.Parent == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | pra.Account = dicMemberAccount[keys];
|
| | | var result = await UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string>() { "NotSetAgain" });
|
| | | 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)
|
| | | {
|
| | | //写入头像内容
|
| | | string iconPath = System.IO.Path.Combine(UserCenterResourse.Option.UserPictruePath, keys + ".png");
|
| | | Shared.IO.FileUtils.WriteFileByBytes(iconPath, infoResult.HeadImage);
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | dicIconControl[keys].ImagePath = iconPath;
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 搜索ID_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 搜索指定ID的信息
|
| | | /// </summary>
|
| | | /// <param name="accountId">成员ID</param>
|
| | | /// <param name="txtMsg">信息控件</param>
|
| | | private async void SearchMemberInfo(string accountId)
|
| | | {
|
| | | var pra = new AccountInfoPra();
|
| | | pra.Account = accountId;
|
| | | string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new List<string>() { "AccountNoExists" });
|
| | | if (result == null)
|
| | | {
|
| | | //异常
|
| | | return;
|
| | | }
|
| | | if (result == string.Empty)
|
| | | {
|
| | | //成员不存在
|
| | | var form = new MemberNotEsixtForm();
|
| | | form.AddForm();
|
| | | return;
|
| | | }
|
| | |
|
| | | var infoResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountInfoResult>(result);
|
| | | infoResult.Account = accountId;
|
| | |
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | var form = new AddMemberInfoForm();
|
| | | form.AddForm(infoResult);
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 界面重新激活事件___________________
|
| | |
|
| | | /// <summary>
|