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/TemplatePage.cs |   39 ++++++++++++++++++++++++++++-----------
 1 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
index 0bb6882..78ee519 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
@@ -109,7 +109,7 @@
                 Height = Application.GetRealHeight(436),
                 X = Application.GetRealWidth(72),
                 Y = Application.GetRealHeight(30),
-                UnSelectedImagePath = "ZigeeLogic/logicbj" + s + ".png",
+                UnSelectedImagePath = $"ZigeeLogic/logicbj{s}.png",
             };
             logiciconfl.AddChidren(iconBtn);
 
@@ -298,11 +298,11 @@
                     var addtextbtn = new Button
                     {
                         Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(300),
+                        Width = Application.GetRealWidth(400),
                         Y = Application.GetRealHeight(45 + 30),
                         TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                         TextID = MyInternationalizationString.addsensor,
-                        X = Application.GetRealWidth(390),
+                        X = Application.GetRealWidth(340),
                         TextSize = 14,
                     };
                     addfl.AddChidren(addtextbtn);
@@ -612,11 +612,11 @@
                     var addtextbtn = new Button
                     {
                         Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(300),
+                        Width = Application.GetRealWidth(400),
                         Y = Application.GetRealHeight(45 + 30),
                         TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                         TextID = MyInternationalizationString.addlighting,
-                        X = Application.GetRealWidth(390),
+                        X = Application.GetRealWidth(340),
                         TextSize = 14,
                     };
                     addfl.AddChidren(addtextbtn);
@@ -1195,16 +1195,29 @@
 
             #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
@@ -1238,12 +1251,12 @@
                     new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show();
                     return;
                 }
-                var logicname = Common.Logic.LogicList.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.LogicList.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;
 
@@ -1257,6 +1270,10 @@
                     {
                         Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
                         Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
+                        if (tag)
+                        {
+                            Send.Data("娣诲姞/鏇存柊", "/App/HomeLogicConfig", "POST");
+                        }
                     }
                 }
                 else

--
Gitblit v1.8.0