From a4924de3136289d10cabbf2f61a228387d44ded7 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 07 十一月 2019 13:48:36 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs |  188 +++++++++++++++++++++++++---------------------
 1 files changed, 101 insertions(+), 87 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
index 9548ee7..7e1b6b2 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -1,4 +1,5 @@
 锘縰sing System;
+using System.Collections.Generic;
 using Shared.Common;
 using ZigBee.Device;
 
@@ -96,6 +97,12 @@
 
             for (int i = 0; i < 7; i++)
             {
+                var bottomRowLayout = new FrameLayout()
+                {
+                    Height = Application.GetRealHeight(58),
+                };
+                bottomFrameLayout2.AddChidren(bottomRowLayout);
+
                 var btnName = new Button()
                 {
                     Width = Application.GetRealWidth(233),
@@ -105,7 +112,7 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextSize = 12,
                 };
-                bottomFrameLayout2.AddChidren(btnName);
+                bottomRowLayout.AddChidren(btnName);
 
                 var btnNextFrameLayout = new FrameLayout()
                 {
@@ -113,19 +120,20 @@
                     Height = Application.GetRealHeight(58),
                     X = Application.GetRealWidth(861 + 58),
                 };
-                bottomFrameLayout2.AddChidren(btnNextFrameLayout);
+                bottomRowLayout.AddChidren(btnNextFrameLayout);
 
                 var btnNext = new Button()
                 {
-                    Width = Application.GetRealWidth(60),
-                    Height = Application.GetRealHeight(60),
+                    Width = Application.GetRealWidth(58),
+                    Height = Application.GetRealHeight(58),
+                    X = Application.GetRealWidth(46)
                 };
                 btnNextFrameLayout.AddChidren(btnNext);
 
                 var btnLine = new FrameLayout()
                 {
                     Width = Application.GetRealWidth(965),
-                    Height = Application.GetRealHeight(5),
+                    Height = Application.GetRealHeight(2),
                     X = Application.GetRealWidth(58),
                     BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                     Visible = false,
@@ -134,89 +142,72 @@
 
                 if (i == 0)
                 {
-                    btnName.Y = Application.GetRealHeight(204);
-                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceName) + ":";
-
+                    bottomRowLayout.Y = Application.GetRealHeight(220);
+                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm) + ":";
                     btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58);
-                    btnNextFrameLayout.Y = btnName.Y;
-                    btnNextFrameLayout.X = btnName.Right;
-
+                    btnNextFrameLayout.X = Application.GetRealWidth(233);
                     btnNext.TextAlignment = TextAlignment.CenterLeft;
-                    btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                    btnNext.Text = "鏅鸿兘闂ㄩ攣";
-
+                    btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
+                    btnNext.Text = doorLock.DeviceName;
                     btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(308);
+                    btnLine.Y = Application.GetRealHeight(303);
                 }
                 else if (i == 1)
                 {
-                    btnName.Y = Application.GetRealHeight(343);
-                    btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongZone) + ":";
+                    bottomRowLayout.Y = Application.GetRealHeight(312);
+                    bottomRowLayout.Height = Application.GetRealHeight(127);
+                    btnName.Width = Application.GetRealWidth(0);
+                    btnNextFrameLayout.Width = Application.GetRealWidth(0);
+                    //鎵�灞炲尯鍩�
+                    var rowBeloneArea = new BelongAreaControl(0);
+                    bottomRowLayout.AddChidren(rowBeloneArea);
 
-                    var btnArea = new Button()
+                    rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), doorLock);
+                    //搴曠嚎
+                    rowBeloneArea.AddBottomLine();
+                    rowBeloneArea.SelectRoomEvent += (roomKeys) =>
                     {
-                        Width = Application.GetRealWidth(789 - 109 - 58),
-                        Height = Application.GetRealHeight(58),
-                        X = btnName.Right,
-                        Y = btnName.Y,
-                        TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
-                        Text = "涓�妤硷紝瀹㈠巺",
-                        TextAlignment = TextAlignment.CenterLeft,
+                        //鍙樻洿鎴块棿
+                        Common.Room.CurrentRoom.ChangedRoom(doorLock, roomKeys);
                     };
-                    bottomFrameLayout2.AddChidren(btnArea);
-
-                    btnNextFrameLayout.Y = btnName.Y;
-                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
-
-                    btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(446);
-
-                    btnNext.MouseDownEventHandler += (sender, e) =>
-                    {
-
-                    };
+                    btnLine.Visible = false;
                 }
                 else if (i == 2)
                 {
-                    btnName.Y = Application.GetRealHeight(481);
+                    bottomRowLayout.Y = Application.GetRealHeight(481);
                     btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongModel) + ":";
                     btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58);
-                    btnNextFrameLayout.Y = btnName.Y;
-                    btnNextFrameLayout.X = btnName.Right;
+                    btnNextFrameLayout.X = Application.GetRealWidth(233);
 
                     btnNext.TextAlignment = TextAlignment.CenterLeft;
                     btnNext.Height = Application.GetRealHeight(58);
-                    btnNext.Text = "HDL-Doorlock";
-                    btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                    btnNext.Text = doorLock.DeviceName;
+                    btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
 
                     btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(1025 - 449);
