wxr
2023-06-05 a2572dfd5f01df2f8c6980e53ff01d1100fbb5c8
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
@@ -395,6 +395,80 @@
                    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 调试权限
@@ -565,72 +639,6 @@
                        break;
                    case "ACCEPTANCE"://验收
                        btnHouseStatusTipTitle.Text += " : " + Language.StringByID(StringId.ACCEPTANCE);
                       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)
                                                {
                                                    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);
                        };
                        break;
                    case "To_Be_Accepted"://待验收