From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 28 二月 2020 15:25:13 +0800 Subject: [PATCH] 2020.2.28 --- ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs | 80 +++++++++++++++++++++------------------ 1 files changed, 43 insertions(+), 37 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs index 78ee519..9231d7a 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs @@ -494,21 +494,18 @@ 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 templatePage = new TemplatePage(); - UserView.HomePage.Instance.AddChidren(templatePage); - UserView.HomePage.Instance.PageIndex += 1; - templatePage.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 templatePage = new TemplatePage(); + UserView.HomePage.Instance.AddChidren(templatePage); + UserView.HomePage.Instance.PageIndex += 1; + templatePage.Show(); + }; }; @@ -996,20 +993,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.Actions.Remove(actions); - var templatePage = new TemplatePage(); - UserView.HomePage.Instance.AddChidren(templatePage); - UserView.HomePage.Instance.PageIndex += 1; - templatePage.Show(); - } - }; + + var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, + Language.StringByID(MyInternationalizationString.doyouwanttodelete), + Language.StringByID(MyInternationalizationString.confrim)); alert.Show(); + alert.ConfirmClickEvent += () => + { + Common.Logic.CurrentLogic.Actions.Remove(actions); + var templatePage = new TemplatePage(); + UserView.HomePage.Instance.AddChidren(templatePage); + UserView.HomePage.Instance.PageIndex += 1; + templatePage.Show(); + }; }; @@ -1203,23 +1199,30 @@ { 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); + } var saveFrameLayout = new FrameLayout { Y = middle.Bottom, @@ -1248,7 +1251,10 @@ //} 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; } //var logicname = Common.Logic.LogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name); @@ -1272,7 +1278,7 @@ Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); if (tag) { - Send.Data("娣诲姞/鏇存柊", "/App/HomeLogicConfig", "POST"); + Send.Zj(tag, Common.Logic.CurrentLogic); } } } -- Gitblit v1.8.0