From 9c6bd67d66859e48f0e794cd2746aef9310ce71d Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期五, 13 十二月 2019 18:01:37 +0800
Subject: [PATCH] 2019-12-13-2

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

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
index 8870208..81eb56e 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -12,8 +12,8 @@
         {
             Tag = "LockLogicList";
         }
-        VerticalScrolViewLayout middle;
-        public async void Show()
+        VerticalRefreshLayout middle;
+        public void Show()
         {
 
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
@@ -27,14 +27,15 @@
 
             var titleName = new Button
             {
-                TextSize = 16,
+                TextSize = 17,
                 TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                 TextAlignment = TextAlignment.CenterLeft,
                 X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Height = Application.GetRealHeight(69),
                 Y = Application.GetRealHeight(92),
                 TextID = MyInternationalizationString.linkageevent,
+                IsBold = true,
             };
             topRowLayout.AddChidren(titleName);
 
@@ -81,10 +82,6 @@
                 Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
                 Common.Logic.CurrentLogic.LogicType = 1;
                 Common.Logic.CurrentLogic.Relationship = 1;
-                //Config.Instance.Guid鐢ㄦ潵璇嗗埆璐﹀彿韬唤锛�
-                var accounts = new System.Collections.Generic.Dictionary<string, string>();
-                accounts.Add("Account", Config.Instance.Guid);
-                Common.Logic.CurrentLogic.Accounts.Add(accounts);
                 Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
                 var lockLogicCommunalPage = new LockLogicCommunalPage();
                 UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
@@ -93,14 +90,29 @@
             };
             #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鍒楄〃
+                Common.Logic.LockLogicList.Clear();
+                Read();
+                //鍏抽棴鍒锋柊View锛�
+                middle.EndHeaderRefreshing();
+            };
+            Read();
+        }
 
+        /// <summary>
+        /// 璇诲彇鑷姩鍖栨暟鎹�
+        /// </summary>
+        public async void Read()
+        {
             CommonPage.Loading.Start();
             if (Common.Logic.LockLogicList.Count == 0)
             {
@@ -133,12 +145,13 @@
                     }
                 }
             }
-            //鑷姩鍖�
             Automationview();
             CommonPage.Loading.Hide();
         }
-
-        void Automationview()
+        /// <summary>
+        /// 鍔犺浇鑷姩鍖栧垪琛ㄧ殑鐣岄潰
+        /// </summary>
+        public void Automationview()
         {
             middle.RemoveAll();
             for (int i = 0; i < Common.Logic.LockLogicList.Count; i++)
@@ -148,7 +161,7 @@
                 {
                     Width = Application.GetRealWidth(1080),
                     Height = Application.GetRealHeight(190),
-                    LineColor = ZigbeeColor.Current.LogicBackgroundColor,
+                    LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                     BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
 
                 };
@@ -163,6 +176,7 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                     Gravity = Gravity.CenterVertical,
+                    TextSize = 15,
                 };
                 logicRowlayout.AddChidren(logicnameBtn);
 
@@ -194,6 +208,14 @@
                     Send.LogicControlSwitch(logic);
 
                 };
+                if (logic.IsEnable == 1)
+                {
+                    logicswitchBtn.IsSelected = true;
+                }
+                else if (logic.IsEnable == 0)
+                {
+                    logicswitchBtn.IsSelected = false;
+                }
                 ///缂栬緫
                 var edit = new Button
                 {
@@ -229,7 +251,7 @@
                     {
                         if (e1)
                         {
-                            Common.Logic.LogicList.Remove(logic);
+                            Common.Logic.LockLogicList.Remove(logic);
                             Automationview();
                             Send.DelLogic(logic.LogicId);
                         }

--
Gitblit v1.8.0