gxc
2020-01-10 b9cb076fe6127160c96c35bf9c8cebcffe1d5ccd
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -1040,20 +1040,19 @@
                    del.MouseUpEventHandler += (sender, e) =>
                    {
                        var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                                              Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
                        alert.ResultEventHandler += (sender1, e1) =>
                        {
                            if (e1)
                            {
                                Common.Logic.CurrentLogic.Conditions.Remove(conditions);
                                var logicCommunalPage = new LogicCommunalPage();
                                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                                UserView.HomePage.Instance.PageIndex += 1;
                                logicCommunalPage.Show(() => { });
                            }
                        };
                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
                        Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                        Language.StringByID(MyInternationalizationString.confrim));
                        alert.Show();
                        alert.ConfirmClickEvent += () =>
                        {
                            Common.Logic.CurrentLogic.Conditions.Remove(conditions);
                            var logicCommunalPage = new LogicCommunalPage();
                            UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                            UserView.HomePage.Instance.PageIndex += 1;
                            logicCommunalPage.Show(() => { });
                        };
                    };
@@ -1790,21 +1789,19 @@
                    del.MouseUpEventHandler += (sender, e) =>
                    {
                        var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                                               Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
                        alert.ResultEventHandler += (sender1, e1) =>
                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
                       Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                       Language.StringByID(MyInternationalizationString.confrim));
                       alert.Show();
                        alert.ConfirmClickEvent += () =>
                        {
                            if (e1)
                            {
                                Common.Logic.CurrentLogic.Actions.Remove(actions);
                                // devicesFrameLayout.RemoveFromParent();
                                var logicCommunalPage = new LogicCommunalPage();
                                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                                UserView.HomePage.Instance.PageIndex += 1;
                                logicCommunalPage.Show(() => { });
                            }
                            Common.Logic.CurrentLogic.Actions.Remove(actions);
                            // devicesFrameLayout.RemoveFromParent();
                            var logicCommunalPage = new LogicCommunalPage();
                            UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                            UserView.HomePage.Instance.PageIndex += 1;
                            logicCommunalPage.Show(() => { });
                        };
                        alert.Show();
                    };
@@ -1987,30 +1984,37 @@
            custompushback.MouseUpEventHandler += customclick;
            custompushRowLayout.MouseUpEventHandler += customclick;
            bool tag = false;//标记开关状态;
            btnswitch.MouseUpEventHandler += (sender1, e1) =>
            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");
                      }
                      Common.Logic.CurrentLogic.LogicIsCustomPushText = 1;
                  }
                  else
                  {
                      tag = false;
                      custompushFrameLayout.Height = Application.GetRealHeight(0);
                      if (Common.Logic.CurrentLogic.LogicId != 0)
                      {
                          Send.Data("删除", "/App/DelHomeLogicConfig", "POST");
                      }
                      Common.Logic.CurrentLogic.LogicIsCustomPushText = 0;
                  }
                  Send.Zj(tag,Common.Logic.CurrentLogic);
              };
            if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0)
            {
                tag = false;
                btnswitch.IsSelected = false;
                custompushFrameLayout.Height = Application.GetRealHeight(0);
            }
            else
            {
                tag = true;
                btnswitch.IsSelected = true;
                custompushFrameLayout.Height = Application.GetRealHeight(160);
            }
            #endregion
@@ -2020,7 +2024,10 @@
                var name = logicTextBox.Text.Trim();
                if (string.IsNullOrEmpty(logicTextBox.Text.Trim()))
                {
                    new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show();
                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
                      Language.StringByID(MyInternationalizationString.PleaseEnterLogicName),
                      Language.StringByID(MyInternationalizationString.confrim));
                    alert.Show();
                    return;
                }
                ///先隐藏判断名字相同的功能;
@@ -2046,7 +2053,7 @@
                        Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
                        if (tag)
                        {
                            Send.Data("添加/更新", "/App/HomeLogicConfig", "POST");
                            Send.Zj(tag, Common.Logic.CurrentLogic);
                        }
                    }
                }