wxr
2021-07-01 adc150efb13a0506f45a3c344c3ee2ef2dba8e90
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
@@ -57,6 +57,32 @@
        /// </summary>
        Button btnCommissioningAuthoritySwitchIcon;
        #region 管理员权限迁移
        FrameLayout administratorPermissionMigrationRow;
        Button btnAdministratorPermissionMigrationTitle;
        Button btnAdministratorPermissionMigrationExplan;
        Button btnAdministratorPermissionMigrationSkinIcon;
        #endregion
        #region 过户
        /// <summary>
        ///
        /// </summary>
        FrameLayout transferRow;
        /// <summary>
        ///
        /// </summary>
        Button btnTransferTitle;
        /// <summary>
        ///
        /// </summary>
        Button btnTrasferExplan;
        /// <summary>
        ///
        /// </summary>
        Button btnTrasferSkinIcon;
        #endregion
        #endregion
        /// <summary>
        /// 更新住宅名称的回调函数
@@ -71,20 +97,27 @@
        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;
            residenceNameRow = new FrameLayout() {
            residenceNameRow = new FrameLayout()
            {
                Y = Application.GetRealHeight(72),
                Height = Application.GetRealHeight(50),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(residenceNameRow);
            contentView.AddChidren(residenceNameRow);
            Button btnResidenceNameTitle = new Button()
            {
                X = Application.GetRealWidth(16),
@@ -98,9 +131,9 @@
            btnResidenceName = new Button()
            {
                X = Application.GetRealWidth(2)+ btnResidenceNameTitle.Right,
                X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right,
                Width = Application.GetRealWidth(200),
                Text = DB_ResidenceData.residenceData.residecenInfo.Name,
                Text = DB_ResidenceData.Instance.CurrentRegion.homeName,
                TextSize = CSS_FontSize.TextFontSize,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.TextualColor,
@@ -118,7 +151,6 @@
            residenceNameRow.AddChidren(btnEditResidenceNameIcon);
            #endregion
#if stage2
            residenceNameRow.AddChidren(
                new Button()
                {
@@ -129,55 +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.residenceData.residecenInfo.Address,
                            TextSize = CSS_FontSize.TextFontSize,
                            TextAlignment = TextAlignment.CenterLeft,
                            TextColor = CSS_Color.TextualColor,
                        };
                        residenceAddressRow.AddChidren(btnResidenceAddress);
            #endregion
#endif
            #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()
            {
@@ -209,16 +242,16 @@
                    Width = Application.GetRealWidth(343),
                    BackgroundColor = CSS_Color.DividingLineColor,
                });
#endregion
            #endregion
#region 房间管理
            #region 房间管理
            roomManagementRow = new FrameLayout()
            {
                Y = floorManagementRow.Bottom,
                Height = Application.GetRealHeight(50),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(roomManagementRow);
            contentView.AddChidren(roomManagementRow);
            btnRoomManagementTitle = new Button()
            {
@@ -240,19 +273,18 @@
                UnSelectedImagePath = "Public/RightIcon.png",
            };
            roomManagementRow.AddChidren(btnRoomManagementSkinIcon);
#endregion
            #endregion
#region 管理员权限迁移
            FrameLayout administratorPermissionMigrationRow;
            #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);
            var btnAdministratorPermissionMigrationTitle = new Button()
            btnAdministratorPermissionMigrationTitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(10),
@@ -265,7 +297,7 @@
            };
            administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationTitle);
            var btnAdministratorPermissionMigrationExplan = new Button()
            btnAdministratorPermissionMigrationExplan = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = btnAdministratorPermissionMigrationTitle.Bottom,
@@ -278,7 +310,7 @@
            };
            administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationExplan);
            Button btnAdministratorPermissionMigrationSkinIcon;
            btnAdministratorPermissionMigrationSkinIcon = new Button()
            {
                X = Application.GetRealWidth(343),
@@ -298,19 +330,23 @@
                    Width = Application.GetRealWidth(343),
                    BackgroundColor = CSS_Color.DividingLineColor,
                });
#endregion
            #endregion
#region 过户
            FrameLayout transferRow;
            #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);
            }
            var btnTransferTitle = new Button()
            btnTransferTitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(10),
@@ -323,7 +359,7 @@
            };
            transferRow.AddChidren(btnTransferTitle);
            var btnTrasferExplan = new Button()
            btnTrasferExplan = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = btnTransferTitle.Bottom,
@@ -336,7 +372,6 @@
            };
            transferRow.AddChidren(btnTrasferExplan);
            Button btnTrasferSkinIcon;
            btnTrasferSkinIcon = new Button()
            {
                X = Application.GetRealWidth(343),
@@ -346,17 +381,18 @@
                UnSelectedImagePath = "Public/RightIcon.png",
            };
            transferRow.AddChidren(btnTrasferSkinIcon);
#endregion
            #endregion
#region 调试权限
            #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()
@@ -393,13 +429,25 @@
                Height = Application.GetMinRealAverage(36),
                UnSelectedImagePath = "Public/Switch.png",
                SelectedImagePath = "Public/SwitchOn.png",
                IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm
            };
            commissioningAuthorityRow.AddChidren(btnCommissioningAuthoritySwitchIcon);
#endregion
            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
            LoadEventList();
        }
    }
}
}