From df30e8562e49b45e7a9a3497d368cebd6085be87 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期一, 30 十二月 2019 17:33:33 +0800 Subject: [PATCH] 2019-12-30-2 --- ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs | 112 +++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 74 insertions(+), 38 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs index e5b4078..1335566 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs @@ -936,26 +936,37 @@ }; conditionsRowLayout.AddChidren(securitystatus); - if (conditions["EnOrWithdrawMode"] == "1") + switch (conditions["EnOrWithdrawMode"]) { - conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png"; - securitystatus.Text = Language.StringByID(MyInternationalizationString.withdrawal); - } - else - { - if (conditions["ModeId"] == "1") - { - conditionIcon.UnSelectedImagePath = "ZigeeLogic/athome.png"; - securitystatus.Text = Language.StringByID(MyInternationalizationString.logicathomegarrison); + case "0": + { + if (conditions["ModeId"] == "1") + { + conditionIcon.UnSelectedImagePath = "ZigeeLogic/athome.png"; + securitystatus.Text = Language.StringByID(MyInternationalizationString.logicathomegarrison); - } - else - { - conditionIcon.UnSelectedImagePath = "ZigeeLogic/leavehome.png"; - securitystatus.Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison); - - } + } + else + { + conditionIcon.UnSelectedImagePath = "ZigeeLogic/leavehome.png"; + securitystatus.Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison); + } + } + break; + case "1": + { + conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png"; + securitystatus.Text = Language.StringByID(MyInternationalizationString.withdrawal); + } + break; + case "2": + { + conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png"; + securitystatus.Text = Language.StringByID(MyInternationalizationString.urgentwithdrawal); + } + break; } + } break; case 7: @@ -964,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, @@ -991,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, }; @@ -1975,18 +1986,31 @@ btncustompush.MouseUpEventHandler += customclick; custompushback.MouseUpEventHandler += customclick; custompushRowLayout.MouseUpEventHandler += customclick; + bool tag = false;//鏍囪寮�鍏崇姸鎬�; btnswitch.MouseUpEventHandler += (sender1, e1) => - { - btnswitch.IsSelected = !btnswitch.IsSelected; - if (btnswitch.IsSelected) - { - custompushFrameLayout.Height = Application.GetRealHeight(160); - } - else - { - custompushFrameLayout.Height = Application.GetRealHeight(0); - } - }; + { + 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 @@ -1996,15 +2020,19 @@ 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; } - 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; @@ -2019,6 +2047,10 @@ succeed = true; Common.Logic.CurrentLogic.LogicId = logicifon.LogicId; Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); + if (tag) + { + Send.Data("娣诲姞/鏇存柊", "/App/HomeLogicConfig", "POST"); + } } } else @@ -2578,5 +2610,9 @@ { IsBackground = true }.Start(); } + + + + } } -- Gitblit v1.8.0