From 3272ca5b51e19f7f8a827b0f68400570a547fe60 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 28 四月 2020 15:02:44 +0800
Subject: [PATCH] 2020-04-28-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs |   44 ++++++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
index 642f04f..1c697dd 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -10,7 +10,7 @@
 
         public LockLogicList()
         {
-            Tag = "Logic";
+            Tag = "LockListView";
         }
         VerticalRefreshLayout middle;
         public void Show()
@@ -36,10 +36,9 @@
                 //new涓�涓柊閫昏緫瀵硅薄锛�
                 Common.Logic.CurrentLogic = new Common.Logic();
                 Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
-                Common.Logic.CurrentLogic.LogicType = 1;
+                Common.Logic.CurrentLogic.LogicType = 1;//鏍囪鑷姩鍖栫被鍨�
                 Common.Logic.CurrentLogic.Relationship = 1;
-                Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
-                //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
+                Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.linkageevent);
                 var lockLogicCommunalPage = new LockLogicCommunalPage();
                 UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
                 UserView.HomePage.Instance.PageIndex += 1;
@@ -49,7 +48,7 @@
             middle = new VerticalRefreshLayout
             {
                 Y = view.topRowLayout.Bottom,
-                Height = Application.GetRealHeight(1920 - 184),
+                Height = Application.GetRealHeight(Method.H - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
@@ -80,13 +79,20 @@
                     for (int j = 0; j < listlogic.Count; j++)
                     {
                         var logic = listlogic[j];
-                        if (logic.LogicType == 0)
+                        if (logic.LogicType != 1)
                         {
                             continue;
                         }
                         bool yes = false;
                         for (int a = 0; a < logic.Accounts.Count; a++)
-                        {
+                        {
+                            if (logic.Accounts[a]["MacAddr"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Epoint"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString())
+                            {
+                                //鏌ユ壘鏄惁鏄偅涓棬閿侊紱
+                                //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵;
+                                yes = false;
+                                break;
+                            }
                             if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid)
                             {
                                 //鏌ユ壘鑷繁璐﹀彿涓嬬殑鍒涘缓鑱斿姩浜嬩欢锛�
@@ -156,6 +162,7 @@
                     Height = Application.GetRealHeight(190),
                     LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                     BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+                    SubViewWidth = Application.GetRealWidth(184),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
 
                 };
                 middle.AddChidren(logicRowlayout);
@@ -176,8 +183,8 @@
 
                 var logicswitchBtn = new Button
                 {
-                    Width = Application.GetMinRealAverage(104),
-                    Height = Application.GetMinRealAverage(63),
+                    Width = Application.GetRealWidth(104),
+                    Height = Application.GetRealHeight(63),
                     UnSelectedImagePath = "ZigeeLogic/logicclose.png",
                     SelectedImagePath = "ZigeeLogic/logicopen.png",
                     X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
@@ -227,7 +234,6 @@
 
                 };
 
-
                 ///鍒犻櫎
                 var del = new Button
                 {
@@ -238,18 +244,16 @@
                 logicRowlayout.AddRightView(del);
                 del.MouseUpEventHandler += (sender, e) =>
                 {
-                    var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
-                                             Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
-                    alert.ResultEventHandler += (sender1, e1) =>
+                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
+                    Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+                    Language.StringByID(MyInternationalizationString.confrim));
+                    alert.Show();
+                    alert.ConfirmClickEvent += () =>
                     {
-                        if (e1)
-                        {
-                            Common.Logic.LockLogicList.Remove(logic);
-                            Automationview();
-                            Send.DelLogic(logic.LogicId);
-                        }
+                        Common.Logic.LockLogicList.Remove(logic);
+                        Automationview();
+                        Send.DelLogic(logic.LogicId);
                     };
-                    alert.Show();
 
                 };
             }

--
Gitblit v1.8.0