wjc
2023-03-28 a9d1161b1df96e7ddad566335989a1444e433ef5
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
@@ -1,15 +1,17 @@
    using System;
using System;
using HDL_ON.DAL.Server;
using HDL_ON.UI;
using HDL_ON.UI.CSS;
using Shared;
using HDL_ON.UI.UI2.PersonalCenter.Visitor;
#if IOS
using Foundation;
#endif
namespace HDL_ON.UI
{
    public partial class PersonalDataPage : FrameLayout
    {
        #region 控件列表
#region 控件列表
        /// <summary>
        /// 当前
        /// </summary>
@@ -28,7 +30,7 @@
        /// </summary>
        ImageView userHeadImageView;
        #region 图标选择部分图标
#region 图标选择部分图标
        /// <summary>
        /// 背景图选项区域
        /// </summary>
@@ -49,14 +51,14 @@
        /// 取消按钮
        /// </summary>
        Button btnCancel;
        #endregion
#endregion
        #region 个人信息选项区域
#region 个人信息选项区域
        /// <summary>
        /// 个人信息选项区域
        /// </summary>
        VerticalScrolViewLayout optionListView;
        #region 个人选项-名字区域
#region 个人选项-名字区域
        /// <summary>
        /// 个人选项-名字区域
        /// </summary>
@@ -73,8 +75,8 @@
        /// 修改用户名称按钮
        /// </summary>
        Button btnEditUserNameIcon;
        #endregion
        #region 个人选项-二维码区域
#endregion
#region 个人选项-二维码区域
        /// <summary>
        /// 个人选项-二维码区域
        /// </summary>
@@ -91,8 +93,8 @@
        /// 二维码前进图标
        /// </summary>
        Button btnQRcodeRight;
        #endregion
        #region 个人选项-邮箱信息区域
#endregion
#region 个人选项-邮箱信息区域
        /// <summary>
        /// 个人选项-邮箱信息区域
        /// </summary>
@@ -109,8 +111,8 @@
        /// 用户邮箱信息前进图标
        /// </summary>
        Button btnUserEmailRight;
        #endregion
        #region 个人选项-手机信息区域
#endregion
#region 个人选项-手机信息区域
        /// <summary>
        /// 个人选项-手机信息区域
        /// </summary>
@@ -127,8 +129,8 @@
        /// 用户手机信息前进图标
        /// </summary>
        Button btnUserPhoneRight;
        #endregion
        #region 个人选项-第三方授权区域
#endregion
#region 个人选项-第三方授权区域
        /// <summary>
        /// 个人选项-第三方授权区域
        /// </summary>
@@ -138,7 +140,7 @@
        /// </summary>
        Button btnThirdPartyAuthorizationTitle;
        Button btnThirdPartyAuthorizationRight;
        #region 个人选项-修改登录密码区域
#region 个人选项-修改登录密码区域
        /// <summary>
        /// 个人选项-修改登录密码区域
        /// </summary>
@@ -148,10 +150,10 @@
        /// </summary>
        Button btnResetPasswordText;
        Button btnResetPasswordRight;
        #endregion
#endregion
        #region 个人选项-新增住宅
#region 个人选项-新增住宅
        /// <summary>
        /// 个人选项-新增住宅区域
        /// </summary>
@@ -161,10 +163,10 @@
        /// </summary>
        Button btnAddResidenceText;
        Button btnAddResidenceScan;
        #endregion
#endregion
        #region 个人选项-人脸通讯管理
#region 个人选项-人脸通讯管理
        /// <summary>
        /// 个人选项-人脸通行管理行
        /// </summary>
@@ -173,9 +175,9 @@
        /// 人脸通行管理文本
        /// </summary>
        Button btnFaceManagementText;
        #endregion
#endregion
        #region 个人选项-访客管理
#region 个人选项-访客管理
        /// <summary>
        /// 个人选项-访客管理
        ///
@@ -185,13 +187,13 @@
        /// 人脸通行管理文本isitor
        /// </summary>
        Button btnisitorVManagementText;
        #endregion
#endregion
        #endregion
#endregion
        #endregion
#endregion
        #region 解锁设置区域
#region 解锁设置区域
        /// <summary>
        /// 解锁设置区域
        /// </summary>
@@ -199,14 +201,14 @@
        //Button btnInterpretationSettingsTitle;
        //Button btnInterpretationSettingsTip;
        //Button btnInterpretationSettingsRight;
        #endregion
#endregion
        /// <summary>
        /// 退出登录按钮
        /// </summary>
        Button btnLogout;
        #endregion
#endregion
        /// <summary>
        /// 更新头像的回调函数
        /// </summary>
@@ -260,7 +262,7 @@
            };
            headPortraitView.AddChidren(userHeadImageView);
            #region 个人信息选项区域
#region 个人信息选项区域
            var topPaddingView = new FrameLayout()
            {
                Height = Application.GetRealHeight(8)
@@ -294,7 +296,7 @@
            optionListView.Height = Application.GetRealHeight(51 * (6 + addRow));
            #region 个人选项-名字区域
#region 个人选项-名字区域
            /// <summary>
            /// 个人选项-名字区域
            /// </summary>
@@ -342,8 +344,8 @@
            };
            userNameView.AddChidren(btnEditUserNameIcon);
            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            #endregion
            #region 个人选项-二维码区域
#endregion
#region 个人选项-二维码区域
            /// <summary>
            /// 个人选项-二维码区域
            /// </summary>
@@ -390,8 +392,8 @@
                UnSelectedImagePath = "Public/Right.png",
            };
            _QRcodeView.AddChidren(btnQRcodeRight);
            #endregion
            #region 个人选项-邮箱信息区域
