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/AddMemberByIdForm.cs | 97 +++++++++++++++++++++++++++++------------------- 1 files changed, 58 insertions(+), 39 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberByIdForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberByIdForm.cs index 1f88c1b..d2d23d3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberByIdForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberByIdForm.cs @@ -5,8 +5,14 @@ /// <summary> /// 鏍规嵁璐﹀彿鍚嶆坊鍔犳垚鍛樼殑鐢婚潰 /// </summary> - public class AddMemberByIdForm : UserCenterCommonForm + public class AddMemberByIdForm : EditorCommonForm { + #region 鈻� 鍙橀噺澹版槑___________________________ + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + /// <summary> /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) /// </summary> @@ -24,61 +30,65 @@ /// </summary> private void InitMiddleFrame() { - //璇疯緭鍏ラ渶瑕佸姞鍏ユ垚鍛樼殑ID - var btnTitle = new ViewNormalControl(800, true); - btnTitle.X = ControlCommonResourse.XXLeft; - btnTitle.TextColor = UserCenterColor.Current.TextGrayColor; - btnTitle.TextID = R.MyInternationalizationString.uPleaseInputAddMenberID; - btnTitle.Y = Application.GetRealHeight(40); - bodyFrameLayout.AddChidren(btnTitle); + //娓呯┖bodyFrame + this.ClearBodyFrame(); - var rowlayout = new RowLayout(); - rowlayout.Height = ControlCommonResourse.ListViewRowHeight; - rowlayout.Y = btnTitle.Bottom; - bodyFrameLayout.AddChidren(rowlayout); + var frame = new FrameLayout(); + frame.Height = Application.GetRealHeight(248); + frame.BackgroundColor = UserCenterColor.Current.White; + bodyFrameLayout.AddChidren(frame); - //Email/鎵嬫満鍙� - var txtCode = new RowCenterEditorText(); - txtCode.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uEmailOrPhoneNumber); - txtCode.PlaceholderTextColor = UserCenterColor.Current.TextTipColor; - rowlayout.AddChidren(txtCode); + var rowAccount = new FrameRowControl(); + rowAccount.UseClickStatu = false; + rowAccount.Y = Application.GetRealHeight(23); + frame.AddChidren(rowAccount); + //搴曠嚎 + var btnLine = rowAccount.AddBottomLine(); - //鎻愮ず淇℃伅 - var txtMsg = new ViewNormalControl(800, true); - txtMsg.X = ControlCommonResourse.XXLeft; - txtMsg.Y = rowlayout.Bottom + Application.GetRealHeight(5); - txtMsg.TextColor = UserCenterColor.Current.Red; - bodyFrameLayout.AddChidren(txtMsg); + //璇疯緭鍏ラ渶瑕佸姞鍏ユ垚鍛樼殑ID(Email/鎵嬫満鍙�) + var txtCode = new TextInputControl(Application.GetRealWidth(900), rowAccount.Height, false); + txtCode.X = HdlControlResourse.XXLeft; + txtCode.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputAddMenberID); + rowAccount.AddChidren(txtCode, ChidrenBindMode.NotBind); + //鑱斿姩绾跨殑鐘舵�� + txtCode.btnLine = btnLine; //涓嬩竴姝� - var btnBottom = new BottomClickButton(); + var btnBottom = new BottomClickButton(688); + btnBottom.Y = Application.GetRealHeight(706); btnBottom.TextID = R.MyInternationalizationString.uNextway; bodyFrameLayout.AddChidren(btnBottom); - btnBottom.MouseUpEventHandler += ((sender, e) => + btnBottom.ButtonClickEvent += ((sender, e) => { //鎴愬憳ID妫�娴� - if (this.CheckAccountId(txtCode.Text.Trim(), txtMsg) == false) + if (this.CheckAccountId(txtCode.Text.Trim()) == false) { return; } //妫�绱㈡垚鍛樹俊鎭� - this.SearchMemberInfo(txtCode.Text.Trim(), txtMsg); + string strCode = txtCode.Text.Trim(); + HdlThreadLogic.Current.RunThread(() => + { + this.SearchMemberInfo(strCode); + }); }); } + + #endregion + + #region 鈻� 鎼滅储ID_____________________________ /// <summary> /// 鎼滅储鎸囧畾ID鐨勪俊鎭� /// </summary> /// <param name="accountId">鎴愬憳ID</param> /// <param name="txtMsg">淇℃伅鎺т欢</param> - private async void SearchMemberInfo(string accountId, ViewNormalControl txtMsg) + private void SearchMemberInfo(string accountId) { //寮�鍚繘搴︽潯 this.ShowProgressBar(); - var pra = new AccountInfoPra(); - pra.Account = accountId; - string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", pra); + var result = HdlMemberLogic.Current.SearchNormalInfoByAccount(accountId); //鍏抽棴杩涘害鏉� this.CloseProgressBar(); @@ -86,14 +96,21 @@ { return; } + if (result.Account == string.Empty) + { + HdlThreadLogic.Current.RunMain(() => + { + //鎴愬憳涓嶅瓨鍦� + var form = new MemberNotEsixtForm(); + form.AddForm(Language.StringByID(R.MyInternationalizationString.uMemberInformation)); + }); + return; + } - var infoResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountInfoResult>(result); - infoResult.Account = accountId; - - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { var form = new AddMemberInfoForm(); - this.AddForm(form, infoResult); + form.AddForm(result); }); } @@ -101,16 +118,18 @@ /// 妫�鏌ヨ緭鍏ョ殑鎴愬憳ID /// </summary> /// <param name="accountId"></param> - /// <param name="txtMsg"></param> /// <returns></returns> - private bool CheckAccountId(string accountId, ViewNormalControl txtMsg) + private bool CheckAccountId(string accountId) { if (accountId == string.Empty) { - txtMsg.TextID = R.MyInternationalizationString.uPleaseInputEmailOrPhoneNumber; + //璇疯緭鍏ラ渶瑕佸姞鍏ユ垚鍛樼殑ID + this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uPleaseInputAddMemberId)); return false; } return true; } + + #endregion } } -- Gitblit v1.8.0