From 203c3a3ffde6259413d9743f6a723b95b1e7989c Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 06 七月 2023 22:43:05 +0800
Subject: [PATCH] 门锁功能

---
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs |  115 +++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 90 insertions(+), 25 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
index c9eec3f..868b44f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -214,11 +214,19 @@
                 TextAlignment = TextAlignment.Center,
                 UnSelectedImagePath = "FunctionIcon/DoorLock/Cell.png",
             };
-            cellFrame.AddChidren(btnCell); 
+            cellFrame.AddChidren(btnCell);
 
 
-             //闂ㄩ攣鐘舵��
-             btnDoorLockIcon = new Button
+#if __IOS__
+//btnCell.Padding = new Padding(0,0,0,0);
+            btnCell.Width += 5;
+            cellFrame.Width += 5;
+#else
+#endif
+
+
+            //闂ㄩ攣鐘舵��
+            btnDoorLockIcon = new Button
             {
                 X = Application.GetRealWidth(65),
                 Y = Application.GetRealHeight(108),
@@ -231,36 +239,63 @@
 
             this.CalculatedPosition();//閲嶆柊璁$畻瀹藉害
 
-            int heightY = btnDoorLockIcon.Bottom + Application.GetRealHeight(70);
+            var btnDoorlockStatus = new Button()
+            {
+                Width = Application.GetRealWidth(200),
+                Height = Application.GetRealHeight(62),
+                Y = btnDoorLockIcon.Bottom,
+                TextAlignment = TextAlignment.Center,
+                Gravity = Gravity.CenterHorizontal,
+                TextID = StringId.DoorlockOpen,
+                TextColor = CSS_Color.WarningColor,
+                TextSize = 16,
+            };
+            whiteFl.AddChidren(btnDoorlockStatus);
+
+            int heightY = btnDoorLockIcon.Bottom + Application.GetRealHeight(133);
             //瀹炴椂瑙嗛
             rtvFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
             whiteFl.AddChidren(rtvFL);
             rtvFL.Y = heightY;
-            rtvFL.X = Application.GetRealWidth(41);
+            rtvFL.X = Application.GetRealWidth(26);
             rtvFL.AddImageView();
             rtvFL.AddTextButtonView();
             rtvFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/RTV.png";
             rtvFL.GetTextButton().TextID = StringId.shishishipin;
-            //鍘嗗彶璁板綍
-            recordFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
-            whiteFl.AddChidren(recordFL);
-            recordFL.Y = heightY;
-            recordFL.X = rtvFL.Right + Application.GetRealWidth(CustomFrameLayout.interval);
-            recordFL.AddImageView();
-            recordFL.AddTextButtonView();
-            recordFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/HistoryList.png";
-            recordFL.GetTextButton().TextID = StringId.lishijilu;
+            
             //涓存椂瀵嗙爜
             pswFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
             whiteFl.AddChidren(pswFL);
             pswFL.Y = heightY;
-            pswFL.X = recordFL.Right + Application.GetRealWidth(CustomFrameLayout.interval);
+            pswFL.X = rtvFL.Right + Application.GetRealWidth(CustomFrameLayout.interval);
             pswFL.AddImageView();
             pswFL.AddTextButtonView();
             pswFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/OneOpenLock.png";
             pswFL.GetTextButton().TextID = StringId.linshimima1;
 
+            //鍘嗗彶璁板綍
+            recordFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
+            whiteFl.AddChidren(recordFL);
+            recordFL.Y = heightY;
+            recordFL.X = pswFL.Right + Application.GetRealWidth(CustomFrameLayout.interval);
+            recordFL.AddImageView();
+            recordFL.AddTextButtonView();
+            recordFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/HistoryList.png";
+            recordFL.GetTextButton().TextID = StringId.lishijilu;
 
+            //鐢ㄦ埛绠$悊
+            CustomFrameLayout userManagerView = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
+            whiteFl.AddChidren(userManagerView);
+            userManagerView.Y = heightY;
+            userManagerView.X = recordFL.Right + Application.GetRealWidth(CustomFrameLayout.interval);
+            userManagerView.AddImageView();
+            userManagerView.AddTextButtonView();
+            userManagerView.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/DoorlockUserManager.png";
+            userManagerView.GetTextButton().TextID = StringId.UserManagement;
+
+            userManagerView.SetClickListener((fl, btnImage, btnText) => {
+
+            });
 
             #endregion
 
@@ -314,10 +349,26 @@
                 btnCollectIcon.IsSelected = this.device.collect = !btnCollectIcon.IsSelected;
                 this.device.CollectFunction();
             };
