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/UnLockMethod.cs |  134 +++++++++++++++++++++-----------------------
 1 files changed, 65 insertions(+), 69 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
index a9e6361..d259aeb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -40,16 +40,43 @@
             BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
         }
 
-        #region 鈼� 鍙橀噺鐢虫槑__________________________
-        ZigBee.Device.DoorLock doorLock;//褰撳墠闂ㄩ攣
-        VerticalListRefreshControl bodyView;//鍒锋柊View
-        Button currentMethod;// 褰撳墠閫夋嫨鐨勬柟寮�
-        Shared.Phone.UserCenter.MemberInfoRes curAccountObj;//褰撳墠璐︽埛
+        #region 鍙橀噺鐢虫槑
+        /// <summary>
+        /// 褰撳墠闂ㄩ攣
+        /// </summary>
+        ZigBee.Device.DoorLock doorLock;
+        /// <summary>
+        /// 鍒锋柊View
+        /// </summary>
+        VerticalListRefreshControl bodyView;
+        /// <summary>
+        /// 褰撳墠閫夋嫨鐨勬柟寮�
+        /// </summary>
+        Button currentMethod;
+        /// <summary>
+        /// 褰撳墠璐︽埛
+        /// </summary>
+        Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
+        /// <summary>
+        /// 鏁版嵁涓虹┖锛孶I鏄剧ず鐨勭┖鍥剧墖
+        /// </summary>
         Button entryStatusPic;
+        /// <summary>
+        /// 鏁版嵁涓虹┖锛孶I鏄剧ず鐨勬枃鏈彁绀�
+        /// </summary>
         Button btnPicTip;
+        /// <summary>
+        /// 鏁版嵁涓虹┖锛孶I鏄剧ず鐨勬枃鏈彁绀�
+        /// </summary>
         Button btnPicTip1;
-        bool isSecondDel;//鏄惁浜屾鍒犻櫎
-        FrameLayout blankFrameLayout;//绌烘暟鎹樉绀哄竷灞�
+        /// <summary>
+        /// //鏄惁浜屾鍒犻櫎
+        /// </summary>
+        bool isSecondDel;
+        /// <summary>
+        /// 绌烘暟鎹樉绀哄竷灞�
+        /// </summary>
+        FrameLayout blankFrameLayout;
         #endregion
 
         /// <summary>
@@ -90,6 +117,7 @@
         /// </summary>
         public void Show()
         {
+            UserView.HomePage.Instance.ScrollEnabled = false;
             doorLock.currentUserDisplayMethod = "";
             this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.LockMethod));
             this.btnTitleLine.Visible = false;
@@ -154,7 +182,10 @@
                 RefreshList();
             }
         }
-        //涓儴甯冨眬
+
+        /// <summary>
+        /// 涓儴甯冨眬
+        /// </summary>
         void MidFrameLayoutContent()
         {
             #region 寮�閿佹柟寮廢I
@@ -257,6 +288,7 @@
                 Width = Application.GetRealHeight(757),
                 Visible = false,
                 UnSelectedImagePath = "DoorLock/UnLockBlankPic.png",
+                Gravity = Gravity.CenterHorizontal,
             };
             blankFrameLayout.AddChidren(entryStatusPic);
 
@@ -283,6 +315,10 @@
                 TextSize = 12,
             };
             blankFrameLayout.AddChidren(btnPicTip1);
+            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+            {
+                btnPicTip1.Width = 0;
+            }
         }
 
         /// <summary>
@@ -592,6 +628,7 @@
                                      var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                      localDoorLockObj.UserID = curDoorLockUser.UserID;
                                      localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
+                                     localDoorLockObj.PrimaryId = curDoorLockUser.PrimaryId;
                                      localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
                                      localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
                                      localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
@@ -616,9 +653,12 @@
             }
         }
 
-        // 渚ц竟瀵艰埅鏍�
+        /// <summary>
+        /// 渚ц竟瀵艰埅鏍�
+        /// </summary>
         void SideslipFramelayout()
         {
+            #region sidelipFrameLayout UI
             var dialog = new Dialog
             {
             };
@@ -647,10 +687,13 @@
                 Y = Application.GetRealHeight(28),
             };
             sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout);
