From a0b77501012265c4638c9f49ccfd1e6cd0f71a45 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 09 三月 2023 18:44:00 +0800
Subject: [PATCH] 2023年03月09日18:43:53

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs |   65 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
index 6094f4a..3e8e461 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -618,7 +618,24 @@
                         }
                     }
                     break;
-                    
+                //钀ょ煶瑙嗛闂ㄩ攣
+                case SPK.VideoDoorLock:
+                    {
+                        LogicView.FunTypeView view1 = new LogicView.FunTypeView();
+                        view1.btnText.Text = "鐢ㄦ埛浜哄憳";// StringId.shipintonghuahujiao;
+                        view1.btnText.Name = Language.StringByID(StringId.shipinmensuo);
+                        fLayout.AddChidren(view1.FLayoutView());
+                        view1.btnClick.MouseUpEventHandler += (sender, e) =>
+                        {
+                            this.VideoDoorLockAction(this, device, view1.btnState);
+                        };
+                        if (edit)
+                        {
+                            this.GetEditState(device, index, view1.btnState,null, null, null);
+                        }
+                    }
+                    break;
+
             }
             #region  淇濆瓨
             ///淇濆瓨View
@@ -1075,6 +1092,52 @@
         }
 
         /// <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 = Send.Current.GetVideoDoorLockUserIdList(device.deviceId, true);
+                    List<string> userIdList = new List<string>();
+                    for (int i = 0; i < userList.Count; i++)
+                    {
+                        var user = userList[i];
+                        userIdList.Add(user.userName);
+                    }
+                    Application.RunOnMainThread(() =>
+                    {
+                        loading.Hide();
+                        PublicInterface publicInterface = new PublicInterface();
+                        publicInterface.FrameOrVv(this, userIdList, new List<string> { btnState.Text }, device.name, (index) =>
+                        {
+                            var userId = userIdList[index];
+                            //鐣岄潰鏄剧ず閫変腑鍊�
+                            btnState.Text = userId;
+                            //鏁版嵁灏佽
+                            AddDictionary("open_type", "1", "integer");
+                            AddDictionary("user_id", userId, "string");
+
+                        }, false);
+
+                    });
+                }
+                catch { }
+
+            });
+
+        }
+
+        /// <summary>
         /// 鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬�
         /// </summary>
         /// <param name="device">缂栬緫璁惧</param>

--
Gitblit v1.8.0