+
+            int delayTimeMaxValue = 0;//
+            var startTime = DateTime.Now;
             //瀹炴椂瑙嗛
             this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) =>
             {
-                CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk,false);
+                bool isDeyayClick = false;
+                var clickTime = DateTime.Now;
+                if ((clickTime - startTime).TotalMilliseconds > delayTimeMaxValue)
+                {
+                    delayTimeMaxValue = 2*1000;
+                    startTime = clickTime;
+                    isDeyayClick = true;
+                }
+                if (!isDeyayClick)
+                {
+                    return;
+                }
+                CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk, false);
+
             });
             //涓存椂瀵嗙爜
             this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) =>
@@ -327,6 +378,10 @@
             //鍘嗗彶璁板綍
             this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) =>
             {
+                //VideoDoorlockHistoryPage historyPage = new VideoDoorlockHistoryPage(device);
+                //MainPage.BasePageView.AddChidren(historyPage);
+                //historyPage.LoadPage();
+                //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                 CommonMethod.Current.SkipRecordActivity(this.device.deviceId);
             });
 
@@ -363,7 +418,7 @@
             });
         }
 
-      
+
 
         /// <summary>
         /// 閲嶆柊璁$畻瀹藉害(璁惧鍚嶇О,鎴块棿鎺т欢)
@@ -371,12 +426,14 @@
         private void CalculatedPosition()
         {
             this.btnCurrDeviceName.Width = this.btnCurrDeviceName.GetTextWidth();
+            this.btnCurrDeviceName.Width += 10; 
             if (this.btnCurrDeviceName.GetTextWidth() > this.btnCollectIcon.X)
             {
                 //閲嶆柊璁$畻瀹藉害
                 this.btnCurrDeviceName.Width = this.btnCollectIcon.X + Application.GetRealWidth(-10);
             }
             this.btnCurrDeviceRoom.Width = this.btnCurrDeviceRoom.GetTextWidth();
+            this.btnCurrDeviceRoom.Width += 10;
             if (this.btnCurrDeviceRoom.GetTextWidth() > this.btnCollectIcon.X)
             {
                 //閲嶆柊璁$畻瀹藉害
@@ -392,15 +449,22 @@
         {
             CommonMethod.Current.MainThread(() =>
             {
-                if (this.btnDoorLockIcon != null && !this.btnDoorLockIcon.IsSelected)
+                if (pushMessageType == PushMessageType.Alarm)
                 {
-                    this.btnDoorLockIcon.IsSelected = false;
+                    //闂ㄩ攣鐢垫睜鍊�
+                    if (this.btnCell != null)
+                    {
+                        //videoDoorLockPage.btnCell.Text = "";
+                    }
                 }
-                //闂ㄩ攣鐢垫睜鍊�
-                if (this.btnCell != null)
+                else
                 {
-                    //videoDoorLockPage.btnCell.Text = "";
+                    if (this.btnDoorLockIcon != null && !this.btnDoorLockIcon.IsSelected)
+                    {
+                        this.btnDoorLockIcon.IsSelected = false;
+                    }
                 }
+
             });
 
         }
@@ -413,9 +477,9 @@
     {
         public const int widthFrameLayout = 48;
         public const int heightFrameLayout = 53;
-        public const int yFrameLayout = 378;
+        public const int yFrameLayout = 442;
         public const int xFrameLayout = 41;
-        public const int interval = 51;//琛屼腑鐨勫垪闂撮殧鍊�
+        public const int interval = 30;//琛屼腑鐨勫垪闂撮殧鍊�
 
         public CustomFrameLayout(int width, int height, int x = 0, int y = 0)
         {
@@ -443,7 +507,8 @@
             TextColor = MusicColor.TextCancelColor,
             TextAlignment = TextAlignment.Center,
             Gravity = Gravity.CenterHorizontal,
-            Name = "btnStateText"
+            Name = "btnStateText",
+            IsMoreLines = true,
         };
         public void AddImageView()
         {

--
Gitblit v1.8.0