wxr
2023-06-05 753e67c3705dddb8e913bd853db151f94f81d600
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
@@ -1,4 +1,5 @@
using System;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -202,9 +203,9 @@
            };
            residenceAddressRow.AddChidren(btnResidenceAddress);
            #endregion
            #region 楼层管理
            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
            #region 楼层管理
            floorManagementRow = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
@@ -274,7 +275,12 @@
            };
            roomManagementRow.AddChidren(btnRoomManagementSkinIcon);
            #endregion
            //已经交付
            if (DB_ResidenceData.Instance.CurrentRegion.deliverStatus == "Delivered" || DB_ResidenceData.Instance.CurrentRegion.deliverStatus == "SECONDARY_DEBUGGIN")
            {
                if (DB_ResidenceData.Instance.CurrentRegion.deliverStatus != "SECONDARY_DEBUGGIN")
                {
            #region 管理员权限迁移
            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
            administratorPermissionMigrationRow = new FrameLayout()
@@ -387,6 +393,83 @@
            transferRow.AddChidren(btnTrasferSkinIcon);
            #endregion
                    LoadEvent_SkipAdminMigrationConfirmPage();
                    LoadEvent_SkipTransferConfirmPage();
                    var btnRollBack = new Button()
                    {
                        Y = Application.GetRealHeight(623),
                        Height = Application.GetRealHeight(50),
                        TextAlignment = TextAlignment.Center,
                        TextSize = CSS_FontSize.SubheadingFontSize,
                        TextColor = CSS_Color.AuxiliaryColor2,
                        TextID = StringId.RollBack,
                        BackgroundColor = CSS_Color.MainBackgroundColor,
                    };
                    bodyView.AddChidren(btnRollBack);
                    if (MainPage.Increase)
                    {
                        btnRollBack.Y = Application.GetRealHeight(613);
                        btnRollBack.Height = Application.GetRealHeight(50);
                        bodyView.AddChidren(new Button() { Y = Application.GetRealHeight(663), Height = Application.GetRealHeight(20), BackgroundColor = CSS_Color.MainBackgroundColor });
                    }
                    btnRollBack.MouseUpEventHandler += (sender, e) =>
                    {
                        Action okAction = () =>
                        {
                            var waitPage = new Loading();
                            this.AddChidren(waitPage);
                            waitPage.Start("");
                            new System.Threading.Thread(() => {
                                try
                                {
                                    var pack = Common.ApiUtlis.Ins.HttpRequest.RollBack();
                                    Application.RunOnMainThread(() =>
                                    {
                                        if (pack != null)
                                        {
                                            if (pack.Code == StateCode.SUCCESS)
                                            {
                                                new PublicAssmebly().TipMsg(StringId.Tip, StringId.SuccessfullyUnboundTheResidence, () =>
                                                {
                                                    Common.ApiUtlis.Ins.HttpRequest.GetHomePager();
                                                });
                                            }
                                            else
                                            {
                                                IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
                                            }
                                        }
                                    });
                                }
                                catch (Exception ex)
                                {
                                    MainPage.Log($"住宅回滚异常:{ex.Message}");
                                }
                                finally
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        try
                                        {
                                            waitPage.Hide();
                                            waitPage.RemoveFromParent();
                                            waitPage = null;
                                        }
                                        catch { }
                                    });
                                }
                            })
                            { IsBackground = true }.Start();
                        };
                        new ConfirmDialog().ShowDialog(StringId.Tip, StringId.RollBackTipMsg, okAction);
                    };
                }
            #region 调试权限
            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
@@ -441,16 +524,137 @@
            {
                DB_ResidenceData.Instance.CurrentRegion.debugPerm = !DB_ResidenceData.Instance.CurrentRegion.debugPerm;
                btnCommissioningAuthoritySwitchIcon.IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm;
                    var waitPage = new Loading();
                    bodyView.AddChidren(waitPage);
                    waitPage.Start("");
                new System.Threading.Thread(() =>
                {
                    new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm);
                        try
                        {
                            var pack = new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm);
                            if (pack != null)
                            {
                                if (pack.Code == DAL.Server.StateCode.SUCCESS)
                                {
                                    DB_ResidenceData.Instance.CurrentRegion.debugStatus = DB_ResidenceData.Instance.CurrentRegion.debugPerm ? "SECONDARY_DEBUGGIN" : "Delivered";
                                    Application.RunOnMainThread(() =>
                                    {
                                        bodyView.RemoveAll();
                                        LoadPage();
                                    });
                                }
                            }
                        }catch(Exception ex)
                        {
                            Application.RunOnMainThread(() => {
                                waitPage.Hide();
                            });
                        }
                })
                { IsBackground = true }.Start();
            };
            #endregion
            }
            //调试完成  才能加载二维码
            else if (DB_ResidenceData.Instance.CurrentRegion.deliverStatus == "WAIT_DELIVERED")
            {
                #region 交付二维码
                contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
                var deliveryQRcodeRow = new FrameLayout()
                {
                    Height = Application.GetRealHeight(50),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                };
                contentView.AddChidren(deliveryQRcodeRow);
                var btnDeliveryQRcodeTitle = new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(308),
                    TextID = StringId.ResidentialDelivery,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                };
                deliveryQRcodeRow.AddChidren(btnDeliveryQRcodeTitle);
                var btnDeliveryQRcodeRightIcon = new Button()
                {
                    X = Application.GetRealWidth(343),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(16),
                    Height = Application.GetMinRealAverage(16),
                    UnSelectedImagePath = "Public/RightIcon.png",
                };
                deliveryQRcodeRow.AddChidren(btnDeliveryQRcodeRightIcon);
                EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
                {
                    var skipPage = new DeliveryQrCodePage();
                    MainPage.BasePageView.AddChidren(skipPage);
                    skipPage.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
                deliveryQRcodeRow.MouseUpEventHandler = eventHandler;
                btnDeliveryQRcodeTitle.MouseUpEventHandler = eventHandler;
                btnDeliveryQRcodeRightIcon.MouseUpEventHandler = eventHandler;
                #endregion
            }
            else
            {
                #region 房屋状态提示
                contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
                var houseStatusTipRow = new FrameLayout()
                {
                    Height = Application.GetRealHeight(50),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                };
                contentView.AddChidren(houseStatusTipRow);
                var btnHouseStatusTipTitle = new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(308),
                    TextID = StringId.HouseStatus,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                };
                houseStatusTipRow.AddChidren(btnHouseStatusTipTitle);
                switch (DB_ResidenceData.Instance.CurrentRegion.deliverStatus)
                {
                    case "To_Be_Debugged"://待调试
                        btnHouseStatusTipTitle.Text += " : "+ Language.StringByID(StringId.To_Be_Debugged);
                        break;
                    case "Debugging"://调试中
                        btnHouseStatusTipTitle.Text += " : " + Language.StringByID(StringId.Debugging);
                        break;
                    case "INITIAL_TATE"://初始态
                        btnHouseStatusTipTitle.Text += " : " + Language.StringByID(StringId.INITIAL_TATE);
                        break;
                    case "ACCEPTANCE"://验收
                        btnHouseStatusTipTitle.Text += " : " + Language.StringByID(StringId.ACCEPTANCE);
                        break;
                    case "To_Be_Accepted"://待验收
                        btnHouseStatusTipTitle.Text += " : " + Language.StringByID(StringId.To_Be_Accepted);
                        break;
                    default:
                        btnHouseStatusTipTitle.Text += " : " + Language.StringByID(StringId.INITIAL_TATE);
                        break;
                }
                #endregion
            }
            LoadEventList();
        }
    }