+                    btnLine.Y = Application.GetRealHeight(575);
                 }
                 else if (i == 3)
                 {
-                    btnName.Y = Application.GetRealHeight(585 + 35);
+                    bottomRowLayout.Y = Application.GetRealHeight(585 + 35);
                     btnName.Text = Language.StringByID(R.MyInternationalizationString.TemporaryPassword);
 
-                    btnNextFrameLayout.Y = btnName.Y;
                     btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
 
                     btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(619 + 58 + 35);
+                    btnLine.Y = Application.GetRealHeight(714);
                 }
                 else if (i == 4)
                 {
-                    btnName.Y = Application.GetRealHeight(723 + 35);
+                    bottomRowLayout.Y = Application.GetRealHeight(723 + 35);
+                    btnNext.X = Application.GetRealWidth(0);
                     btnName.Text = Language.StringByID(R.MyInternationalizationString.RemotelyUnlock);
-
-                    btnNextFrameLayout.Y = btnName.Y;
                     btnNext.Width = Application.GetRealWidth(104);
                     btnNext.Height = Application.GetRealHeight(63);
                     btnNext.UnSelectedImagePath = "DoorLock/Switch.png";
                     btnNext.SelectedImagePath = "DoorLock/SwitchOn.png";
-
                     btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(723 + 127);
-
+                    btnLine.Y = Application.GetRealHeight(853);
                     if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "")
                     {
                         btnNext.IsSelected = false;
@@ -225,8 +216,49 @@
                     {
                         btnNext.IsSelected = true;
                     }
+                }
+                else if (i == 5)
+                {
+                    bottomRowLayout.Y = Application.GetRealHeight(861 + 35);
+                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockTime);
+                    btnNextFrameLayout.Y = btnName.Y;
+                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
+                    btnLine.Visible = true;
+                    btnLine.Y = Application.GetRealHeight(992);
+                }
+                else if (i == 6)
+                {
+                    bottomRowLayout.Y = Application.GetRealHeight(999 + 35);
+                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockShare);
+                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
+                    btnLine.Visible = true;
+                    btnLine.Y = Application.GetRealHeight(1131);
+                }
+                int currentIndex = i;
+                EventHandler<MouseEventArgs> eHandler = (sender, e) =>
+                {
+                    if (currentIndex == 1)
+                    {
+                        //鑾峰彇璁惧鎵�灞炴埧闂�
+                        var aa = Common.Room.CurrentRoom.GetRoomByDevice(doorLock);
+                        //鑾峰彇璁惧鎵�鍦ㄦゼ灞�
+                        var bb = aa.FloorId;
+                        //鑾峰彇璁惧鎵�鍦ㄦゼ灞�
+                        var cc = aa.FloorId;
+                        //鑾峰彇妤煎眰鐨勫悕瀛�
+                        var dd = Common.Config.Instance.Home.GetFloorNameById(cc);
+                        //if (Common.Config.Instance.Home.FloorDics.Count == 0)//杩欎釜鏄棤妤煎眰妯″紡
 
-                    EventHandler<MouseEventArgs> eHandlerRemotelyUnlock = (sender, e) =>
+                        var listCheck = new List<string>();
+                    }
+                    else if (currentIndex == 3)
+                    {
+                        var temporaryPassword = new Shared.Phone.UserCenter.DoorLock.TemporaryPassword(doorLock);
+                        Shared.Phone.UserView.HomePage.Instance.AddChidren(temporaryPassword);
+                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                        temporaryPassword.Show();
+                    }
+                    else if (currentIndex == 4)
                     {
                         btnNext.IsSelected = !btnNext.IsSelected;
                         if (btnNext.IsSelected)
@@ -236,44 +268,26 @@
                                 RemotePasswordDialog(doorLock, btnNext);
                             }
                         }
-                        return;
-                    };
-                    btnNext.MouseDownEventHandler += eHandlerRemotelyUnlock;
-                    btnName.MouseDownEventHandler += eHandlerRemotelyUnlock;
-                    btnNextFrameLayout.MouseDownEventHandler += eHandlerRemotelyUnlock;
-                }
-                else if (i == 5)
-                {
-                    btnName.Y = Application.GetRealHeight(861 + 35);
-                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockTime);
-
-                    btnNextFrameLayout.Y = btnName.Y;
-                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
-
-                    btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(861 + 127);
-                    EventHandler<MouseEventArgs> eHandlerDoorLockTime = (sender, e) =>
+                        else
+                        {
+                            ZigBee.Device.DoorLock.RemoteUnlockPassword = "";
+                        }
+                    }
+                    else if (currentIndex == 5)
                     {
-                        var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "InValidTime");
+                        var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "DoorLockTime");
                         Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage);
                         Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                         tempPage.Show();
-                    };
-                    btnNext.MouseDownEventHandler += eHandlerDoorLockTime;
-                    btnName.MouseDownEventHandler += eHandlerDoorLockTime;
-                    btnNextFrameLayout.MouseDownEventHandler += eHandlerDoorLockTime;
-                }
-                else if (i == 6)
-                {
-                    btnName.Y = Application.GetRealHeight(999 + 35);
-                    btnName.Text = Language.StringByID(R.MyInternationalizationString.Shared);
-
-                    btnNextFrameLayout.Y = btnName.Y;
-                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
-
-                    btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(999 + 127);
-                }
+                    }
+                    else if (currentIndex == 6)
+                    {
+                    }
+                };
+                bottomRowLayout.MouseDownEventHandler += eHandler;
+                btnNext.MouseDownEventHandler += eHandler;
+                btnName.MouseDownEventHandler += eHandler;
+                btnNextFrameLayout.MouseDownEventHandler += eHandler;
                 #endregion
             }
         }

--
Gitblit v1.8.0