From 1b56157e8edc3f502810820d99b607e3629c7171 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 19 七月 2023 09:42:00 +0800
Subject: [PATCH] Merge branch 'Dev-Branch' into wjc

---
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs |  198 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 198 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs
new file mode 100644
index 0000000..f1b120c
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs
@@ -0,0 +1,198 @@
+锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.Common;
+using HDL_ON.DAL.Server;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock
+{
+    public class VideoDoorlockUserListPage : FrameLayout
+    {
+        FrameLayout bodyView;
+        VerticalScrolViewLayout contentView;
+
+        Function device;
+
+        List<VideoDoorlockUser> userList;
+
+        public VideoDoorlockUserListPage(Function function)
+        {
+            bodyView = this;
+            device = function;
+            userList = new List<VideoDoorlockUser>();
+        }
+
+        public void LoadPage()
+        {
+            new TopViewDiv(bodyView, Language.StringByID(StringId.UserManagement)).LoadTopView();
+            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
+
+
+            contentView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(64),
+                Height = Application.GetRealHeight(667 - 70),
+            };
+            bodyView.AddChidren(contentView);
+
+            var waitPage = new Loading();
+            bodyView.AddChidren(waitPage);
+            waitPage.Start("");
+
+            new System.Threading.Thread(() => {
+                try
+                {
+                    var pack = ApiUtlis.Ins.HttpRequest.GetDoorlockUserList(device.deviceId);
+                    if (pack != null)
+                    {
+                        if (pack.Code == StateCode.SUCCESS)
+                        {
+                            userList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<VideoDoorlockUser>>(pack.Data.ToString());
+                            if (userList != null)
+                            {
+                                Application.RunOnMainThread(() => {
+                                    initView();
+                                });
+                            }
+                        }
+                        else
+                        {
+                            Application.RunOnMainThread(() =>
+                            {
+                                IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                            });
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    MainPage.Log($"鑾峰彇闂ㄩ攣鐢ㄦ埛寮傚父:{ex.Message}");
+                }
+                finally
+                {
+                    Application.RunOnMainThread(() =>
+                    {
+                        waitPage.Hide();
+                    });
+                }
+            })
+            { IsBackground = true }.Start();
+
+
+        }
+
+
+        void initView()
+        {
+            contentView.RemoveAll();
+
+            foreach (var user in userList)
+            {
+                contentView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
+
+                var row = new FrameLayout()
+                {
+                    Gravity = Gravity.CenterHorizontal,
+                    Height = Application.GetRealHeight(50),
+                    Radius = (uint)Application.GetRealWidth(12),
+                    BackgroundColor = CSS_Color.MainBackgroundColor,
+                    Width = Application.GetRealWidth(343),
+                };
+                contentView.AddChidren(row);
+
+                var btnRight = new Button()
+                {
+                    X = Application.GetRealWidth(307),
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetMinRealAverage(16),
+                    Height = Application.GetMinRealAverage(16),
+                    UnSelectedImagePath = "Public/Right.png",
+                };
+                row.AddChidren(btnRight);
+
+                var btnName = new Button()
+                {
+                    X = Application.GetRealWidth(12),
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    Text = user.lockUserName
+                };
+                row.AddChidren(btnName);
+
+                btnName.MouseUpEventHandler = (sender, e) => {
+                    var page = new VideoDoorlockUserManagerPage(device, user);
+                    page.delCallBackAction = () => {
+                        userList.Remove(user);
+                        initView();
+                    };
+                    MainPage.BasePageView.AddChidren(page);
+                    page.LoadPage();
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                };
+            }
+
+
+        }
+
+
+    }
+
+    public class VideoDoorlockUser
+    {
+        /// <summary>
+        ///  寮�濮嬫椂闂�    integer(int32)
+        /// </summary>
+        public string beginTime;
+        /// <summary>
+        /// 鎰熷簲鍗″瘑鐮佹暟閲� integer(int32)
+        /// </summary>
+        public int cardCount;
+        /// <summary>
+        /// 缁撴潫鏃堕棿    integer(int32)
+        /// </summary>
+        public int endTime;
+        /// <summary>
+        ///  鏄惁杩囨湡    integer(int32)
+        /// </summary>
+        public string expiredEnable;
+        /// <summary>
+        ///  闂ㄩ攣鐢ㄦ埛id  string
+        /// </summary>
+        public string extUserId;
+        /// <summary>
+        ///        string
+        /// </summary>
+        public string extUserName;
+        /// <summary>
+        ///  浜鸿劯瀵嗙爜鏁伴噺 integer(int32)
+        /// </summary>
+        public int faceCount;
+        /// <summary>
+        ///  鎸囩汗瀵嗙爜鏁伴噺  integer(int32)
+        /// </summary>
+        public int fingerCount;
+        /// <summary>
+        /// 鐢ㄦ埛澶囨敞鍚�   string
+        /// </summary>
+        public string lockRemarkName;
+        /// <summary>
+        ///  閿佺敤鎴风被鍨�// 0-涓荤敤鎴凤紝1-鏅�氱敤鎴�	integer(int32)
+        /// </summary>
+        public int lockType;
+        /// <summary>
+        ///  闂ㄩ攣鐢ㄦ埛id string
+        /// </summary>
+        public string lockUserIndex;
+        /// <summary>
+        /// 鐢ㄦ埛鍚� string
+        /// </summary>
+        public string lockUserName;
+        /// <summary>
+        /// 鏁板瓧瀵嗙爜鏁伴噺 integer(int32)
+        /// </summary>
+        public int pwdCount;
+    }
+}

--
Gitblit v1.8.0