From 3aa397ab145382935492b11c1f18c9634e69910b Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 10 十二月 2020 16:45:00 +0800
Subject: [PATCH] 请合并,门锁和晾衣架第一版代码

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs |  219 ++++++++++++++++--------------------------------------
 1 files changed, 66 insertions(+), 153 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
old mode 100755
new mode 100644
index d259aeb..49bec0f
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -103,8 +103,12 @@
                 {
                     Application.RunOnMainThread(() =>
                     {
-                        // 绫诲瀷鍖哄垎 
-                        TypeRefresh();
+                        // 绫诲瀷鍖哄垎
+                        UndateUnlockMethodAction += (obj) =>
+                        {
+                            RefreshList(obj);
+                        };
+                        TypeRefresh(doorLock);
                         CommonPage.Loading.Hide();
                         bodyView.EndHeaderRefreshing();
                     });
@@ -225,6 +229,14 @@
             {
                 btnAllMethod.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock);
             }
+            else if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FaceIDUnlock))
+            {
+                btnAllMethod.Text = Language.StringByID(R.MyInternationalizationString.FaceIDUnlock);
+            }
+            else if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.CalmFingerprintUnlock))
+            {
+                btnAllMethod.Text = Language.StringByID(R.MyInternationalizationString.CalmFingerprintUnlock);
+            }
             else
             {
                 btnAllMethod.Text = Language.StringByID(R.MyInternationalizationString.AllMethod);
@@ -243,7 +255,11 @@
 
             EventHandler<MouseEventArgs> handerSideLip = (sender, e) =>
             {
-                SideslipFramelayout();
+                SideslipFramelayout(doorLock);
+                UndateUnlockMethodAction += (obj) =>
+                {
+                    RefreshList(obj);
+                };
             };
             btnNext.MouseUpEventHandler += handerSideLip;
             btnAllMethod.MouseUpEventHandler += handerSideLip;
@@ -388,6 +404,18 @@
                                 continue;
                             }
                             break;
+                        case 13:
+                            if (curDoorLockUser.UnlockType != unlockMethod)
+                            {
+                                continue;
+                            }
+                            break;
+                        case 14:
+                            if (curDoorLockUser.UnlockType != unlockMethod)
+                            {
+                                continue;
+                            }
+                            break;
                         case 15:
                             if (curDoorLockUser.UnlockType != unlockMethod)
                             {
@@ -474,7 +502,11 @@
                                                      localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                      doorLock.localDoorLockUserList.Remove(curUserId);
                                                      doorLock.ReSave();
-                                                     TypeRefresh();
+                                                     UndateUnlockMethodAction += (obj) =>
+                                                     {
+                                                         RefreshList(obj);
+                                                     };
+                                                     TypeRefresh(doorLock);
                                                  }
                                              }
                                              else
@@ -518,7 +550,11 @@
                                                          var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                          localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                          doorLock.localDoorLockUserList.Remove(curUserId);
-                                                         TypeRefresh();
+                                                         UndateUnlockMethodAction += (obj) =>
+                                                         {
+                                                             RefreshList(obj);
+                                                         };
+                                                         TypeRefresh(doorLock);
                                                      }
                                                  }
                                                  else
@@ -588,6 +624,26 @@
                                 btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
                             }
                             break;
+                        case 13:
+                            if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
+                            {
+                                btnDoorlockUser.Text = curDoorLockUser.UserName;
+                            }
+                            else
+                            {
+                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.CalmFingerprintMark) + "ID" + +curDoorLockUser.UserID;
+                            }
+                            break;
+                        case 14:
+                            if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
+                            {
+                                btnDoorlockUser.Text = curDoorLockUser.UserName;
+                            }
+                            else
+                            {
+                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.FaceIDMark) + "ID" + +curDoorLockUser.UserID;
+                            }
+                            break;
                         case 15:
                             if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
                             {
@@ -633,7 +689,11 @@
                                      localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
                                      localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
                                      doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
-                                     TypeRefresh();
+                                     UndateUnlockMethodAction += (obj) =>
+                                     {
+                                         RefreshList(obj);
+                                     };
+                                     TypeRefresh(doorLock);
                                  }
                              }
                              else
