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/Safety/CoercePswAddContactForm.cs |   67 +++++++++++++++++++++------------
 1 files changed, 43 insertions(+), 24 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
index 702fbec..aad47d2 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
@@ -13,6 +13,10 @@
         #region 鈻� 鍙橀噺澹版槑___________________________
 
         /// <summary>
+        /// 娣诲姞鑱旂郴鏂瑰紡鐨勪簨浠�
+        /// </summary>
+        public Action AddPhoneEvent = null;
+        /// <summary>
         /// 淇℃伅鎻愮ず鎺т欢
         /// </summary>
         private NormalViewControl btnErrorMsg = null;
@@ -44,6 +48,15 @@
             {
                 Contacts.ContactAction = (phoneName, phoneNum) =>
                 {
+                    if (string.IsNullOrEmpty(phoneName) == true)
+                    {
+                        return;
+                    }
+                    //鎵嬫満鍙锋娴�
+                    if (this.CheckPhoneNumber("86", phoneNum, phoneName) == false)
+                    {
+                        return;
+                    }
                     //淇濆瓨鑱旂郴浜�
                     this.SaveCoercePhoneNumber("86", phoneNum, phoneName);
                 };
@@ -52,6 +65,13 @@
 
             //鍒濆鍖栦腑閮ㄤ俊鎭�
             this.InitMiddleFrame();
+
+            //閲嶅啓搴曞眰杩斿洖鎸夐敭浜嬩欢
+            this.BackButtonClickEvent = (sender) =>
+            {
+                this.AddPhoneEvent = null;
+                this.CloseForm();
+            };
         }
 
         /// <summary>
@@ -69,21 +89,22 @@
 
             //鍦板尯鐮�
             var btnArea = new NormalViewControl(127, 60, true);
-            btnArea.X = ControlCommonResourse.XXLeft;
+            btnArea.X = HdlControlResourse.XXLeft;
             btnArea.Y = Application.GetRealHeight(57);
             btnArea.Text = "+86";
             btnArea.TextAlignment = TextAlignment.Center;
             btnArea.TextColor = UserCenterColor.Current.TextGrayColor1;
             frameBack.AddChidren(btnArea);
-            btnArea.ButtonClickEvent += (sender, e) =>
-            {
-                var form = new AreaCodeSelectForm();
-                form.AddForm();
-                form.FinishSelectEvent += (code) =>
-                {
-                    btnArea.Text = "+" + code;
-                };
-            };
+            //鐩墠鍙拡瀵�+86
+            //btnArea.ButtonClickEvent += (sender, e) =>
+            //{
+            //    var form = new AreaCodeSelectForm();
+            //    form.AddForm();
+            //    form.FinishSelectEvent += (code) =>
+            //    {
+            //        btnArea.Text = "+" + code;
+            //    };
+            //};
             //鐢佃瘽杈撳叆妗�
             var txtPhone = new TextInputControl(Application.GetRealWidth(634), btnArea.Height, false);
             txtPhone.X = btnArea.Right + Application.GetRealWidth(35);
@@ -102,17 +123,19 @@
                 txtPhone.Text = string.Empty;
             };
             //绾�
-            var btnLine = new NormalViewControl(Application.GetRealWidth(965), ControlCommonResourse.BottomLineHeight, false);
+            var btnLine = new NormalViewControl(Application.GetRealWidth(965), HdlControlResourse.BottomLineHeight, false);
             btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
             btnLine.Y = Application.GetRealHeight(150);
             btnLine.Gravity = Gravity.CenterHorizontal;
             frameBack.AddChidren(btnLine);
+            //鑱斿姩绾跨殑鐘舵��
+            txtPhone.btnLine = btnLine;
 
             //澶囨敞
             var txtNote = new TextInputControl(Application.GetRealWidth(740), txtPhone.Height, false);
-            txtNote.X = ControlCommonResourse.XXLeft;
+            txtNote.X = HdlControlResourse.XXLeft;
             txtNote.Y = btnLine.Bottom + Application.GetRealHeight(60);
-            txtNote.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInpuBackup);
+            txtNote.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPlesaeInputNoteInformation);
             frameBack.AddChidren(txtNote);
             //鍙栨秷鍥炬爣
             var btnCancel2 = new MostRightIconControl(69, 69);
@@ -128,7 +151,7 @@
 
             //淇℃伅鎻愮ず
             this.btnErrorMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
-            btnErrorMsg.X = ControlCommonResourse.XXLeft;
+            btnErrorMsg.X = HdlControlResourse.XXLeft;
             btnErrorMsg.Y = frameBack.Bottom + Application.GetRealHeight(29);
             btnErrorMsg.TextColor = 0xfff75858;
             btnErrorMsg.TextSize = 12;
@@ -174,6 +197,10 @@
                 return;
             }
             this.CloseForm();
+
+            //璋冪敤鍥炶皟鍑芥暟
+            this.AddPhoneEvent?.Invoke();
+            this.AddPhoneEvent = null;
         }
 
         #endregion
@@ -197,8 +224,8 @@
             }
             if (strNote == string.Empty)
             {
-                //璇疯緭鍏ュ娉ㄥ悕绉�
-                btnErrorMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInpuBackup);
+                //璇疯緭鍏ュ娉ㄥ唴瀹�
+                btnErrorMsg.Text = Language.StringByID(R.MyInternationalizationString.uPlesaeInputNoteInformation);
                 return false;
             }
 
@@ -225,13 +252,5 @@
         }
 
         #endregion
-
-
-
-
-
-       
-
-     
     }
 }

--
Gitblit v1.8.0