+            #endregion
+
             Button oldbutton = null;
             Button oldbuttonText = null;
             for (var i = 0; i < 4; i++)
             {
+                #region rowFrameLayout UI
                 var rowFrameLayout = new RowLayout()
                 {
                     Height = Application.GetRealHeight(150),
@@ -678,7 +721,9 @@
                     TextAlignment = TextAlignment.CenterLeft,
                 };
                 rowFrameLayout.AddChidren(btnMethodText);
+                #endregion
 
+                #region 鏁版嵁澶勭悊
                 EventHandler<MouseEventArgs> hander = (sender, e) =>
                 {
                     if (!btnAllMethod.IsSelected)
@@ -706,74 +751,35 @@
                 btnAllMethod.MouseUpEventHandler += hander;
                 btnMethodText.MouseUpEventHandler += hander;
 
-                switch (i)
-                {
-                    case 0:
-                        btnAllMethod.UnSelectedImagePath = "DoorLock/AllMethod.png";
-                        btnAllMethod.SelectedImagePath = "DoorLock/AllMethodOn.png";
-                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.AllMethod);
-                        break;
-                    case 1:
-                        btnAllMethod.UnSelectedImagePath = "DoorLock/Password.png";
-                        btnAllMethod.SelectedImagePath = "DoorLock/PasswordOn.png";
-                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.PasswordUnlock);
-                        break;
-                    case 2:
-                        btnAllMethod.UnSelectedImagePath = "DoorLock/Fingerprint.png";
-                        btnAllMethod.SelectedImagePath = "DoorLock/FingerprintOn.png";
-                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.FingerprintUnlock);
-                        break;
-                    case 3:
-                        btnAllMethod.UnSelectedImagePath = "DoorLock/proximityCard.png";
-                        btnAllMethod.SelectedImagePath = "DoorLock/proximityCardOn.png";
-                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock);
-                        break;
-                }
+                DisplayAllUnlockMethod(i, btnAllMethod, btnMethodText);
 
                 if (string.IsNullOrEmpty(doorLock.currentUserDisplayMethod) && i == 0)
                 {
-                    btnAllMethod.IsSelected = true;
-                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                    btnMethodText.IsBold = true;
-                    oldbutton = btnAllMethod;
-                    oldbuttonText = btnMethodText;
+                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                 }
                 if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod) && i == 0)
                 {
-                    btnAllMethod.IsSelected = true;
-                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                    btnMethodText.IsBold = true;
-                    oldbutton = btnAllMethod;
-                    oldbuttonText = btnMethodText;
+                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                 }
                 if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock) && i == 1)
                 {
-                    btnAllMethod.IsSelected = true;
-                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                    btnMethodText.IsBold = true;
-                    oldbutton = btnAllMethod;
-                    oldbuttonText = btnMethodText;
+                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                 }
                 if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock) && i == 2)
                 {
-                    btnAllMethod.IsSelected = true;
-                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                    btnMethodText.IsBold = true;
-                    oldbutton = btnAllMethod;
-                    oldbuttonText = btnMethodText;
+                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                 }
                 if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock) && i == 3)
                 {
-                    btnAllMethod.IsSelected = true;
-                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                    btnMethodText.IsBold = true;
-                    oldbutton = btnAllMethod;
-                    oldbuttonText = btnMethodText;
+                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                 }
+                #endregion
             }
         }
 
-        //绫诲瀷鍖哄垎 
+        /// <summary>
+        /// 绫诲瀷鍖哄垎 
+        /// </summary>
         void TypeRefresh()
         {
             if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock))
@@ -799,19 +805,9 @@
         /// </summary>
         public override void RemoveFromParent()
         {
+            UserView.HomePage.Instance.ScrollEnabled = true;
             ZbGateway.StatusList.Remove(this);
             base.RemoveFromParent();
-        }
-
-        public void Changed(CommonDevice common)
-        {
-        }
-        public void ChangedILogicStatus(ZigBee.Device.Logic logic)
-        {
-        }
-
-        public void ChangedISceneStatus(Scene scene)
-        {
         }
     }
 }

--
Gitblit v1.8.0