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/DoorLock/EntryStatusPage.cs |  281 +++++++++++++++----------------------------------------
 1 files changed, 79 insertions(+), 202 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
index 54e6830..aee5ff4 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
@@ -8,11 +8,14 @@
 
 namespace Shared.Phone.UserCenter.DoorLock
 {
-    public class EntryStatusPage : DoorLockCommonLayout, ZigBee.Common.IStatus
+    public class EntryStatusPage : DoorLockCommonLayout
     {
+        /// <summary>
         /// 鏋勯�犲嚱鏁�
         /// </summary>
         /// <param name="doorLock"></param>
+        /// <param name="accountObj"></param>
+        /// <param name="entryType"></param>
         public EntryStatusPage(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj, string entryType)
         {
             this.doorLock = doorLock;
@@ -21,10 +24,22 @@
             BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
         }
 
-        #region 鈼� 鍙橀噺鐢虫槑__________________________
+        #region 鍙橀噺鐢虫槑
+        /// <summary>
+        /// 褰撳墠闂ㄩ攣
+        /// </summary>
         ZigBee.Device.DoorLock doorLock;
+        /// <summary>
+        /// 褰撳墠璐︽埛
+        /// </summary>
         Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
+        /// <summary>
+        /// 褰撳墠绫诲瀷
+        /// </summary>
         string currentType = string.Empty;
+        /// <summary>
+        /// 搴曢儴甯冨眬
+        /// </summary>
         FrameLayout bottomFrameLayout;
         #endregion
 
@@ -45,7 +60,9 @@
 
             MidFrameLayoutContent();
         }
-
+        /// <summary>
+        /// 涓儴甯冨眬
+        /// </summary>
         public void MidFrameLayoutContent()
         {
             var entryStatusPic = new Button
@@ -66,6 +83,7 @@
                 TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                 Gravity = Gravity.CenterHorizontal,
                 TextSize = 20,
+                IsBold = true,
             };
             this.midFrameLayout.AddChidren(btnPicTip);
 
@@ -84,7 +102,9 @@
 
             BottomFrameLayoutContent();
         }
-
+        /// <summary>
+        /// 搴曢儴甯冨眬
+        /// </summary>
         public void BottomFrameLayoutContent()
         {
             bottomFrameLayout = new FrameLayout()
@@ -131,7 +151,7 @@
             var btnLine = new FrameLayout()
             {
                 Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(5),
+                Height = 1,
                 X = Application.GetRealWidth(58),
                 Y = Application.GetRealHeight(81 + 127),
                 BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
@@ -152,7 +172,7 @@
                 Width = Application.GetRealWidth(222),
                 Height = Application.GetRealHeight(58),
                 Y = Application.GetRealHeight(35),
-                Text = Language.StringByID(R.MyInternationalizationString.MatchPerson),
+                Text = Language.StringByID(R.MyInternationalizationString.MatchPerson) + ":",
                 TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                 TextAlignment = TextAlignment.CenterLeft,
                 TextSize = 14,
@@ -171,6 +191,16 @@
             };
             personRemarkRemarkFrameLayout.AddChidren(btnMatchPersonContent);
 
+            var btnLine1 = new FrameLayout()
+            {
+                Width = Application.GetRealWidth(965),
+                Height = 1,
+                X = Application.GetRealWidth(58),
+                Y = Application.GetRealHeight(81 + 127 + 12 + 127),
+                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
+            };
+            bottomFrameLayout.AddChidren(btnLine1);
+
             var completeBtn = new Button
             {
                 X = Application.GetRealWidth(86),
@@ -181,27 +211,29 @@
                 TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                 Gravity = Gravity.CenterHorizontal,
                 BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
-                Radius = 10,
+                Radius = (uint)Application.GetRealHeight(127 / 2),
                 TextSize = 16,
+                IsBold = true,
             };
             bottomFrameLayout.AddChidren(completeBtn);
 
             if (currentType == "password")
             {
                 btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.PasswordRemark);
-                btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.Password) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID;
+                btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + doorLock.doorLockProgrammingEventNotificationCommand.UserID;
             }
             else if (currentType == "fingerprint")
             {
                 btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.FingerprintRemark);
-                btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID;
+                btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + doorLock.doorLockProgrammingEventNotificationCommand.UserID;
             }
             else
             {
                 btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.ProximityRemark);
-                btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.ProximityCard) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID;
+                btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + doorLock.doorLockProgrammingEventNotificationCommand.UserID;
             }
-            if (curAccountObj.UserName != "" && curAccountObj.UserName != null)
+
+            if (!string.IsNullOrEmpty(curAccountObj.UserName))
             {
                 btnMatchPersonContent.Text = curAccountObj.UserName;
             }