#endregion
#region 个人选项-邮箱信息区域
            /// <summary>
            /// 个人选项-邮箱信息区域
            /// </summary>
@@ -439,8 +441,8 @@
            };
            userEmailInfoView.AddChidren(btnUserEmailRight);
            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            #endregion
            #region 个人选项-手机信息区域
#endregion
#region 个人选项-手机信息区域
            /// <summary>
            /// 个人选项-手机信息区域
            /// </summary>
@@ -488,8 +490,8 @@
            };
            userPhoneInfoView.AddChidren(btnUserPhoneRight);
            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            #endregion
            #region 个人选项-第三方授权区域
#endregion
#region 个人选项-第三方授权区域
            //2020-12-08 暂时隐藏第三方授权功能
            /// <summary>
            /// 个人选项-第三方授权区域
@@ -521,8 +523,8 @@
                UnSelectedImagePath = "Public/Right.png",
            };
            thirdPartyAuthorizationView.AddChidren(btnThirdPartyAuthorizationRight);
            #endregion
            #region 个人选项-修改登录密码区域
#endregion
#region 个人选项-修改登录密码区域
            /// <summary>
            /// 个人选项-修改登录密码区域
            /// </summary>
@@ -554,9 +556,9 @@
            };
            resetPasswordView.AddChidren(btnResetPasswordRight);
            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            #endregion
#endregion
            #region 个人选项-添加住宅
#region 个人选项-添加住宅
            addResidenceView = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
@@ -603,8 +605,8 @@
                                    });
                                    var sendString = scanString.Replace("source://bind/", "");
                                    MainPage.Log($"绑定source屏:{sendString}");
                                //绑定source屏
                                var pack = new HttpServerRequest().BindSourcePanel(sendString);
                                    //绑定source屏
                                    var pack = new HttpServerRequest().BindSourcePanel(sendString);
                                    Application.RunOnMainThread(() =>
                                    {
                                        var title = Language.StringByID(StringId.Tip);
@@ -656,11 +658,11 @@
                });
            };
            #endregion
#endregion
            if (Entity.DB_ResidenceData.Instance.SupportFacePass)
            {
                #region 个人选项-人脸通行管理
#region 个人选项-人脸通行管理
                optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
                faceManagementView = new FrameLayout()
@@ -697,58 +699,72 @@
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
                #endregion
#endregion
            }
            //访客管理
            #region 个人选项-访客管理
            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            visitorManagementView = new FrameLayout()
