WJC
2020-04-02 94e4e5b9fd3da964c44b7b14227d6fe2bbb426d7
ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -341,7 +341,7 @@
                        deviceTypeList.Add(DeviceType.Thermostat);
                        deviceTypeList.Add(DeviceType.AirSwitch);
                        ///门锁特殊
                        deviceTypeList.Add(DeviceType.DoorLock);
                       // deviceTypeList.Add(DeviceType.DoorLock);
                    }
                    break;
                case "condition_mould":
@@ -363,7 +363,7 @@
                        deviceTypeList.Add(DeviceType.Thermostat);
                        deviceTypeList.Add(DeviceType.AirSwitch);
                        ///门锁特殊
                        deviceTypeList.Add(DeviceType.DoorLock);
                      // deviceTypeList.Add(DeviceType.DoorLock);
                    }
                    break;
@@ -719,9 +719,16 @@
        /// <param name="CurrentLogic">当前逻辑</param>
        public async static void SaveLogic(string if_logic, string name, bool tag, Common.Logic CurrentLogic)
        {
            //记录逻辑类型
            //只是对跳转界面有用,基本没啥用
            int Type = CurrentLogic.LogicType;
            if (CurrentLogic.Conditions.Count == 0 || CurrentLogic.Actions.Count == 0)
            {
                var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
                  Language.StringByID(MyInternationalizationString.addnull),
                  Language.StringByID(MyInternationalizationString.confrim));
                alert.Show();
                return;
            }
            if (string.IsNullOrEmpty(name))
            {
                var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
@@ -750,7 +757,17 @@
                {
                    succeed = true;
                    CurrentLogic.LogicId = logicifon.LogicId;
                    Common.Logic.LogicList.Add(CurrentLogic);
                    if (LogicView.IfString._LockLogic == if_logic)
                    {
                        //门锁联动事件逻辑列表
                        Common.Logic.LockLogicList.Add(CurrentLogic);
                    }
                    else
                    {
                        //自动化逻辑列表
                        Common.Logic.LogicList.Add(CurrentLogic);
                    }
                    if (tag)
                    {
                        Send.Zj(tag, CurrentLogic);
@@ -779,15 +796,14 @@
            if (LogicView.IfString._Logic == if_logic)
            {
                if (Type == 0)
                UserView.HomePage.Instance.RemoveViewByTag("Logic");
                if (CurrentLogic.LogicType == 0)
                {
                    UserView.HomePage.Instance.RemoveViewByTag("Logic");
                    //只刷新分类上下滑动view;
                    Phone.Category.CategoryMainForm.instance?.RefreshBodyView();
                    // Category.Category.instance?.RefreshBodyView();
                }
                else if (Type == 2)
                else if (CurrentLogic.LogicType == 2)
                {
                    //刷新整个分类;
                    //门锁常开模式特殊;
@@ -797,7 +813,8 @@
            }
            else if (LogicView.IfString._LockLogic == if_logic)
            {
                UserView.HomePage.Instance.RemoveViewByTag("Logic");
                UserView.HomePage.Instance.RemoveViewByTag("Logic");//移除所有标记Logic界面
                UserView.HomePage.Instance.RemoveViewByTag("LockListView");//移除所有标记LockListView界面
                var doorLockLogicList = new DoorLockLogic.LockLogicList();
                UserView.HomePage.Instance.AddChidren(doorLockLogicList);
                UserView.HomePage.Instance.PageIndex += 1;
@@ -818,6 +835,7 @@
            deviceTarget.Show(str1, str2);
        }
    }
}