From 8b9ce384b26c414db32f98e94e088f5334869c2d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 13 十一月 2019 15:36:28 +0800
Subject: [PATCH] 全部合并了代码,安卓和 IOS 都测试通过了

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs |   97 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 80 insertions(+), 17 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
index 6bd28b7..7580a18 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -2,11 +2,39 @@
 using System.Collections.Generic;
 using System.ComponentModel;
 using Shared.Common;
+using ZigBee.Device;
 
 namespace Shared.Phone.UserCenter.DoorLock
 {
-    public class UnLockMethod : DoorLockCommonLayout
+    public class UnLockMethod : DoorLockCommonLayout, ZigBee.Common.IStatus
     {
+        /// <summary>
+        /// 澶勭悊鍙樺寲浜嬩欢
+        /// </summary>
+        /// <param name="common"></param>
+        /// <param name="typeTag"></param>
+        public void DeviceInfoChange(CommonDevice tempDevice, string typeTag)
+        {
+            if (typeTag == "DoorLockProgrammingEventNotificationCommand" && tempDevice != null)
+            {
+                if (tempDevice != null)
+                {
+                    if (tempDevice.DeviceEpoint == doorLock.DeviceEpoint
+                                      && tempDevice.DeviceAddr == doorLock.DeviceAddr)
+                    {
+                        var doorLock = tempDevice as ZigBee.Device.DoorLock;
+                        if (doorLock.doorLockProgrammingEventNotificationCommand != null)
+                        {
+
+                            Application.RunOnMainThread(() =>
+                            {
+
+                            });
+                        }
+                    }
+                }
+            }
+        }
         /// 鏋勯�犲嚱鏁�
         /// </summary>
         /// <param name="doorLock"></param>
@@ -58,7 +86,7 @@
             this.btnTitleLine.Visible = false;
             EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
             {
-                RemoveFromParent();
+                this.RemoveFromParent();
             };
             this.btnBack.MouseUpEventHandler += eHandlerBack;
             this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
@@ -66,7 +94,7 @@
 
             var btnAddFrameLayout = new FrameLayout
             {
-                X = Application.GetRealWidth(953),
+                X = Application.GetRealWidth(953 - 116),
                 Height = Application.GetRealHeight(72),
                 Width = Application.GetRealWidth(72),
             };
@@ -79,20 +107,32 @@
                 UnSelectedImagePath = "DoorLock/AddIcon.png",
             };
             btnAddFrameLayout.AddChidren(btnAdd);
-            btnAdd.MouseDownEventHandler += (sender, e) =>
+            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
             {
-                if (doorLock.IsFreezeAccount[curAccountObj.SubAccountDistributedMark] == true)
-                {
-                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
-                }
-                else
-                {
-                    var addUnLockMethod = new Shared.Phone.UserCenter.DoorLock.AddUnLockMethod(doorLock, curAccountObj);
-                    Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethod);
-                    Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
-                    addUnLockMethod.Show();
-                }
-            };
+                btnAdd.Width = 0;
+            }
+            btnAdd.MouseDownEventHandler += (sender, e) =>
+        {
+            if (doorLock.IsFreezeAccount[curAccountObj.SubAccountDistributedMark] == true)
+            {
+                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+            }
+            else
+            {
+                var addUnLockMethod = new Shared.Phone.UserCenter.DoorLock.AddUnLockMethod(doorLock, curAccountObj);
+                Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethod);
+                Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                addUnLockMethod.Show();
+            }
+        };
+            if (UserCenterResourse.UserInfo.AuthorityNo == 3)
+            {
+                btnAddFrameLayout.Width = 0;
+            }
+            else
+            {
+                btnAddFrameLayout.Width = Application.GetRealWidth(72);
+            }
             MidFrameLayoutContent();
         }
         //涓儴甯冨眬
@@ -174,7 +214,8 @@
 
             bodyView = new VerticalScrolViewLayout()
             {
-                Y = btnLine.Bottom,
+                Y = midTopFrameLayout.Bottom,
+                Height = Application.GetRealHeight(1921 - 184 - 115 - 1),
             };
             this.midFrameLayout.AddChidren(bodyView);
 
@@ -439,6 +480,7 @@
                                         }
                                         else
                                         {
+                                            //寮�鍏冲浘鏍�
                                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                         }
                                     }
@@ -948,5 +990,26 @@
             }
         }
 
+        /// <summary>
+        /// 閲嶅啓绉婚櫎鏂规硶
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            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