From 59a004efa8bdc3bde2d46c7bdab5c6c294da0620 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 01 六月 2023 10:23:05 +0800
Subject: [PATCH] 1.8 优化安卓经纬度获取,门锁音量功能,临时密码功能

---
 HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockSelectTimePage.cs |  104 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 88 insertions(+), 16 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockSelectTimePage.cs b/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockSelectTimePage.cs
index 349efc6..34ec007 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockSelectTimePage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockSelectTimePage.cs
@@ -22,6 +22,12 @@
         /// 閫夋嫨鐨勬椂闂�
         /// </summary>
         private DateTime selectDateTime;
+        /// <summary>
+        /// 鏃堕棿鏍¢獙
+        /// 鏄惁闇�瑕佹牎楠屾椂闂村ぇ浜庡綋鍓嶆椂闂�
+        /// </summary>
+        public bool TimeCheck = false;
+
 
         #endregion
 
@@ -51,18 +57,44 @@
             this.ClearBodyFrame();
 
             //閫夋嫨鏃ユ湡
-            var rowDate = new RowLayoutControl();
+            var rowDate = new FrameLayout() {
+                Height = Application.GetRealHeight(50),
+            };
             rowDate.BackgroundColor = CSS_Color.MainBackgroundColor;
             bodyFrameLayout.AddChidren(rowDate);
-            rowDate.frameTable.AddLeftCaption(Language.StringByID(StringId.SelectDate), 300);
-            rowDate.frameTable.AddRightArrow();
-            rowDate.frameTable.AddBottomLine();
-            var btnDay = rowDate.frameTable.AddMostRightView(this.selectDateTime.ToString("yyyy.MM.dd"), 300);
-            rowDate.frameTable.ButtonClickEvent += (sender, e) =>
+            var btnDateLeft = new Button()
+            {
+                TextID = StringId.SelectDate,
+                TextAlignment = TextAlignment.CenterLeft,
+                Width = Application.GetRealWidth(300),
+                X = Application.GetRealWidth(16),
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            rowDate.AddChidren(btnDateLeft);
+            var btnDateRight = new Button()
+            {
+                X = Application.GetRealWidth(339),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/Right.png",
+            };
+            rowDate.AddChidren(btnDateRight);
+            rowDate.AddChidren(new Button() { X = Application.GetRealWidth(16),Y = Application.GetRealHeight(49), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
+
+            var btnDay = new Button()
+            {
+                Width = Application.GetRealWidth(327),
+                TextAlignment = TextAlignment.CenterRight,
+                Text = selectDateTime.ToString("yyyy.MM.dd"),
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            rowDate.AddChidren(btnDay);
+            EventHandler<MouseEventArgs> dateEvent = (sender, e) =>
             {
                 //鏄剧ず鏃ユ湡閫夋嫨鐨勫簳閮ㄥ脊绐�
                 var contr = new BottomDateSelectControl();
-                contr.InitControl(this.selectDateTime.Year, this.selectDateTime.Month, this.selectDateTime.Day, 1, 1);
+                contr.InitControl(this.selectDateTime.Year, this.selectDateTime.Month, this.selectDateTime.Day, 0, 1);
                 contr.FinishEvent += (div, year, month, day) =>
                 {
                     //瑕嗙洊鏃堕棿
@@ -73,21 +105,50 @@
                     }
                 };
             };
+            btnDateLeft.MouseUpEventHandler = dateEvent;
+            btnDateRight.MouseUpEventHandler = dateEvent;
+            btnDay.MouseUpEventHandler = dateEvent;
 
             //閫夋嫨鏃堕棿
-            var rowTime = new RowLayoutControl();
-            rowTime.Y = rowDate.Bottom;
-            rowTime.BackgroundColor = CSS_Color.MainBackgroundColor;
+            var rowTime = new FrameLayout() {
+                Y = rowDate.Bottom,
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
             bodyFrameLayout.AddChidren(rowTime);
-            rowTime.frameTable.AddLeftCaption(Language.StringByID(StringId.SelectTime), 300);
-            rowTime.frameTable.AddRightArrow();
-            var btnTime = rowTime.frameTable.AddMostRightView(this.selectDateTime.ToString("HH:mm"), 300);
-            rowTime.frameTable.ButtonClickEvent += (sender, e) =>
+            rowTime.AddChidren(new Button() { X = Application.GetRealWidth(16),Y = Application.GetRealHeight(49), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
+            var btnTimeLeft = new Button()
+            {
+                TextID = StringId.SelectTime,
+                TextAlignment = TextAlignment.CenterLeft,
+                Width = Application.GetRealWidth(300),
+                X = Application.GetRealWidth(16),
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            rowTime.AddChidren(btnTimeLeft);
+            var btnTimeRight = new Button()
+            {
+                X = Application.GetRealWidth(339),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/Right.png",
+            };
+            rowTime.AddChidren(btnTimeRight);
+            var btnTime = new Button()
+            {
+                Width = Application.GetRealWidth(327),
+                TextAlignment = TextAlignment.CenterRight,
+                Text = selectDateTime.ToString("HH:mm"),
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            rowTime.AddChidren(btnTime);
+            EventHandler<MouseEventArgs> timeEvent = (sender, e) =>
             {
                 //鏄剧ず鏃ユ湡閫夋嫨鐨勫簳閮ㄥ脊绐�
                 var contr = new BottomTimeSelectControl();
-                contr.RowCount = 5;
-                contr.InitControl(this.selectDateTime.Hour, this.selectDateTime.Minute, -1);
+                contr.RowCount = 4;
+                contr.InitControl(this.selectDateTime.Hour, this.selectDateTime.Minute,250);
                 contr.FinishEvent += (div, hour, minute) =>
                 {
                     //瑕嗙洊鏃堕棿
@@ -98,6 +159,9 @@
                     }
                 };
             };
+            btnTimeLeft.MouseUpEventHandler = timeEvent;
+            btnTimeRight.MouseUpEventHandler = timeEvent;
+            btnTime.MouseUpEventHandler = timeEvent;
         }
 
         #endregion
@@ -109,6 +173,14 @@
         /// </summary>
         public override void CloseFormBefore()
         {
+            if (TimeCheck)
+            {
+                if (DateTime.Now > this.selectDateTime)
+                {
+                    new PublicAssmebly().TipMsg(StringId.Tip, StringId.TempPwdSettingTip);
+                    throw new Exception("stop");
+                }
+            }
             base.CloseFormBefore();
             //璋冪敤鍥炶皟浜嬩欢
             this.SelectFinshEvent?.Invoke(this.selectDateTime);

--
Gitblit v1.8.0