WJC
2019-12-30 f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -975,7 +975,7 @@
                                conditionIcon.UnSelectedImagePath = "ZigeeLogic/position.png";
                                var btnlocation = new Button
                                {
                                    Width = Application.GetRealWidth(700),
                                    Width = Application.GetRealWidth(250),
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Gravity = Gravity.CenterVertical,
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
@@ -1002,11 +1002,11 @@
                                var locationstatus = new Button
                                {
                                    Width = Application.GetRealWidth(300),
                                    Width = Application.GetRealWidth(550),
                                    Height = Application.GetRealHeight(130),
                                    Gravity = Gravity.CenterVertical,
                                    TextAlignment = TextAlignment.CenterRight,
                                    X = Application.GetRealWidth(500),
                                    X = Application.GetRealWidth(250),
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
@@ -1986,16 +1986,29 @@
            btncustompush.MouseUpEventHandler += customclick;
            custompushback.MouseUpEventHandler += customclick;
            custompushRowLayout.MouseUpEventHandler += customclick;
            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");
                      }
                }
            };
            #endregion
@@ -2010,12 +2023,13 @@
                    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;
                bool succeed = false;
@@ -2030,6 +2044,10 @@
                        succeed = true;
                        Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
                        Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
                        if (tag)
                        {
                            Send.Data("添加/更新", "/App/HomeLogicConfig", "POST");
                        }
                    }
                }
                else
@@ -2589,5 +2607,9 @@
            { IsBackground = true }.Start();
        }
    }
}