From f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 30 十二月 2019 13:32:33 +0800
Subject: [PATCH] 2019-12-30-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs |   90 +++++++++++++++++++++++++++++++++------------
 1 files changed, 66 insertions(+), 24 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
index d15eb32..e4fcfca 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -18,7 +18,7 @@
             Tag = "LockLogic";
         }
         EditText logicTextBox;
-        public void Show(Action action)
+        public async void Show(Action action)
         {
 
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
@@ -40,6 +40,7 @@
                 Height = Application.GetRealHeight(69),
                 Y = Application.GetRealHeight(92),
                 TextID = MyInternationalizationString.selection,
+                IsBold = true,
             };
             topRowLayout.AddChidren(titleName);
             if (Common.Logic.CurrentLogic.LogicId != 0)
@@ -282,7 +283,8 @@
                                 var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == conditions["MacAddr"] && obj.DeviceEpoint.ToString() == conditions["Epoint"]; });
                                 if (deviceinof == null)
                                 {
-                                    continue;
+                                    deviceinof = new ZigBee.Device.CommonDevice();
+                                    //continue;
                                 }
                                 ///鏄剧ず璁惧鍚嶇О
                                 var btndevice = new Button
@@ -553,7 +555,8 @@
                                 var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == obj1) && (obj.DeviceEpoint.ToString() == obj2)); });
                                 if (deviceinof == null)
                                 {
-                                    continue;
+                                    deviceinof = new ZigBee.Device.CommonDevice();
+                                    //continue;
                                 }
 
                                 ///璁惧鍚嶇ОButton
@@ -863,11 +866,33 @@
                         case 2:
                             {
 
+                                //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙;
                                 var sceneinof = Common.Room.AllRoomSceneUIList.Find((obj) => { return obj.Id.ToString() == actions["DeviceAddr"].ToString(); });
+                                //鏈湴娌℃湁瀛樺湪;
                                 if (sceneinof == null)
                                 {
-                                    continue;
+                                    //瀹炵幇鐩殑:鏄剧ず鍑烘潵璁╁彲浠ヨ嚜宸辨槸鍚﹀垹闄�
+                                    sceneinof = new SceneUI();
+                                    #region -----
+                                    ////鍦ㄧ綉鍏虫煡鎵捐鍦烘櫙;
+                                    ////鏍囪闂:缃戠粶璇锋眰锛屽瓨鍦ㄨ鍥惧姞杞藉揩鎱㈢殑闂锛�
+                                    //sceneinof = await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString()));
+                                    ////缃戝叧娌℃湁瀛樺湪;
+                                    //if (sceneinof == null)
+                                    //{
+                                    //    //娉ㄨВ:鏈湴鍜岀綉鍏抽兘涓嶅瓨鍦ㄨ鍦烘櫙,鐣岄潰灏嗕笉浼氭樉绀鸿鍦烘櫙;
+                                    //    //sceneinof = new SceneUI();
+                                    //    //绉婚櫎璇ュ満鏅暟鎹�;
+                                    //    Common.Logic.CurrentLogic.Actions.Remove(actions);
+                                    //    //绉婚櫎璇ュ満鏅鍥�;
+                                    //    devicesFrameLayout.RemoveFromParent();
+                                    //    continue;
+                                    //}
+                                    #endregion
                                 }
+
+
+
 
                                 actionsIcon.UnSelectedImagePath = "ZigeeLogic/scene.png";
                                 ///璁惧鍚嶇ОButton
@@ -984,23 +1009,11 @@
                 Gravity = Gravity.CenterVertical,
             };
             pushswitchRowlayout.AddChidren(btnswitch);
-            btnswitch.MouseUpEventHandler += (sender1, e1) =>
-            {
-                btnswitch.IsSelected = !btnswitch.IsSelected;
-                if (btnswitch.IsSelected)
-                {
-
-                }
-                else
-                {
-
-                }
-            };
-
+           
 
             var custompushFrameLayout = new FrameLayout
             {
-                Height = Application.GetRealHeight(160),
+                Height = Application.GetRealHeight(0),
                 BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
             };
             middle.AddChidren(custompushFrameLayout);
@@ -1051,6 +1064,31 @@
 
             #endregion
 
+            bool tag = false;//鏍囪寮�鍏崇姸鎬�;
+            btnswitch.MouseUpEventHandler += (sender1, e1) =>
+            {
+                btnswitch.IsSelected = !btnswitch.IsSelected;
+                if (btnswitch.IsSelected)
+                {
+                    tag = true;
+                    custompushFrameLayout.Height = Application.GetRealHeight(160);
+                    if (Common.Logic.CurrentLogic.LogicId != 0)
+                    {
+                        Send.Data("娣诲姞/鏇存柊", "/App/HomeLogicConfig", "POST");
+                    }
+
+                }
+                else
+                {
+                    tag = false;
+                    custompushFrameLayout.Height = Application.GetRealHeight(0);
+                    if (Common.Logic.CurrentLogic.LogicId != 0)
+                    {
+                        Send.Data("鍒犻櫎", "/App/DelHomeLogicConfig", "POST");
+                    }
+
+                }
+            };
 
             var saveFrameLayout = new FrameLayout
             {
@@ -1080,12 +1118,12 @@
                     new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show();
                     return;
                 }
-                var logicname = Common.Logic.LockLogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name);
-                if (logicname != null)
-                {
-                    new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show();
-                    return;
-                }
+                //var logicname = Common.Logic.LockLogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name);
+                //if (logicname != null)
+                //{
+                //    new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show();
+                //    return;
+                //}
 
                 Common.Logic.CurrentLogic.LogicName = name;
 
@@ -1099,6 +1137,10 @@
                     {
                         Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
                         Common.Logic.LockLogicList.Add(Common.Logic.CurrentLogic);
+                        if (tag)
+                        {
+                            Send.Data("娣诲姞/鏇存柊", "/App/HomeLogicConfig", "POST");
+                        }
                     }
                 }
                 else

--
Gitblit v1.8.0