@@ -650,153 +710,6 @@
                     #endregion
                     i++;
                 }
-            }
-        }
-
-        /// <summary>
-        /// 渚ц竟瀵艰埅鏍�
-        /// </summary>
-        void SideslipFramelayout()
-        {
-            #region sidelipFrameLayout UI
-            var dialog = new Dialog
-            {
-            };
-            dialog.Show();
-
-            var flMain = new FrameLayout { BackgroundColor = 0x00000000 };
-            dialog.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender11, e11) =>
-            {
-                dialog.Close();
-            };
-
-            var sidelipFrameLayout = new FrameLayout()
-            {
-                Height = Application.GetRealHeight(625),
-                Width = Application.GetRealWidth(449),
-                Y = Application.GetRealHeight(115 + 160),
-                X = Application.GetRealWidth(596),
-                BackgroundImagePath = "DoorLock/SideslipPic.png",
-            };
-            flMain.AddChidren(sidelipFrameLayout);
-
-            var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout()
-            {
-                Height = Application.GetRealHeight(600),
-                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),
-                    LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
-                    X = Application.GetRealWidth(81),
-                };
-                sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout);
-
-                var btnAllMethod = new Button()
-                {
-                    Width = Application.GetRealWidth(81),
-                    Height = Application.GetRealHeight(81),
-                    Y = Application.GetRealHeight(35),
-                };
-                rowFrameLayout.AddChidren(btnAllMethod);
-
-                var btnMethodText = new Button()
-                {
-                    Width = Application.GetRealWidth(311),
-                    Height = Application.GetRealHeight(58),
-                    X = Application.GetRealWidth(92),
-                    Y = Application.GetRealHeight(49),
-                    TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
-                    TextSize = 14,
-                    TextAlignment = TextAlignment.CenterLeft,
-                };
-                rowFrameLayout.AddChidren(btnMethodText);
-                #endregion
-
-                #region 鏁版嵁澶勭悊
-                EventHandler<MouseEventArgs> hander = (sender, e) =>
-                {
-                    if (!btnAllMethod.IsSelected)
-                    {
-                        if (oldbutton != null)
-                        {
-                            oldbutton.IsSelected = false;
-                        }
-                        if (oldbuttonText != null)
-                        {
-                            oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
-                        }
-                        oldbutton = btnAllMethod;
-                        oldbuttonText = btnMethodText;
-                        doorLock.currentUserDisplayMethod = btnMethodText.Text;
-                        doorLock.ReSave();
-                        btnAllMethod.IsSelected = true;
-                        oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                        oldbuttonText.IsBold = true;
-                        TypeRefresh();
-                    }
-                    dialog.Close();
-                };
-                rowFrameLayout.MouseUpEventHandler += hander;
-                btnAllMethod.MouseUpEventHandler += hander;
-                btnMethodText.MouseUpEventHandler += hander;
-
-                DisplayAllUnlockMethod(i, btnAllMethod, btnMethodText);
-
-                if (string.IsNullOrEmpty(doorLock.currentUserDisplayMethod) && i == 0)
-                {
-                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
-                }
-                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod) && i == 0)
-                {
-                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
-                }
-                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock) && i == 1)
-                {
-                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
-                }
-                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock) && i == 2)
-                {
-                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
-                }
-                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock) && i == 3)
-                {
-                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
-                }
-                #endregion
-            }
-        }
-
-        /// <summary>
-        /// 绫诲瀷鍖哄垎 
-        /// </summary>
-        void TypeRefresh()
-        {
-            if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock))
-            {
-                RefreshList(0);
-            }
-            else if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock))
-            {
-                RefreshList(15);
-            }
-            else if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock))
-            {
-                RefreshList(3);
-            }
-            else
-            {
-                RefreshList();
             }
         }
 

--
Gitblit v1.8.0