From 73e6bfcd3eed1b4aa714af538891a3a62864b516 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 05 十二月 2019 14:34:59 +0800
Subject: [PATCH] 2019-12-05-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs |   50 ++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
index 0c174e4..fa4eb0b 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
@@ -12,10 +12,10 @@
             Tag = "LockLogic";
         }
         Button selectedIcon = new Button();
-        VerticalScrolViewLayout middle;
+        VerticalRefreshLayout middle;
         public int conditionsIndex = -1;
 
-        public async void Show()
+        public void Show()
         {
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
             var topRowLayout = new RowLayout
@@ -69,14 +69,37 @@
 
             #endregion
 
-            middle = new VerticalScrolViewLayout
+            middle = new VerticalRefreshLayout
             {
                 Y = topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
+            middle.BeginHeaderRefreshingAction += () =>
+            {
+                //閲嶆柊鍒锋柊logic鍒楄〃
+                string macport = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint.ToString();
+                for (int i = 0; i < Send.LockList.Count; i++)
+                {
+                    if (Send.LockList[i].DoorLockMacPort == macport)
+                    {
+                        ///浠庡垪琛ㄧЩ闄ゅ綋鍓嶉棬閿佸叏閮ㄧ殑鏃ф暟鎹紱
+                        Send.LockList.Remove(Send.LockList[i]);
+                    }
+                }
+                Read();
+                //鍏抽棴鍒锋柊View锛�
+                middle.EndHeaderRefreshing();
+            };
+            Read();
 
+        }
+        /// <summary>
+        /// 璇诲彇褰撳墠闂ㄩ攣鐨勪簯绔暟鎹紱
+        /// </summary>
+        public async void Read()
+        {
             bool d = false;
             string macport = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint.ToString();
             for (int i = 0; i < Send.LockList.Count; i++)
@@ -96,12 +119,11 @@
             }
             UserAllView(macport);
             CommonPage.Loading.Hide();
-
         }
         /// <summary>
         /// 鏄剧ず鎵�鏈夌敤鎴�
         /// </summary>
-        void UserAllView(string macport)
+        public void UserAllView(string macport)
         {
 
             for (int i = 0; i < Send.LockList.Count; i++)
@@ -167,10 +189,10 @@
         /// 閫夋嫨鏌愪釜鐢ㄦ埛
         /// </summary>
         /// <param name="membershipIfon">瑙﹀彂婧愬垪琛�</param>
-        /// <param name="userName">鐢ㄦ埛鍚嶅瓧</param>
-        void SelectedUserID(Send.MembershipIfon membershipIfon) {
+        public void SelectedUserID(Send.MembershipIfon membershipIfon)
+        {
 
-           var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
             this.AddChidren(flMain);
 
             flMain.MouseUpEventHandler += (sender1, e1) =>
@@ -178,7 +200,7 @@
                 flMain.RemoveFromParent();
             };
 
-  
+
 
             var lockcolorfra1 = new FrameLayout
             {
@@ -279,7 +301,7 @@
                     TextSize = 14,
                 };
                 doorlockRow.AddChidren(doorlockBtn);
-               
+
                 var doorlockSelected = new Button
                 {
                     X = Application.GetRealWidth(860),
@@ -320,11 +342,11 @@
                         selectedIcon = doorlockSelected;
                         doorlockSelected.Visible = true;
                     }
-                    
+
 
                 }
             }
-           
+
             Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
                 var lockConditionsInfo = new Dictionary<string, string>();
@@ -339,7 +361,7 @@
                 lockConditionsInfo.Add("Range", "0");
                 var accounts = new Dictionary<string, string>();
                 accounts.Add("Type", "1");
-                accounts.Add("Account", membershipIfon.UserName+ modeName);
+                accounts.Add("Account", membershipIfon.UserName + modeName);
                 accounts.Add("UserId", attriButeData2);
                 if (SelectedLockStatus != "")
                 {
@@ -422,6 +444,6 @@
                 lockLogicCommunalPage.Show(() => { });
             };
         }
-    
+        
     }
 }

--
Gitblit v1.8.0