From adc150efb13a0506f45a3c344c3ee2ef2dba8e90 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 01 七月 2021 15:19:13 +0800
Subject: [PATCH] 合并嘉乐lc代码

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs |  142 +++++++++++++++++++++++++++-------------------
 1 files changed, 83 insertions(+), 59 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
index a974595..ee17871 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
@@ -97,11 +97,17 @@
 
         public void LoadPage()
         {
-
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-
             new TopViewDiv(bodyView, Language.StringByID(StringId.ResidenceManage)).LoadTopView();
-            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.ResidenceManage));
+
+            VerticalScrolViewLayout contentView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(64),
+                Height = Application.GetRealHeight(667 - 64),
+                ScrollEnabled = false,
+            };
+            bodyView.AddChidren(contentView);
+
 
             #region 浣忓畢鍚嶇О
             FrameLayout residenceNameRow;
@@ -111,7 +117,7 @@
                 Height = Application.GetRealHeight(50),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(residenceNameRow);
+            contentView.AddChidren(residenceNameRow);
             Button btnResidenceNameTitle = new Button()
             {
                 X = Application.GetRealWidth(16),
@@ -127,7 +133,7 @@
             {
                 X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right,
                 Width = Application.GetRealWidth(200),
-                Text = DB_ResidenceData.Instance.CurrentRegion.Name,
+                Text = DB_ResidenceData.Instance.CurrentRegion.homeName,
                 TextSize = CSS_FontSize.TextFontSize,
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.TextualColor,
@@ -155,54 +161,56 @@
                     BackgroundColor = CSS_Color.DividingLineColor,
                 });
             #region 浣忓畢鍦板潃
