xm
2021-12-01 6d73bf6e816570291865674bef8bce8972e4de3f
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
@@ -1,4 +1,5 @@
using System;
    using System;
using HDL_ON.DAL.Server;
using HDL_ON.UI;
using HDL_ON.UI.CSS;
using Shared;
@@ -147,6 +148,33 @@
        Button btnResetPasswordText;
        Button btnResetPasswordRight;
        #endregion
        #region 个人选项-新增住宅
        /// <summary>
        /// 个人选项-新增住宅区域
        /// </summary>
        FrameLayout addResidenceView;
        /// <summary>
        /// 新增住宅提示文本
        /// </summary>
        Button btnAddResidenceText;
        Button btnAddResidenceScan;
        #endregion
        #region 个人选项-人脸通讯管理
        /// <summary>
        /// 个人选项-人脸通行管理行
        /// </summary>
        FrameLayout faceManagementView;
        /// <summary>
        /// 人脸通行管理文本
        /// </summary>
        Button btnFaceManagementText;
        #endregion
        #endregion
        #endregion
@@ -232,12 +260,17 @@
            /// </summary>
            optionListView = new VerticalScrolViewLayout()
            {
                //Y = headPortraitView.Bottom + Application.GetRealHeight(8),
                Height = Application.GetRealHeight(51 * 5),
                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>
            /// 个人选项-名字区域
@@ -465,7 +498,6 @@
                UnSelectedImagePath = "Public/Right.png",
            };
            thirdPartyAuthorizationView.AddChidren(btnThirdPartyAuthorizationRight);
            //optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            #endregion
            #region 个人选项-修改登录密码区域
            /// <summary>
@@ -482,7 +514,7 @@
            btnResetPasswordText = new Button()
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(120),
                Width = Application.GetRealWidth(220),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
@@ -498,8 +530,148 @@
                UnSelectedImagePath = "Public/Right.png",
            };
            resetPasswordView.AddChidren(btnResetPasswordRight);
            //optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            #endregion
            #region 个人选项-添加住宅
            addResidenceView = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
            };
            optionListView.AddChidren(addResidenceView);
            btnAddResidenceScan = new Button()
            {
                X = Application.GetRealWidth(319),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(30),
                Height = Application.GetMinRealAverage(30),
                UnSelectedImagePath = "Public/ScanGrey.png",
            };
            addResidenceView.AddChidren(btnAddResidenceScan);
            btnAddResidenceText = new Button()
            {
                X = Application.GetRealWidth(16),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.ScanQRCoden,
            };
            addResidenceView.AddChidren(btnAddResidenceText);
            btnAddResidenceText.MouseUpEventHandler = (sender, e) =>
            {
                Scan.OpenScan((scanString) =>
                {
                    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);
                    }
                });
            };
            #endregion
            if (Entity.DB_ResidenceData.Instance.SupportFacePass)
            {
                #region 个人选项-人脸通行管理
                optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
                faceManagementView = new FrameLayout()
                {
                    Height = Application.GetRealHeight(50),
                };
                optionListView.AddChidren(faceManagementView);
                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 = new Button()
                {
                    X = Application.GetRealWidth(16),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextID = StringId.FacePassageSetting,
                };
                faceManagementView.AddChidren(btnFaceManagementText);
                btnFaceManagementText.MouseUpEventHandler = (sender, e) =>
                {
                    var page = new FacePassagePage();
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
                #endregion
            }
            #endregion
            #region 解锁设置区域
@@ -513,11 +685,15 @@
            /// </summary>
            interpretationSettingsView = new FrameLayout()
            {
                //Y = optionListView.Bottom + Application.GetRealHeight(8),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Height = Application.GetRealHeight(66),
                Height = Application.GetRealHeight(70),
            };
            bodyScrolView.AddChidren(interpretationSettingsView);
            if(Language.CurrentLanguage != "Chinese")
            {
                interpretationSettingsView.Height = Application.GetRealHeight(80);
            }
            btnInterpretationSettingsTitle = new Button()
            {
                X = Application.GetRealWidth(16),
@@ -532,12 +708,14 @@
            btnInterpretationSettingsTip = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = btnInterpretationSettingsTitle.Bottom + Application.GetRealHeight(4),
                Y = btnInterpretationSettingsTitle.Bottom,
                Height = Application.GetRealHeight(32),
                Width = Application.GetRealWidth(310),
                TextAlignment = TextAlignment.TopLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.AppUnlockSettingsTip
                TextID = StringId.AppUnlockSettingsTip,
                IsMoreLines = true,
            };
            interpretationSettingsView.AddChidren(btnInterpretationSettingsTip);