WJC
2019-12-30 f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -18,7 +18,7 @@
            Tag = "LockLogic";
        }
        EditText logicTextBox;
        public void Show(Action action)
        public async void Show(Action action)
        {
            #region  最上面的布局代码
@@ -40,6 +40,7 @@
                Height = Application.GetRealHeight(69),
                Y = Application.GetRealHeight(92),
                TextID = MyInternationalizationString.selection,
                IsBold = true,
            };
            topRowLayout.AddChidren(titleName);
            if (Common.Logic.CurrentLogic.LogicId != 0)
@@ -282,7 +283,8 @@
                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == conditions["MacAddr"] && obj.DeviceEpoint.ToString() == conditions["Epoint"]; });
                                if (deviceinof == null)
                                {
                                    continue;
                                    deviceinof = new ZigBee.Device.CommonDevice();
                                    //continue;
                                }
                                ///显示设备名称
                                var btndevice = new Button
@@ -553,7 +555,8 @@
                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == obj1) && (obj.DeviceEpoint.ToString() == obj2)); });
                                if (deviceinof == null)
                                {
                                    continue;
                                    deviceinof = new ZigBee.Device.CommonDevice();
                                    //continue;
                                }
                                ///设备名称Button
@@ -863,11 +866,33 @@
                        case 2:
                            {
                                //在本地查找该场景;
                                var sceneinof = Common.Room.AllRoomSceneUIList.Find((obj) => { return obj.Id.ToString() == actions["DeviceAddr"].ToString(); });
                                //本地没有存在;
                                if (sceneinof == null)
                                {
                                    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
                                }
                                actionsIcon.UnSelectedImagePath = "ZigeeLogic/scene.png";
                                ///设备名称Button
@@ -984,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);
@@ -1051,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
            {
@@ -1080,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;
@@ -1099,6 +1137,10 @@
                    {
                        Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
                        Common.Logic.LockLogicList.Add(Common.Logic.CurrentLogic);
                        if (tag)
                        {
                            Send.Data("添加/更新", "/App/HomeLogicConfig", "POST");
                        }
                    }
                }
                else