@@ -213,6 +245,10 @@
             completeBtn.MouseDownEventHandler += async (sender, e) =>
              {
                  completeBtn.Enable = false;
+                 if (doorLock.doorLockProgrammingEventNotificationCommand == null)
+                 {
+                     return;
+                 }
                  var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData();
                  if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                  {
@@ -228,7 +264,7 @@
                  addLockInfo.OpenLockMode = doorLock.doorLockProgrammingEventNotificationCommand.ProgramEventSoure;
                  addLockInfo.DoorLockLocalUserId = doorLock.doorLockProgrammingEventNotificationCommand.UserID.ToString();
                  addLockInfo.EntryTime = System.DateTime.Now;
-                 if (btnPasswordRemarkContent.Text != "")
+                 if (!string.IsNullOrEmpty(btnPasswordRemarkContent.Text))
                  {
                      addLockInfo.UserIdRemarks = btnPasswordRemarkContent.Text;
                  }
@@ -246,44 +282,52 @@
                          {
                              if (doorLock.localDoorLockUserList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID))
                              {
-                                 //瀛樿处鎴蜂俊鎭�
-                                 // var resultList1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalAccountlist(doorLock, curAccountObj.SubAccountDistributedMark);
                                  //瀛橀棬閿佷俊鎭�
                                  var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountObj.SubAccountDistributedMark);
-                                 if (resultList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID) == true)
+                                 if (resultList != null)
                                  {
-                                     var a = resultList[doorLock.doorLockProgrammingEventNotificationCommand.UserID];
-                                     if (a?.ConnectedAccount == curAccountObj.SubAccountDistributedMark)
+                                     if (resultList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID) == true)
                                      {
-                                         completeBtn.Enable = true;
-                                         this.RemoveFromParent();
-                                         for (int i = UserView.HomePage.Instance.ChildrenCount - 1; i >= 0; i--)
+                                         var a = resultList[doorLock.doorLockProgrammingEventNotificationCommand.UserID];
+                                         if (a?.ConnectedAccount == curAccountObj.SubAccountDistributedMark)
                                          {
-                                             var form = UserView.HomePage.Instance.GetChildren(i);
+                                             completeBtn.Enable = true;
+                                             this.RemoveFromParent();
+                                             for (int i = UserView.HomePage.Instance.ChildrenCount - 1; i >= 0; i--)
+                                             {
+                                                 var form = UserView.HomePage.Instance.GetChildren(i);
 
-                                             if (form is UnLockMethod)
-                                             {
-                                                 ((UnLockMethod)form).RefreshList();
-                                                 break;
-                                             }
-                                             else
-                                             {
-                                                 form.RemoveFromParent();
+                                                 if (form is UnLockMethod)
+                                                 {
+                                                     doorLock.currentUserDisplayMethod = "";
+                                                     ((UnLockMethod)form).RefreshList();
+                                                     break;
+                                                 }
+                                                 else
+                                                 {
+                                                     form.RemoveFromParent();
+                                                 }
                                              }
                                          }
-                                     }
-                                     else
-                                     {
-                                         completeBtn.Enable = true;
-                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
+                                         else
+                                         {
+                                             completeBtn.Enable = true;
+                                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
+                                         }
                                      }
                                  }
+                                 else
+                                 {
+                                     completeBtn.Enable = true;
+                                     new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
+                                 }
+
                              }
                          }
                          else
                          {
                              completeBtn.Enable = true;
-                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
+                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AddFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
                          }
                      }
                      else
@@ -299,172 +343,5 @@
                  }
              };
         }
