wxr
2021-12-15 e1a8f2f7e4d850beedeb1469610b878c1427e976
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
@@ -1,4 +1,5 @@
    using System;
using HDL_ON.DAL.Server;
using HDL_ON.UI;
using HDL_ON.UI.CSS;
using Shared;
@@ -259,11 +260,17 @@
            /// </summary>
            optionListView = new VerticalScrolViewLayout()
            {
                Height = Application.GetRealHeight(51 * (6+1)),
                Height = Application.GetRealHeight(51 * 6),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                ScrollEnabled = false,
            };
            bodyScrolView.AddChidren(optionListView);
            if(Entity.DB_ResidenceData.Instance.SupportFacePass)
            {
                optionListView.Height = Application.GetRealHeight(51 * (6 + 1));
            }
            #region 个人选项-名字区域
            /// <summary>
            /// 个人选项-名字区域
@@ -547,7 +554,7 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.AddResidence,
                TextID = StringId.ScanQRCoden,
            };
            addResidenceView.AddChidren(btnAddResidenceText);
@@ -555,54 +562,121 @@
            {
                Scan.OpenScan((scanString) =>
                {
                    //执行绑定住宅
                    new BindingResidencePage().DoBindResidence(scanString);
                    if (string.IsNullOrEmpty(scanString))
                    {
                    }
                    else
                    {
                        if (scanString.StartsWith("source://bind/"))
                        {
                            var waitPage = new Loading();
                            new System.Threading.Thread(() =>
                            {
                                try
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        waitPage.Start("Plaese wait...");
                                    });
                                    var sendString = scanString.Replace("source://bind/", "");
                                    MainPage.Log($"绑定source屏:{sendString}");
                                //绑定source屏
                                var pack = new HttpServerRequest().BindSourcePanel(sendString);
                                    Application.RunOnMainThread(() =>
                                    {
                                        var title = Language.StringByID(StringId.Tip);
                                        var msg = "";
                                        if (pack.Code == StateCode.SUCCESS)
                                        {
                                            if (Language.CurrentLanguage == "Chinese")
                                            {
                                                msg = "Source屏绑定成功.";
                                            }
                                            else
                                            {
                                                msg = "Source Hub binding succeeded";
                                            }
                                            new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg);
                                        }
                                        else
                                        {
                                            if (Language.CurrentLanguage == "Chinese")
                                            {
                                                msg = $"Source屏绑定失败.({pack.Code})";
                                            }
                                            else
                                            {
                                                msg = "Source Hub binding failed";
                                            }
                                            new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg);
                                        }
                                    });
                                }
                                catch (Exception ex)
                                { }
                                finally
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        waitPage.Hide();
                                    });
                                }
                            })
                            { IsBackground = true }.Start();
                        }
                        else
                        {
                            //执行绑定住宅
                            new BindingResidencePage().DoBindResidence(scanString);
                        }
                    }
                });
            };
            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            #endregion
            #region 个人选项-人脸通行管理
            faceManagementView = new FrameLayout()
            if (Entity.DB_ResidenceData.Instance.SupportFacePass)
            {
                Height = Application.GetRealHeight(50),
            };
            optionListView.AddChidren(faceManagementView);
                #region 个人选项-人脸通行管理
                optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            var btnFaceManagementRight = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            faceManagementView.AddChidren(btnFaceManagementRight);
                faceManagementView = new FrameLayout()
                {
                    Height = Application.GetRealHeight(50),
                };
                optionListView.AddChidren(faceManagementView);
            btnFaceManagementText = new Button()
            {
                X = Application.GetRealWidth(16),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.FacePassageSetting,
            };
            faceManagementView.AddChidren(btnFaceManagementText);
                var btnFaceManagementRight = new Button()
                {
                    X = Application.GetRealWidth(339),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(16),
                    Height = Application.GetMinRealAverage(16),
                    UnSelectedImagePath = "Public/Right.png",
                };
                faceManagementView.AddChidren(btnFaceManagementRight);
            btnFaceManagementText.MouseUpEventHandler = (sender, e) =>
            {
                var page = new FacePassagePage();
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
                btnFaceManagementText = new Button()
                {
                    X = Application.GetRealWidth(16),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextID = StringId.FacePassageSetting,
                };
                faceManagementView.AddChidren(btnFaceManagementText);
            #endregion
                btnFaceManagementText.MouseUpEventHandler = (sender, e) =>
                {
                    var page = new FacePassagePage();
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
                #endregion
            }
            #endregion