From a100ed2898468add96398ae069080a103c355c08 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 17 七月 2023 16:41:41 +0800
Subject: [PATCH] 视频门锁优化

---
 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs |  200 +++++++++++++++++++++++++-------------------------
 1 files changed, 100 insertions(+), 100 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs
index b20ce5f..f1ee2e9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs
@@ -153,103 +153,11 @@
                 BackgroundColor = CSS_Color.BackgroundColor,
             });
 
-
-            #region 瑙﹀彂鏂瑰紡 TriggerMode
-            var triggerModeView = new FrameLayout()
+            var view = new VerticalScrolViewLayout()
             {
-                Height = Application.GetRealHeight(50),
-                BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
+                Height = Application.GetRealHeight(300),
             };
-            contentView.AddChidren(triggerModeView);
-
-            var btnTriggerModeRight = new Button()
-            {
-                X = Application.GetRealWidth(339),
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetMinRealAverage(16),
-                Height = Application.GetMinRealAverage(16),
-                UnSelectedImagePath = "Public/Right.png",
-            };
-            triggerModeView.AddChidren(btnTriggerModeRight);
-
-            var btnTriggerModeStateText = new Button()
-            {
-                X = Application.GetRealWidth(100),
-                Width = Application.GetRealWidth(223),
-                TextAlignment = TextAlignment.CenterRight,
-                TextSize = CSS_FontSize.TextFontSize,
-                TextColor = CSS_Color.PromptingColor1,
-            };
-            triggerModeView.AddChidren(btnTriggerModeStateText);
-
-            var btnTriggerModeText = new Button()
-            {
-                X = Application.GetRealWidth(16),
-                TextSize = CSS_FontSize.SubheadingFontSize,
-                TextColor = CSS_Color.FirstLevelTitleColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextID = StringId.TriggerMode,
-            };
-            triggerModeView.AddChidren(btnTriggerModeText);
-
-            btnTriggerModeText.MouseUpEventHandler = (sender, e) =>
-            {
-                var page = new VideoDoorlockFaceUnlockTriggerSettingPage(device, faceUnlockSetup);
-                MainPage.BasePageView.AddChidren(page);
-                page.LoadPage();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-
-            };
-            #endregion
-
-            contentView.AddChidren(new Button()
-            {
-                Height = 1,
-                BackgroundColor = CSS_Color.PromptingColor1,
-                Gravity = Gravity.CenterHorizontal,
-            });
-
-
-            #region 浜鸿劯褰曞叆甯姪 
-            var faceEntryHelpView = new FrameLayout()
-            {
-                Height = Application.GetRealHeight(50),
-                BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
-            };
-            contentView.AddChidren(faceEntryHelpView);
-
-            var btnFaceEntryHelpRight = new Button()
-            {
-                X = Application.GetRealWidth(339),
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetMinRealAverage(16),
-                Height = Application.GetMinRealAverage(16),
-                UnSelectedImagePath = "Public/Right.png",
-            };
-            faceEntryHelpView.AddChidren(btnFaceEntryHelpRight);
-
-     
-            var btnFaceEntryHelpText = new Button()
-            {
-                X = Application.GetRealWidth(16),
-                TextSize = CSS_FontSize.SubheadingFontSize,
-                TextColor = CSS_Color.FirstLevelTitleColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextID = StringId.FaceEntryHelp,
-            };
-            faceEntryHelpView.AddChidren(btnFaceEntryHelpText);
-
-            btnFaceEntryHelpText.MouseUpEventHandler = (sender, e) => {
-                var page = new VideoDoorlockFaceUnlockHelpPage();
-                MainPage.BasePageView.AddChidren(page);
-                page.LoadPage();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-            };
-            #endregion
-
-
-
-
+            contentView.AddChidren(view);
 
             new System.Threading.Thread(() => {
                 try
@@ -262,8 +170,7 @@
                             //鏇存柊鐣岄潰
                             faceUnlockSetup = Newtonsoft.Json.JsonConvert.DeserializeObject<FaceUnlockSetupObj>(pack.Data.ToString());
                             btnFaceUnlockSwitchIcon.IsSelected = faceUnlockSetup.enabled;
-
-                            btnTriggerModeStateText.TextID = faceUnlockSetup.mode == 0 ? StringId.AutomaticTriggering : StringId.ManualTriggering;
+                            loadSubView(view, faceUnlockSetup);
                         });
                     }
                     else
@@ -284,8 +191,6 @@
                             }
                         });
                     }
-
-
                 }
                 catch (Exception ex)
                 {
@@ -304,6 +209,101 @@
 
         }
 
+        void loadSubView(VerticalScrolViewLayout view, FaceUnlockSetupObj faceUnlockSetup)
+        {
+            if (faceUnlockSetup.enabled)
+            {
+                #region 瑙﹀彂鏂瑰紡 TriggerMode
+                var triggerModeView = new FrameLayout()
+                {
+                    Height = Application.GetRealHeight(50),
+                    BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
+                };
+                view.AddChidren(triggerModeView);
+
+                var btnTriggerModeRight = new Button()
+                {
+                    X = Application.GetRealWidth(339),
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetMinRealAverage(16),
+                    Height = Application.GetMinRealAverage(16),
+                    UnSelectedImagePath = "Public/Right.png",
+                };
+                triggerModeView.AddChidren(btnTriggerModeRight);
+
+                var btnTriggerModeStateText = new Button()
+                {
+                    X = Application.GetRealWidth(100),
+                    Width = Application.GetRealWidth(223),
+                    TextAlignment = TextAlignment.CenterRight,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    TextColor = CSS_Color.PromptingColor1,
+                };
+                triggerModeView.AddChidren(btnTriggerModeStateText);
+                btnTriggerModeStateText.TextID = faceUnlockSetup.mode == 0 ? StringId.AutomaticTriggering : StringId.ManualTriggering;
+
+                var btnTriggerModeText = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    TextSize = CSS_FontSize.SubheadingFontSize,
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextID = StringId.TriggerMode,
+                };
+                triggerModeView.AddChidren(btnTriggerModeText);
+
+                btnTriggerModeText.MouseUpEventHandler = (sender, e) =>
+                {
+                    var page = new VideoDoorlockFaceUnlockTriggerSettingPage(device, faceUnlockSetup);
+                    MainPage.BasePageView.AddChidren(page);
+                    page.LoadPage();
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+                };
+                #endregion
+
+                view.AddChidren(new Button { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
+            }
+            #region 浜鸿劯褰曞叆甯姪 
+            var faceEntryHelpView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
+            };
+            view.AddChidren(faceEntryHelpView);
+
+            var btnFaceEntryHelpRight = new Button()
+            {
+                X = Application.GetRealWidth(339),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/Right.png",
+            };
+            faceEntryHelpView.AddChidren(btnFaceEntryHelpRight);
+
+
+            var btnFaceEntryHelpText = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextID = StringId.FaceEntryHelp,
+            };
+            faceEntryHelpView.AddChidren(btnFaceEntryHelpText);
+
+            btnFaceEntryHelpText.MouseUpEventHandler = (sender, e) =>
+            {
+                var page = new VideoDoorlockFaceUnlockHelpPage();
+                MainPage.BasePageView.AddChidren(page);
+                page.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+            #endregion
+
+        }
+
     }
 
     /// <summary>
@@ -314,7 +314,7 @@
         /// <summary>
         /// 寮�鍏�
         /// </summary>
-        public bool enabled;
+        public bool enabled = false;
         /// <summary>
         /// 瑙i攣鏂瑰紡 0-鑷姩 1-鎵嬪姩
         /// </summary>

--
Gitblit v1.8.0