From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 28 二月 2020 15:25:13 +0800
Subject: [PATCH] 2020.2.28

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs |  122 ++++++++++++++++++++++++++++++++--------
 1 files changed, 97 insertions(+), 25 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
index 496c79a..8a7f32d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
@@ -29,6 +29,7 @@
                                 CurentDoorLockTime = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocalTime(dataReport.AttriButeData);
                                 Application.RunOnMainThread(() =>
                                 {
+                                    waitGetDoorLockTime = DateTime.MaxValue;
                                     textDisplayDate.Text = CurentDoorLockTime.Year + Language.StringByID(R.MyInternationalizationString.Year) + CurentDoorLockTime.Month + Language.StringByID(R.MyInternationalizationString.Month) + CurentDoorLockTime.Day + Language.StringByID(R.MyInternationalizationString.Day);
                                     if (CurentDoorLockTime.Minute < 10)
                                     {
@@ -38,6 +39,7 @@
                                     {
                                         textDisplayTime.Text = CurentDoorLockTime.Hour + ":" + CurentDoorLockTime.Minute;
                                     }
+                                    CommonPage.Loading.Hide();
                                 });
                             }
                         }
@@ -71,6 +73,7 @@
         int curMin = 0;
         int curSec = 0;
         public Action timeSetAction;
+        DateTime waitGetDoorLockTime = DateTime.MaxValue;
         #endregion
 
         /// <summary>
