From c47c3ec2488961b3a006aaebcb03dba582f8b19b Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 12 三月 2020 17:08:42 +0800
Subject: [PATCH] 2020-03-12-1

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs |  112 +++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 78 insertions(+), 34 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
index 084d98a..07ff554 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
@@ -18,11 +18,23 @@
             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;
-        Action<string, string> action;//鎺ユ敹閫氱煡
+        /// <summary>
+        /// 鎺ユ敹閫氱煡
+        /// </summary>
+        Action<string, string> action;
 
         #endregion
 
@@ -40,7 +52,7 @@
             {
                 currentTitle = Language.StringByID(R.MyInternationalizationString.AddFingerprint);
             }
-            else
+            else if (currentType == "proximity")
             {
                 currentTitle = Language.StringByID(R.MyInternationalizationString.AddIcCard);
             }
@@ -48,11 +60,6 @@
 
             EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
             {
-                if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null)
-                {
-                    doorLock.Gateway.GwResDataAction -= action;
-                }
-
                 this.RemoveFromParent();
             };
             this.btnBack.MouseUpEventHandler += eHandlerBack;
@@ -62,6 +69,22 @@
             MidFrameLayoutContent();
         }
 
+        /// <summary>
+        /// 閲嶅啓绉婚櫎鏂规硶
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            ZbGateway.StatusList.Remove(this);
+            if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null)
+            {
+                doorLock.Gateway.GwResDataAction -= action;
+            }
+            base.RemoveFromParent();
+        }
+
+        /// <summary>
+        /// 涓儴甯冨眬
+        /// </summary>
         public void MidFrameLayoutContent()
         {
             var topMidFrameLayout = new FrameLayout
@@ -77,9 +100,9 @@
             {
                 X = Application.GetRealWidth(446),
                 Y = Application.GetRealHeight(330),
-                Height = Application.GetRealHeight(81 / 2),
+                Height = Application.GetRealHeight(76 / 2),
                 Width = Application.GetRealWidth(407),
-                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+                TextColor = Shared.Common.ZigbeeColor.Current.XMGray2,
                 TextSize = 10,
                 TextAlignment = TextAlignment.CenterLeft,
             };
@@ -89,9 +112,9 @@
             {
                 X = Application.GetRealWidth(446),
                 Y = btnPicTip1.Bottom,
-                Height = Application.GetRealHeight(81 / 2),
+                Height = Application.GetRealHeight(76 / 2),
                 Width = Application.GetRealWidth(207),
-                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+                TextColor = Shared.Common.ZigbeeColor.Current.XMGray2,
                 TextSize = 10,
                 TextAlignment = TextAlignment.CenterLeft,
             };
@@ -101,9 +124,9 @@
             {
                 X = Application.GetRealWidth(294),
                 Y = Application.GetRealHeight(1089),
-                Height = Application.GetRealHeight(173 / 2),
+                Height = Application.GetRealHeight(100 / 2),
                 Width = Application.GetRealWidth(488),
-                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+                TextColor = Shared.Common.ZigbeeColor.Current.XMGray2,
                 Gravity = Gravity.CenterHorizontal,
                 TextSize = 14,
             };
@@ -112,10 +135,10 @@
             var btnPicTip4 = new Button
             {
                 X = Application.GetRealWidth(397),
-                Y = btnPicTip3.Bottom,
+                Y = btnPicTip3.Y + Application.GetRealHeight(50),
                 Width = Application.GetRealWidth(288),
-                Height = Application.GetRealHeight(173 / 2),
-                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+                Height = Application.GetRealHeight(100 / 2),
+                TextColor = Shared.Common.ZigbeeColor.Current.XMGray2,
                 Gravity = Gravity.CenterHorizontal,
                 TextSize = 14,
             };
@@ -127,7 +150,7 @@
                 Y = Application.GetRealHeight(1388),
                 Height = Application.GetRealHeight(49),
                 Width = Application.GetRealWidth(685),
-                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                 Gravity = Gravity.CenterHorizontal,
                 TextSize = 12,
             };
@@ -142,8 +165,9 @@
                 Text = Language.StringByID(R.MyInternationalizationString.NextStepXm),
                 TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                 Gravity = Gravity.CenterHorizontal,
-                Radius = 10,
-                TextSize = 20,
+                Radius = (uint)Application.GetRealHeight(127 / 2),
+                TextSize = 16,
+                IsBold = true,
                 Enable = false,
                 BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect,
             };
@@ -178,7 +202,7 @@
                 btnPicTip1.X = Application.GetRealWidth(450);
                 btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip);
             }
-            else
+            else if (currentType == "proximity")
             {
                 topMidFrameLayout.BackgroundImagePath = "DoorLock/AddIcCardTipPic.png";
                 btnPicTip3.Width = Application.GetRealWidth(495);
@@ -214,21 +238,41 @@
                     var ProgrammingEventNotificationData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockProgrammingEventNotificationCommand>(jObjectdata["Data"].ToString());
                     if (ProgrammingEventNotificationData != null)
                     {
-                        doorLock.doorLockProgrammingEventNotificationCommand = ProgrammingEventNotificationData;
-                        var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
-                        localDoorLockObj.UserID = ProgrammingEventNotificationData.UserID;
-                        localDoorLockObj.UnlockType = ProgrammingEventNotificationData.ProgramEventSoure;
-                        //var entryTime = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocalTime(ProgrammingEventNotificationData.ZigbeeLocalTime);
-                        localDoorLockObj.EntryTime = System.DateTime.Now; //entryTime;
-                        if (!doorLock.localDoorLockUserList.ContainsKey(localDoorLockObj.UserID))
+                        int curMethod = -1;
+                        if (currentType == "password")
                         {
-                            doorLock.localDoorLockUserList.Add(ProgrammingEventNotificationData.UserID, localDoorLockObj);
+                            curMethod = 0;
                         }
-                        Application.RunOnMainThread(() =>
+                        else if (currentType == "fingerprint")
                         {
-                            nextBtn.Enable = true;
-                            nextBtn.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                        });
+                            curMethod = 15;
+                        }
+                        else if (currentType == "proximity")
+                        {
+                            curMethod = 3;
+                        }
+                        else
+                        {
+                            return;
+                        }
+                        if (ProgrammingEventNotificationData.ProgramEventSoure == curMethod)
+                        {
+                            doorLock.doorLockProgrammingEventNotificationCommand = ProgrammingEventNotificationData;
+                            var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
+                            localDoorLockObj.UserID = ProgrammingEventNotificationData.UserID;
+                            localDoorLockObj.UnlockType = ProgrammingEventNotificationData.ProgramEventSoure;
+                            localDoorLockObj.EntryTime = System.DateTime.Now;
+                            //鍏堟殏鏃跺姞鍏ワ紝绛変簯绔坊鍔犲拰鑾峰彇鐪熸鎴愬姛鍚庢墠鐪熺殑鍔犲叆
+                            if (!doorLock.localDoorLockUserList.ContainsKey(localDoorLockObj.UserID))
+                            {
+                                doorLock.localDoorLockUserList.Add(ProgrammingEventNotificationData.UserID, localDoorLockObj);
+                            }
+                            Application.RunOnMainThread(() =>
+                            {
+                                nextBtn.Enable = true;
+                                nextBtn.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                            });
+                        }
                     }
                 }
             };
@@ -249,7 +293,7 @@
         }
 
 
-        #region 鈼� 鎺ュ彛瀹炵幇__________________________
+        #region 鎺ュ彛瀹炵幇
         /// <summary>
         /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
         /// </summary>

--
Gitblit v1.8.0