From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 10 七月 2020 10:52:13 +0800
Subject: [PATCH] 2020-07-10-01

---
 ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberByIdForm.cs |   84 +++++++++++++++++++++++++----------------
 1 files changed, 51 insertions(+), 33 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberByIdForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberByIdForm.cs
index 1f88c1b..f9b943a 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,66 +30,76 @@
         /// </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 = ControlCommonResourse.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);
+                this.SearchMemberInfo(txtCode.Text.Trim());
             });
         }
+
+        #endregion
+
+        #region 鈻� 鎼滅储ID_____________________________
 
         /// <summary>
         /// 鎼滅储鎸囧畾ID鐨勪俊鎭�
         /// </summary>
         /// <param name="accountId">鎴愬憳ID</param>
         /// <param name="txtMsg">淇℃伅鎺т欢</param>
-        private async void SearchMemberInfo(string accountId, ViewNormalControl txtMsg)
+        private async void SearchMemberInfo(string accountId)
         {
             //寮�鍚繘搴︽潯
             this.ShowProgressBar();
 
             var pra = new AccountInfoPra();
             pra.Account = accountId;
-            string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", pra);
+            string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountInfo", false, pra, new System.Collections.Generic.List<string>() { "AccountNoExists" });
             //鍏抽棴杩涘害鏉�
             this.CloseProgressBar();
 
             if (result == null)
             {
+                //寮傚父
+                return;
+            }
+            if (result == string.Empty)
+            {
+                //鎴愬憳涓嶅瓨鍦�
+                var form = new MemberNotEsixtForm();
+                form.AddForm();
                 return;
             }
 
@@ -93,7 +109,7 @@
             Application.RunOnMainThread(() =>
             {
                 var form = new AddMemberInfoForm();
-                this.AddForm(form, infoResult);
+                form.AddForm(infoResult);
             });
         }
 
@@ -101,16 +117,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