-
-        public void MatchUsersFrameLayout()
-        {
-            var flMain = new FrameLayout { BackgroundColor = 0x0f000000 };
-            this.midFrameLayout.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender11, e11) =>
-            {
-                flMain.RemoveFromParent();
-                bottomFrameLayout.RemoveAll();
-                BottomFrameLayoutContent();
-            };
-            bottomFrameLayout = new FrameLayout()
-            {
-                Height = Application.GetRealHeight(100),
-                Y = Application.GetRealHeight(930),
-                Radius = 17,
-                BackgroundColor = ZigbeeColor.Current.XMWhite,
-            };
-            flMain.AddChidren(bottomFrameLayout);
-
-            var bottomFrameLayout1 = new FrameLayout()
-            {
-                Height = Application.GetRealHeight(806 - 50),
-                Y = Application.GetRealHeight(930 + 48),
-                BackgroundColor = ZigbeeColor.Current.XMWhite,
-            };
-            flMain.AddChidren(bottomFrameLayout1);
-
-            var bottomFrameLayout2 = new FrameLayout()
-            {
-                Height = Application.GetRealHeight(806),
-                Y = Application.GetRealHeight(930),
-            };
-            flMain.AddChidren(bottomFrameLayout2);
-
-            var matchUsersFrameLayout = new FrameLayout()
-            {
-                Height = Application.GetRealHeight(138),
-            };
-            bottomFrameLayout2.AddChidren(matchUsersFrameLayout);
-
-            var btnCancel = new Button
-            {
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(40),
-                Height = Application.GetRealHeight(58),
-                Width = Application.GetRealWidth(101),
-                Text = Language.StringByID(R.MyInternationalizationString.Cancel),
-                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                TextSize = 14,
-            };
-            matchUsersFrameLayout.AddChidren(btnCancel);
-
-            var btnMatchUser = new Button
-            {
-                X = Application.GetRealWidth(446),
-                Y = Application.GetRealHeight(35),
-                Height = Application.GetRealHeight(63),
-                Width = Application.GetRealWidth(284),
-                Text = Language.StringByID(R.MyInternationalizationString.MatchPerson),
-                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
-                TextSize = 16,
-            };
-            matchUsersFrameLayout.AddChidren(btnMatchUser);
-
-            var btnFinish = new Button
-            {
-                X = Application.GetRealWidth(919),
-                Y = Application.GetRealHeight(40),
-                Height = Application.GetRealHeight(58),
-                Width = Application.GetRealWidth(101),
-                Text = Language.StringByID(R.MyInternationalizationString.Complete),
-                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                TextSize = 14,
-            };
-            matchUsersFrameLayout.AddChidren(btnFinish);
-
-            var btnTopLine = new FrameLayout()
-            {
-                Height = Application.GetRealHeight(5),
-                Y = Application.GetRealHeight(138),
-                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-            };
-            bottomFrameLayout2.AddChidren(btnTopLine);
-
-            var matchUserHorizontalScrolViewLayout = new VerticalScrolViewLayout()
-            {
-                Y = Application.GetRealHeight(207),
-                Height = Application.GetRealHeight(806 - 207),
-            };
-            bottomFrameLayout2.AddChidren(matchUserHorizontalScrolViewLayout);
-
-            for (var i = 0; i < 4; i++)
-            {
-                var rowFrameLayout = new FrameLayout()
-                {
-                    Height = Application.GetRealHeight(127),
-                };
-                matchUserHorizontalScrolViewLayout.AddChidren(rowFrameLayout);
-
-                var btnUserName = new Button()
-                {
-                    Width = Application.GetRealWidth(743),
-                    Height = Application.GetRealHeight(58),
-                    X = Application.GetRealWidth(81),
-                    Y = Application.GetRealHeight(37),
-                    TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                    TextSize = 14,
-                    TextAlignment = TextAlignment.CenterLeft,
-                };
-                rowFrameLayout.AddChidren(btnUserName);
-
-                var btnChoose = new Button()
-                {
-                    Width = Application.GetRealWidth(58),
-                    Height = Application.GetRealHeight(58),
-                    X = Application.GetRealWidth(861 + 81),
-                    Y = Application.GetRealHeight(35),
-                    BackgroundColor = ZigbeeColor.Current.XMOrange,
-                };
-                rowFrameLayout.AddChidren(btnChoose);
-
-                var btnLine = new FrameLayout()
-                {
-                    Width = Application.GetRealWidth(919),
-                    Height = Application.GetRealHeight(5),
-                    X = Application.GetRealWidth(81),
-                    Y = Application.GetRealHeight(122),
-                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                };
-                rowFrameLayout.AddChidren(btnLine);
-            }
-        }
-
-        #region 鈼� 鎺ュ彛瀹炵幇__________________________
-        /// <summary>
-        /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
-        /// </summary>
-        /// <returns>The changed.</returns>
-        /// <param name="common">Common.</param>
-        public void Changed(CommonDevice common)
-        {
-
-        }
-        /// <summary>
-        /// 澶勭悊鍙樺寲浜嬩欢
-        /// </summary>
-        /// <param name="common"></param>
-        /// <param name="typeTag"></param>
-        public void DeviceInfoChange(CommonDevice common, string typeTag)
-        {
-        }
-        /// <summary>
-        /// Changeds the IL ogic status.
-        /// </summary>
-        /// <param name="logic">Logic.</param>
-        public void ChangedILogicStatus(ZigBee.Device.Logic logic)
-        {
-        }
-        /// <summary>
-        /// Changeds the IS cene status.
-        /// </summary>
-        /// <param name="scene">Scene.</param>
-        public void ChangedISceneStatus(Scene scene)
-        {
-        }
-        #endregion
     }
 }

--
Gitblit v1.8.0