wxr
2023-03-30 8407d6631ac8f5b65c4a14fa27babaa48026d4ca
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -619,7 +619,25 @@
                        }
                    }
                    break;
                //萤石视频门锁
                case SPK.VideoDoorLock:
                    {
                        LogicView.FunTypeView view1 = new LogicView.FunTypeView();
                        view1.btnText.TextID=StringId.yonghurenyuan;
                        view1.btnText.Name = Language.StringByID(StringId.shipinmensuo);
                        fLayout.AddChidren(view1.FLayoutView());
                        view1.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            this.identifier = "open_door";//开锁事件
                            this.VideoDoorLockAction(this, device, view1.btnState);
                        };
                        if (edit)
                        {
                            this.GetEditState(device, index, view1.btnState,null, null, null);
                        }
                    }
                    break;
            }
            #region  保存
            ///保存View
@@ -669,6 +687,12 @@
                        //condition默认[]
                        inputDevice.condition = new List<Dictionary<string, string>>();
                    }
                }
                else if (device.spk == SPK.VideoDoorLock)
                {
                    ////萤石视频门锁
                    inputDevice.condition_type = "9";
                    inputDevice.identifier = this.identifier;
                }
@@ -1045,7 +1069,7 @@
            {
                try
                {
                   var faceIDList = Send.Current.GetListHomeFace(device.deviceId,true);
                    var faceIDList = Send.Current.GetListHomeFace(device.deviceId, true);
                    List<string> faceNameList = new List<string>();
                    for (int i = 0; i < faceIDList.Count; i++)
                    {
@@ -1070,6 +1094,65 @@
                    });
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                    });
                }
            });
        }
        /// <summary>
        /// 萤石视频门锁专用
        /// </summary>
        /// <param name="frame">当前界面</param>
        /// <param name="device">当前设备</param>
        /// <param name="btnState">旧状态</param>
        public void VideoDoorLockAction(FrameLayout frame, Entity.Function device, Button btnState)
        {
            selectedState = device.spk + "_";
            Loading loading = new Loading();
            frame.AddChidren(loading);
            loading.Start();
            System.Threading.Tasks.Task.Run(() =>
            {
                try
                {
                    var userList =FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetVideoDoorLockUserListInfo(device);
                    List<string> userNameList = new List<string>();
                    for (int i = 0; i < userList.Count; i++)
                    {
                        var user = userList[i];
                        userNameList.Add(user.extUserName);
                    }
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        PublicInterface publicInterface = new PublicInterface();//用户界面
                        publicInterface.FrameOrVv(this, userNameList, new List<string> { btnState.Text }, device.name, (index) =>
                        {
                            var userId = userNameList[index];
                            //界面显示选中值
                            btnState.Text = userId;
                            //数据封装
                            AddDictionary("open_user", userId, "string");
                        }, false);
                    });
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                    });
                }
            });