#region 个人选项-访客管理
            if (Entity.DB_ResidenceData.Instance.SupportVisitorManage)//判断是否支持访客管理
            {
                Height = Application.GetRealHeight(50),
            };
            optionListView.AddChidren(visitorManagementView);
                optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            var btnVisitorManagementRight = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            visitorManagementView.AddChidren(btnVisitorManagementRight);
                visitorManagementView = new FrameLayout()
                {
                    Height = Application.GetRealHeight(50),
                };
                optionListView.AddChidren(visitorManagementView);
            btnisitorVManagementText = new Button()
            {
                X = Application.GetRealWidth(16),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.VisitorManage,
            };
            visitorManagementView.AddChidren(btnisitorVManagementText);
            btnisitorVManagementText.MouseUpEventHandler = (sender, e) =>
            {
                //刷新接口请求所需要的参数
                NSDictionary info = new NSDictionary("regionUrl", HttpUtil.GlobalRequestHttpsHost, "token", UserInfo.Current.LoginTokenString, "appkey", "HDL-HOME-APP-TEST", "secret", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", "refreshToken" ,UserInfo.Current.RefreshToken);
                Shared.IOS.HDLFVSDK.Video.RefreshInfo(info);
                //跳转访客管理界面
                Shared.IOS.HDLFVSDK.Video.ShowVisitorManager();
            };
                var btnVisitorManagementRight = new Button()
                {
                    X = Application.GetRealWidth(339),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(16),
                    Height = Application.GetMinRealAverage(16),
                    UnSelectedImagePath = "Public/Right.png",
                };
                visitorManagementView.AddChidren(btnVisitorManagementRight);
            #endregion
            #endregion
                btnisitorVManagementText = new Button()
                {
                    X = Application.GetRealWidth(16),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextID = StringId.VisitorManage,
                };
                visitorManagementView.AddChidren(btnisitorVManagementText);
                btnisitorVManagementText.MouseUpEventHandler = (sender, e) =>
                {
#if __IOS__
                    //刷新接口请求所需要的参数
                    Foundation.NSDictionary info = new Foundation.NSDictionary("regionUrl", HttpUtil.GlobalRequestHttpsHost, "token", UserInfo.Current.LoginTokenString, "appkey", "HDL-HOME-APP-TEST", "secret", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", "refreshToken", UserInfo.Current.RefreshToken);
                    Shared.IOS.HDLFVSDK.Video.RefreshInfo(info);
                    ////跳转访客管理界面
                    Shared.IOS.HDLFVSDK.Video.ShowVisitorManager();
#else
                    var page = new VisitorQRCodePage();
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
#endif
                };
            }
#endregion
#endregion
            var topPaddingView2 = new FrameLayout()
            {
                Height = Application.GetRealHeight(8)
            };
            bodyScrolView.AddChidren(topPaddingView2);
            #region 解锁设置区域
#region 解锁设置区域
            ///// <summary>
            ///// 解锁设置区域
            ///// </summary>
@@ -798,9 +814,9 @@
            //};
            //interpretationSettingsView.AddChidren(btnInterpretationSettingsRight);
            //interpretationSettingsView.AddChidren(new LineView(interpretationSettingsView.Height));
            #endregion
#endregion
            #region 服务器信息
#region 服务器信息
            ListCellView myServerInfoCellView = new ListCellView()
            {
            };
@@ -817,10 +833,10 @@
            myServerInfoCellView.BtnTilte.Text = Language.StringByID(StringId.ServerInformation);
            //myServerInfoCellView.LineView.RemoveFromParent();
            #endregion
#endregion
            #region 注销账号
#region 注销账号
            ListCellView logOffView = new ListCellView()
            {
            };
@@ -837,7 +853,7 @@
            logOffView.BtnTilte.Text = Language.StringByID(StringId.CancelAccount);
            logOffView.LineView.RemoveFromParent();
            #endregion
#endregion
            btnLogout = new Button()
            {