-                        var residenceAddressRow = new FrameLayout()
-                        {
-                            Y = residenceNameRow.Bottom,
-                            Height = Application.GetRealHeight(50),
-                            BackgroundColor = CSS_Color.MainBackgroundColor,
-                        };
-                        bodyView.AddChidren(residenceAddressRow);
-
-                        var btnResidenceAddressTitle = new Button()
-                        {
-                            X = Application.GetRealWidth(16),
-                            Width = Application.GetRealWidth(78),
-                            TextID = StringId.ResidenceAddress,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextSize = CSS_FontSize.SubheadingFontSize,
-                            TextColor = CSS_Color.FirstLevelTitleColor,
-                        };
-                        residenceAddressRow.AddChidren(btnResidenceAddressTitle);
-
-                        btnLocationAddressIcon = new Button()
-                        {
-                            X = Application.GetRealWidth(333),
-                            Gravity = Gravity.CenterVertical,
-                            Width = Application.GetMinRealAverage(28),
-                            Height = Application.GetMinRealAverage(28),
-                            UnSelectedImagePath = "Public/LocationAddressIcon.png",
-                        };
-                        residenceAddressRow.AddChidren(btnLocationAddressIcon);
-
-                        btnResidenceAddress = new Button()
-                        {
-                            X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right,
-                            Width = Application.GetRealWidth(200),
-                            Text = DB_ResidenceData.Instance.CurrentRegion.Address,
-                            TextSize = CSS_FontSize.TextFontSize,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = CSS_Color.TextualColor,
-                        };
-                        residenceAddressRow.AddChidren(btnResidenceAddress);
-            #endregion
-            #region 妤煎眰绠$悊
-            floorManagementRow = new FrameLayout()
+            var residenceAddressRow = new FrameLayout()
             {
-                Y = Application.GetRealHeight(8) + residenceNameRow.Bottom,// residenceAddressRow.Bottom,
+                Y = residenceNameRow.Bottom,
                 Height = Application.GetRealHeight(50),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(floorManagementRow);
+            contentView.AddChidren(residenceAddressRow);
+
+            var btnResidenceAddressTitle = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Width = Application.GetRealWidth(78),
+                TextID = StringId.ResidenceAddress,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            residenceAddressRow.AddChidren(btnResidenceAddressTitle);
+
+            btnLocationAddressIcon = new Button()
+            {
+                X = Application.GetRealWidth(333),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                //UnSelectedImagePath = "Public/LocationAddressIcon.png",
+                UnSelectedImagePath = "Public/Edit.png",
+            };
+            residenceAddressRow.AddChidren(btnLocationAddressIcon);
+
+            btnResidenceAddress = new Button()
+            {
+                X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right,
+                Width = Application.GetRealWidth(200),
+                Text = DB_ResidenceData.Instance.CurrentRegion.homeAddress,
+                TextSize = CSS_FontSize.TextFontSize,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.TextualColor,
+            };
+            residenceAddressRow.AddChidren(btnResidenceAddress);
+            #endregion
+            #region 妤煎眰绠$悊
+            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
+
+            floorManagementRow = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            contentView.AddChidren(floorManagementRow);
 
             btnFloorManagementTitle = new Button()
             {
@@ -243,7 +251,7 @@
                 Height = Application.GetRealHeight(50),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(roomManagementRow);
+            contentView.AddChidren(roomManagementRow);
 
             btnRoomManagementTitle = new Button()
             {
@@ -267,15 +275,14 @@
             roomManagementRow.AddChidren(btnRoomManagementSkinIcon);
             #endregion
 
-
             #region 绠$悊鍛樻潈闄愯縼绉�
+            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
             administratorPermissionMigrationRow = new FrameLayout()
             {
-                Y = Application.GetRealHeight(8) + roomManagementRow.Bottom,
                 Height = Application.GetRealHeight(65),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(administratorPermissionMigrationRow);
+            //contentView.AddChidren(administratorPermissionMigrationRow);
 
             btnAdministratorPermissionMigrationTitle = new Button()
             {
@@ -303,7 +310,7 @@
             };
             administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationExplan);
 
-          
+
             btnAdministratorPermissionMigrationSkinIcon = new Button()
             {
                 X = Application.GetRealWidth(343),
@@ -326,14 +333,18 @@
             #endregion
 
             #region 杩囨埛
-          
             transferRow = new FrameLayout()
             {
                 Y = administratorPermissionMigrationRow.Bottom,
                 Height = Application.GetRealHeight(65),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(transferRow);
+            //鏈夌綉鍏虫墠鑳借繃鎴�
+            if (DB_ResidenceData.Instance.HomeGateway != null && string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId) == false
+                && DB_ResidenceData.Instance.CurrentRegion.isOtherShare == false)
+            {
+                contentView.AddChidren(transferRow);
+            }
 
             btnTransferTitle = new Button()
             {
@@ -373,14 +384,15 @@
             #endregion
 
             #region 璋冭瘯鏉冮檺
+
+            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
             FrameLayout commissioningAuthorityRow;
             commissioningAuthorityRow = new FrameLayout()
             {
-                Y = Application.GetRealHeight(8) + transferRow.Bottom,
                 Height = Application.GetRealHeight(65),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(commissioningAuthorityRow);
+            contentView.AddChidren(commissioningAuthorityRow);
 
 
             var btnCommissioningAuthorityTitle = new Button()
@@ -417,8 +429,20 @@
                 Height = Application.GetMinRealAverage(36),
                 UnSelectedImagePath = "Public/Switch.png",
                 SelectedImagePath = "Public/SwitchOn.png",
+                IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm
             };
             commissioningAuthorityRow.AddChidren(btnCommissioningAuthoritySwitchIcon);
+
+            btnCommissioningAuthoritySwitchIcon.MouseUpEventHandler = (sender, e) =>
+            {
+                DB_ResidenceData.Instance.CurrentRegion.debugPerm = !DB_ResidenceData.Instance.CurrentRegion.debugPerm;
+                btnCommissioningAuthoritySwitchIcon.IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm;
+                new System.Threading.Thread(() =>
+                {
+                    new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm);
+                })
+                { IsBackground = true }.Start();
+            };
 
             #endregion
 
@@ -426,4 +450,4 @@
             LoadEventList();
         }
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0