From 23532fa8ad34c89b6d24b01eaef6475fd0aad898 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 15 四月 2020 18:08:24 +0800
Subject: [PATCH] ???????

---
 ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs |  121 +++++++++++++++++-----------------------
 1 files changed, 51 insertions(+), 70 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
index 78b35c0..fd00287 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
@@ -345,6 +345,9 @@
         /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈�
         /// </summary>
         /// <param name="refresview">Refresview.</param>
+        
+        static  RowLayout selectedRow = new RowLayout() { Tag="0"};//璁板綍宸︽粦鐘舵��
+        
         private static async void Automationview(VerticalRefreshLayout refresview, bool no)
         {
             refresview.RemoveAll();
@@ -363,8 +366,8 @@
                 var noIconBtn = new Button
                 {
                     Y = Application.GetRealHeight(294 - 55),
-                    Width = Application.GetMinRealAverage(756),
-                    Height = Application.GetMinRealAverage(434),
+                    Width = Application.GetMinRealAverage(757),
+                    Height = Application.GetMinRealAverage(435),
                     UnSelectedImagePath = "Item/NoFunction.png",
                     X = Application.GetRealWidth(104),
                 };
@@ -417,17 +420,27 @@
                     LineColor = ZigbeeColor.Current.LogicBackgroundColor,
                     BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                     SubViewWidth = Application.GetRealWidth(184),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
+                    Tag = i.ToString(),
 
                 };
                 fLayout.AddChidren(logicRowlayout);
+                //宸︽粦鑿滃崟浜嬩欢
+                logicRowlayout.OpenMenuAction += () =>
+                {
+                    if (selectedRow.Tag.ToString() != logicRowlayout.Tag.ToString())
+                    {   //淇濈暀宸︽粦鍙湁涓�涓�;
+                        selectedRow.HideMenu();//
+                    }
+                    selectedRow = logicRowlayout;
+                };
                 if (i == 1)
                 {
                     //瀹炵幇android鏄剧ず閫昏緫鍒楄〃鐨勫渾瑙�;
                     fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
                     logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-                    i = 2;
+                   
                 }
-
+                i++;
                 var logicnameBtn = new Button
                 {
                     Height = Application.GetRealHeight(58),
@@ -750,77 +763,45 @@
             }
             return false;//琛ㄧず娣诲姞澶辫触;
 
-        }
-
-        ///<summary>
-        /// s-one闂ㄩ攣鏄惁瀛樺湪鑷姩鍖栫殑鏂规硶(true涓哄瓨鍦�)
-        /// </summary>
-        public static async System.Threading.Tasks.Task<bool> Exist(int valueInt = 2)
-        {
-            bool exist = false;
-            var Idlist = await Send.GetLogicId(valueInt);
-            if (Idlist.Count != 0)
-            {
+        }
+
+		///<summary>
+		/// s-one闂ㄩ攣鏄惁瀛樺湪鑷姩鍖栫殑鏂规硶;
+		/// 娉ㄦ剰锛堝弬鏁�2锛�3锛夛細valueInt=3鏄垹闄よ缃け鏁堟椂闂磋嚜鍔ㄥ寲锛泇alueInt=2鍒ゆ柇鏄惁瀛樺湪鑷姩鍖栵紱
+		/// 杩斿洖鍊硷細0涓嶅瓨鍦�;1瀛樺湪;2鍒犻櫎鎴愬姛;3鍒犻櫎澶辫触;
+		/// </summary>
+		public static async System.Threading.Tasks.Task<int> Exist(int valueInt = 2)
+        {
+            int exist = 0;
+            var Idlist = await Send.GetLogicId(valueInt);
+            if (Idlist.Count != 0)
+            {
                 if (valueInt == 3)
-                {
-                    for (int i = 0; i < Idlist.Count; i++)
-                    {
-                        //valueInt=3涓�鏉$壒娈婄殑鑷姩鍖�(鐢ㄦ潵璁剧疆澶辨晥鏃堕棿)
-                        Send.DelLogic(Idlist[i]);
-                    }
-                }
-                exist = true;
+                {
+                    for (int i = 0; i < Idlist.Count; i++)
+                    {
+                        //valueInt=3涓�鏉$壒娈婄殑鑷姩鍖�(鐢ㄦ潵璁剧疆澶辨晥鏃堕棿)
+                        var d=await Send.DelLogic(Idlist[i]);
+						if (d != 0)
+						{
+							//鍒犻櫎鎴愬姛
+							exist = 2;
+						}
+						else
+						{
+							//鍒犻櫎澶辫触
+							exist = 3;
+						}
+						return exist;
+
+					}
+				}
+                exist = 1;
             }
             return exist;
         }
 
-        ///<summary>
-        /// s-one闂ㄩ攣纭鍙栨秷(浣挎弧瓒虫潯浠舵墍鏈夐�昏緫澶辫兘涓�娆�)鍙戦�佺殑鏂规硶
-        /// </summary>
-        public static async void LockCloseLogic(CommonDevice common)
-        {
-            //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
-            int h = int.Parse(DateTime.Now.ToString("HH"));
-            int m = int.Parse(DateTime.Now.ToString("mm"));
-            //杞寲涓哄灏戝垎閽�;
-            int s = h * 60 + m;
-            var logicList = new List<Common.Logic>();
-            logicList.Clear();
-            var Idlist = await Send.GetLogicId(2);
-            if (Idlist.Count != 0)
-            {   //鍏堝幓璇诲彇缃戝叧鐪嬫槸鍚﹀瓨鍦ㄦ暟鎹�;
-                var list = await Send.ReadList(Idlist.Count, 2);
-                for (int j = 0; j < list.Count; j++)
-                {
-                    var logic = list[j];
-                    foreach (var conditions in logic.Conditions)
-                    {
-                        var linkType = conditions["Type"];
-                        if (linkType == "5")
-                        {
-                            int startMin = int.Parse(conditions["StartMin"]);
-                            int startHour = int.Parse(conditions["StartHour"]);
-                            int stopMin = int.Parse(conditions["StopMin"]);
-                            int stopHour = int.Parse(conditions["StopHour"]);
-                            int s1 = startMin + startHour * 60;//寮�濮嬫椂闂村��
-                            int s2 = stopMin + stopHour * 60;//缁撴潫鏃堕棿鍊�
-                            if (s >= s1 && s <= s2)
-                            {
-                                //鏌ユ壘绯荤粺鏃堕棿鍊兼槸鍚﹀睘浜庤繖涓寖鍥达紱
-                                logicList.Add(logic);
-                            }
-                        }
-                    }
-
-                }
-            }
-            foreach (var logic in logicList)
-            {
-                logic.IsEnable = 3;//鏀瑰彉閫昏緫浣胯兘鐘舵��;
-                //鐢╢oreach鍙戦�佸懡浠わ紱
-                Send.AddModifyLogic(logic);
-            }
-        }
+     
     }
 }
 

--
Gitblit v1.8.0