@@ -114,12 +117,23 @@
         {
             if (setTimeType == "DoorLockTime")
             {
+                CommonPage.Loading.Start("");
                 // 鍙湁閲嶆柊鍚姩鏃朵細鎱紝鐒跺悗鍏朵粬鏃跺埢閮芥槸鏈夊�肩殑
                 new System.Threading.Thread(() =>
                 {
                     while (this.Parent != null)
                     {
+                        if (DateTime.Now > waitGetDoorLockTime)
+                        {
+                            Application.RunOnMainThread(() =>
+                            {
+                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance);
+                                CommonPage.Loading.Hide();
+                            });
+                        }
                         //璇婚棬閿佹椂闂�
+                        //绛夊緟10绉掞紝娌℃湁鏀跺埌鎻愮ず瓒呮椂閫�鍑�
+                        waitGetDoorLockTime = DateTime.Now.AddSeconds(+5);
                         doorLock.ReadAttri(ZigBee.Device.Cluster_ID.DoorLock, ZigBee.Device.AttriButeId.DoorLock);
                         System.Threading.Thread.Sleep(5 * 1000);
                     }
@@ -173,7 +187,7 @@
                 {
                     Width = Application.GetRealWidth(58),
                     Height = Application.GetRealHeight(58),
-                    UnSelectedImagePath = "Item/Next.png",
+                    UnSelectedImagePath = "Item/RightNext.png",
                     SelectedImagePath = "Item/Down.png",
                 };
                 btnNextFrameLayout.AddChidren(btnNext);
@@ -186,11 +200,6 @@
                     BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                 };
                 MidTopFrameLayout.AddChidren(btnLine);
-
-                if (setTimeType != "DoorLockTime")
-                {
-                    textDisplayDateFrameLayout.Width = 0;
-                }
 
                 if (i == 0)
                 {
@@ -205,11 +214,18 @@
                         Text = "_" + Language.StringByID(R.MyInternationalizationString.Year) + "_" + Language.StringByID(R.MyInternationalizationString.Month) + "_" + Language.StringByID(R.MyInternationalizationString.Day),
                     };
                     textDisplayDateFrameLayout.AddChidren(textDisplayDate);
-                    //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y;
 
                     if (setTimeType != "DoorLockTime")
                     {
                         btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.Date);
+                        if (setTimeType == "ValidTime")
+                        {
+                            textDisplayDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay + Language.StringByID(R.MyInternationalizationString.Day);
+                        }
+                        else if (setTimeType == "InValidTime")
+                        {
+                            textDisplayDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateDay + Language.StringByID(R.MyInternationalizationString.Day);
+                        }
                     }
                     else
                     {
@@ -229,11 +245,32 @@
                         Text = "00:00",
                     };
                     textDisplayDateFrameLayout.AddChidren(textDisplayTime);
-                    //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y;
 
                     if (setTimeType != "DoorLockTime")
                     {
                         btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.Time);
+                        if (setTimeType == "ValidTime")
+                        {
+                            if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute < 10)
+                            {
+                                textDisplayTime.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour + ":" + "0" + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute;
+                            }
+                            else
+                            {
+                                textDisplayTime.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour + ":" + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute;
+                            }
+                        }
+                        else if (setTimeType == "InValidTime")
+                        {
+                            if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute < 10)
+                            {
+                                textDisplayTime.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour + ":" + "0" + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute;
+                            }
+                            else
+                            {
+                                textDisplayTime.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour + ":" + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute;
+                            }
+                        }
                     }
                     else
                     {
@@ -245,11 +282,12 @@
                 EventHandler<MouseEventArgs> hander = (sender, e) =>
                 {
                     this.midFrameLayout.AddChidren(this.shadowRadiusFrameLayout);
+                    this.bottomRadiusFrameLayout.RemoveAll();
                     this.BottomRadiusFrameLayout(this);
-
                     var mUIPickerView = new UIPickerView()
                     {
                         X = Application.GetRealWidth(0),
+                        Height = Application.GetRealHeight(440),
                     };
                     this.bottomRadiusFrameLayout.AddChidren(mUIPickerView);
 
@@ -265,7 +303,7 @@
                             this.btnBottomTitle.TextID = R.MyInternationalizationString.CurrentDate;
                         }
 
-                        mUIPickerView.Y = Application.GetRealWidth(110);
+                        mUIPickerView.Y = Application.GetRealWidth(245);
                         var mList1 = new List<string>();
                         var mList2 = new List<string>();
                         var mList3 = new List<string>();
@@ -274,17 +312,31 @@
                         int year = dtNow.Year + 1;
                         int days = DateTime.DaysInMonth(dtNow.Year, dtNow.Month);
 
-                        for (int y = dtNow.Year - 10; y < dtNow.Year + 1; y++)
+                        for (int y = dtNow.Year - 9; y < dtNow.Year + 1; y++)
                         {
                             mList1.Add(y.ToString());
                         }
                         for (int m = 1; m < 13; m++)
                         {
-                            mList2.Add(m.ToString());
+                            if (Language.CurrentLanguage == "Chinese")
+                            {
+                                mList2.Add(m.ToString() + "鏈�");
+                            }
+                            else
+                            {
+                                mList2.Add(m.ToString());
+                            }
                         }
-                        for (int d = 1; d < days; d++)
+                        for (int d = 1; d < days + 1; d++)
                         {
-                            mList3.Add(d.ToString());
+                            if (Language.CurrentLanguage == "Chinese")
+                            {
+                                mList3.Add(d.ToString() + "鏃�");
+                            }
+                            else
+                            {
+                                mList3.Add(d.ToString());
+                            }
                         }
 
                         if (setTimeType != "DoorLockTime")
@@ -313,7 +365,7 @@
                                 Height = Application.GetRealHeight(58),
                                 Width = Application.GetRealWidth(101),
                                 Text = Language.StringByID(R.MyInternationalizationString.Complete),
-                                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+                                TextColor = Shared.Common.ZigbeeColor.Current.XMOrange,
                                 TextSize = 14,
                             };
                             this.bottomRadiusFrameLayout.AddChidren(btnOk);
@@ -336,12 +388,13 @@
                                     timeSetAction();
                                 }
                                 this.shadowRadiusFrameLayout.RemoveFromParent();
