From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs |  119 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 66 insertions(+), 53 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs
index 26284d3..4195a9e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethod.cs
@@ -3,7 +3,7 @@
 
 namespace Shared.Phone.UserCenter.DoorLock
 {
-    public class AddUnLockMethod : DoorLockCommonLayout, ZigBee.Common.IStatus
+    public class AddUnLockMethod : DoorLockCommonLayout
     {
         /// 鏋勯�犲嚱鏁�
         /// </summary>
@@ -15,8 +15,14 @@
             BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
         }
 
-        #region 鈼� 鍙橀噺鐢虫槑__________________________
+        #region 鍙橀噺鐢虫槑
+        /// <summary>
+        /// 褰撳墠闂ㄩ攣
+        /// </summary>
         ZigBee.Device.DoorLock doorLock;
+        /// <summary>
+        /// 褰撳墠璐︽埛
+        /// </summary>
         Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
         #endregion
 
@@ -38,6 +44,9 @@
             MidFrameLayoutContent();
         }
 
+        /// <summary>
+        /// 涓儴甯冨眬
+        /// </summary>
         public void MidFrameLayoutContent()
         {
             var bodyView = new VerticalScrolViewLayout()
@@ -45,7 +54,8 @@
             };
             this.midFrameLayout.AddChidren(bodyView);
 
-            for (int i = 0; i < 3; i++)
+            int count = GetSupportType(doorLock);
+            for (int i = 0; i < count; i++)
             {
                 var RowView = new FrameLayout()
                 {
@@ -62,7 +72,7 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                     Gravity = Gravity.CenterVertical,
-                    TextSize=14,
+                    TextSize = 14,
                 };
                 RowView.AddChidren(btnText);
 
@@ -94,83 +104,86 @@
                 };
                 RowView.AddChidren(line2);
 
+                var listDevice = Common.LocalDevice.Current.GetDevicesByMac(doorLock.DeviceAddr);
+                var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
                 if (i == 0)
                 {
                     btnText.TextID = R.MyInternationalizationString.AddPassword;
                 }
                 else if (i == 1)
                 {
-                    btnText.TextID = R.MyInternationalizationString.AddFingerprint;
+                    if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1F)
+                    {
+                        btnText.TextID = R.MyInternationalizationString.AddDoorLockCalmFingerprint;
+                    }
+                    else if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_HAT1B)
+                    {
+                        btnText.TextID = R.MyInternationalizationString.AddDoorLockCalmFingerprint;
+                    }
+                    else
+                    {
+                        btnText.TextID = R.MyInternationalizationString.AddFingerprint;
+                    }
                 }
                 else if (i == 2)
                 {
-                    btnText.TextID = R.MyInternationalizationString.AddIcCard;
+                    if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1F)
+                    {
+                        btnText.TextID = R.MyInternationalizationString.AddDoorLockFaceID;
+                    }
+                    else if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1TF)
+                    {
+                        btnText.TextID = R.MyInternationalizationString.AddIcCard;
+                    }
+                    else
+                    {
+                        btnText.TextID = R.MyInternationalizationString.AddIcCard;
+                    }
+                }
+                if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1TF)
+                {
+                    if (i == 3)
+                    {
+                        btnText.TextID = R.MyInternationalizationString.AddDoorLockFaceID;
+                    }
+                }
+                if (i == count - 1)
+                {
                     line2.Visible = false;
                 }
-
                 int currentIndex = i;
                 EventHandler<MouseEventArgs> eHandler = (sender, e) =>
                 {
+                    string unlockTypeStr = "";
                     if (currentIndex == 0)
                     {
-                        var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "password");
-                        Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip);
-                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
-                        addUnLockMethodTip.Show();
+                        unlockTypeStr = "password";
                     }
                     else if (currentIndex == 1)
                     {
-                        var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "fingerprint");
-                        Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip);
-                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
-                        addUnLockMethodTip.Show();
+                        unlockTypeStr = "fingerprint";
                     }
                     else if (currentIndex == 2)
                     {
-                        var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "proximity");
-                        Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip);
-                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
-                        addUnLockMethodTip.Show();
+                        unlockTypeStr = "proximity";
                     }
+                    else if (currentIndex == 3)
+                    {
+                        unlockTypeStr = "faceID";
+                    }
+                    else if (currentIndex == 4)
+                    {
+                        unlockTypeStr = "calmFingerprint";
+                    }
+                    var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, unlockTypeStr);
+                    Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip);
+                    Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                    addUnLockMethodTip.Show();
                 };
                 btnRight.MouseUpEventHandler += eHandler;
                 RowView.MouseUpEventHandler += eHandler;
                 btnText.MouseUpEventHandler += eHandler;
             }
         }
-
-        #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