黄学彪
2019-12-30 3dcbd186c42c598c0c08d1cd37034cf2baa09e54
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -871,20 +871,24 @@
                                //本地没有存在;
                                if (sceneinof == null)
                                {
                                    //在网关查找该场景;
                                    sceneinof = await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString()));
                                    //网关没有存在;
                                    if (sceneinof == null)
                                    {
                                        //注解:本地和网关都不存在该场景,界面将不会显示该场景;
                                        //sceneinof = new SceneUI();
                                        //移除该场景数据;
                                        Common.Logic.CurrentLogic.Actions.Remove(actions);
                                        //移除该场景视图;
                                        devicesFrameLayout.RemoveFromParent();
                                        continue;
                                    }
                                    //实现目的:显示出来让可以自己是否删除
                                    sceneinof = new SceneUI();
                                    #region -----
                                    ////在网关查找该场景;
                                    ////标记问题:网络请求,存在视图加载快慢的问题;
                                    //sceneinof = await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString()));
                                    ////网关没有存在;
                                    //if (sceneinof == null)
                                    //{
                                    //    //注解:本地和网关都不存在该场景,界面将不会显示该场景;
                                    //    //sceneinof = new SceneUI();
                                    //    //移除该场景数据;
                                    //    Common.Logic.CurrentLogic.Actions.Remove(actions);
                                    //    //移除该场景视图;
                                    //    devicesFrameLayout.RemoveFromParent();
                                    //    continue;
                                    //}
                                    #endregion
                                }
@@ -1005,23 +1009,11 @@
                Gravity = Gravity.CenterVertical,
            };
            pushswitchRowlayout.AddChidren(btnswitch);
            btnswitch.MouseUpEventHandler += (sender1, e1) =>
            {
                btnswitch.IsSelected = !btnswitch.IsSelected;
                if (btnswitch.IsSelected)
                {
                }
                else
                {
                }
            };
            var custompushFrameLayout = new FrameLayout
            {
                Height = Application.GetRealHeight(160),
                Height = Application.GetRealHeight(0),
                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
            };
            middle.AddChidren(custompushFrameLayout);
@@ -1072,6 +1064,31 @@
            #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
            {
@@ -1101,12 +1118,12 @@
                    new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show();
                    return;
                }
                var logicname = Common.Logic.LockLogicList.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.LockLogicList.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;
@@ -1120,6 +1137,10 @@
                    {
                        Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
                        Common.Logic.LockLogicList.Add(Common.Logic.CurrentLogic);
                        if (tag)
                        {
                            Send.Data("添加/更新", "/App/HomeLogicConfig", "POST");
                        }
                    }
                }
                else