+                                MidFrameLayoutContent();
                             };
                         }
                         else
                         {
                             mUIPickerView.setNPicker(mList1, mList2, mList3);
-                            mUIPickerView.setCurrentItems(dtNow.Year, dtNow.Month - 1, dtNow.Day - 1);
+                            mUIPickerView.setCurrentItems(9, dtNow.Month - 1, dtNow.Day - 1);
                             curYear = dtNow.Year;
                             curMonth = dtNow.Month;
                             curDay = dtNow.Day;
@@ -369,7 +422,14 @@
 
                                 for (int d = 1; d < days + 1; d++)
                                 {
-                                    mList3.Add(d.ToString());
+                                    if (Language.CurrentLanguage == "Chinese")
+                                    {
+                                        mList3.Add(d.ToString() + "鏃�");
+                                    }
+                                    else
+                                    {
+                                        mList3.Add(d.ToString());
+                                    }
                                 }
 
                                 if (setTimeType != "DoorLockTime")
@@ -380,7 +440,7 @@
                                 else
                                 {
                                     mUIPickerView.setNPicker(mList1, mList2, mList3);
-                                    mUIPickerView.setCurrentItems(curYear, curMonth - 1, curDay - 1);
+                                    mUIPickerView.setCurrentItems(9, curMonth - 1, curDay - 1);
                                 }
                             }
                         };
@@ -413,7 +473,7 @@
                             this.btnBottomTitle.TextID = R.MyInternationalizationString.CurrentTime;
                         }
 
-                        mUIPickerView.Y = Application.GetRealWidth(95);
+                        mUIPickerView.Y = Application.GetRealWidth(245);
                         var mList1 = new List<string>();
                         var mList2 = new List<string>();
                         for (int h = 0; h < 24; h++)
@@ -438,7 +498,6 @@
                                 mList2.Add(m.ToString());
                             }
                         }
-                        // mUIPickerView.setNPicker(mList1, mList2, new List<string> { });
                         mUIPickerView.setNPicker(mList1, mList2, null);
                         mUIPickerView.setCurrentItems(dtNow.Hour, dtNow.Minute, 0);
                         if (CurentDoorLockTime != null)
@@ -485,7 +544,7 @@
                                 Height = Application.GetRealHeight(58),
                                 Width = Application.GetRealWidth(101),
                                 Text = Language.StringByID(R.MyInternationalizationString.Complete),
-                                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+                                TextColor = Shared.Common.ZigbeeColor.Current.XMOrange,
                                 TextSize = 14,
                             };
                             this.bottomRadiusFrameLayout.AddChidren(btnOk);
@@ -508,6 +567,7 @@
                                     timeSetAction();
                                 }
                                 this.shadowRadiusFrameLayout.RemoveFromParent();
+                                MidFrameLayoutContent();
                             };
                         }
                     }
@@ -517,6 +577,14 @@
                 textDisplayDateFrameLayout.MouseDownEventHandler += hander;
                 btnNextFrameLayout.MouseDownEventHandler += hander;
                 btnNext.MouseDownEventHandler += hander;
+                if (curIndex == 0)
+                {
+                    textDisplayDate.MouseDownEventHandler += hander;
+                }
+                else
+                {
+                    textDisplayTime.MouseDownEventHandler += hander;
+                }
             }
 
             btnCancel.MouseUpEventHandler += (sender1, e1) =>
@@ -562,10 +630,14 @@
                 this.shadowRadiusFrameLayout.RemoveFromParent();
             };
 
-            //绛夊緟浠庨棬閿佷笂闈㈠姞杞藉嚭鐨勬椂闂�
-            //System.Threading.Thread.Sleep(1500);
-            //CommonPage.Loading.Hide();
-
+            if (setTimeType == "DoorLockTime")
+            {
+                if (CurentDoorLockTime != null && CurentDoorLockTime.Year != 1)
+                {
+                    waitGetDoorLockTime = DateTime.MaxValue;
+                    CommonPage.Loading.Hide();
+                }
+            }
         }
 
         #region 鈼� 鎺ュ彛瀹炵幇__________________________

--
Gitblit v1.8.0