From a9d1161b1df96e7ddad566335989a1444e433ef5 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期二, 28 三月 2023 11:54:45 +0800 Subject: [PATCH] 2023年03月28日11:52:02 --- HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs | 305 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 202 insertions(+), 103 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs index e511612..b4b4f4a 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs @@ -1,14 +1,17 @@ -锘� using System; +锘縰sing 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> @@ -27,7 +30,7 @@ /// </summary> ImageView userHeadImageView; - #region 鍥炬爣閫夋嫨閮ㄥ垎鍥炬爣 +#region 鍥炬爣閫夋嫨閮ㄥ垎鍥炬爣 /// <summary> /// 鑳屾櫙鍥鹃�夐」鍖哄煙 /// </summary> @@ -48,14 +51,14 @@ /// 鍙栨秷鎸夐挳 /// </summary> Button btnCancel; - #endregion +#endregion - #region 涓汉淇℃伅閫夐」鍖哄煙 +#region 涓汉淇℃伅閫夐」鍖哄煙 /// <summary> /// 涓汉淇℃伅閫夐」鍖哄煙 /// </summary> VerticalScrolViewLayout optionListView; - #region 涓汉閫夐」-鍚嶅瓧鍖哄煙 +#region 涓汉閫夐」-鍚嶅瓧鍖哄煙 /// <summary> /// 涓汉閫夐」-鍚嶅瓧鍖哄煙 /// </summary> @@ -72,8 +75,8 @@ /// 淇敼鐢ㄦ埛鍚嶇О鎸夐挳 /// </summary> Button btnEditUserNameIcon; - #endregion - #region 涓汉閫夐」-浜岀淮鐮佸尯鍩� +#endregion +#region 涓汉閫夐」-浜岀淮鐮佸尯鍩� /// <summary> /// 涓汉閫夐」-浜岀淮鐮佸尯鍩� /// </summary> @@ -90,8 +93,8 @@ /// 浜岀淮鐮佸墠杩涘浘鏍� /// </summary> Button btnQRcodeRight; - #endregion - #region 涓汉閫夐」-閭淇℃伅鍖哄煙 +#endregion +#region 涓汉閫夐」-閭淇℃伅鍖哄煙 /// <summary> /// 涓汉閫夐」-閭淇℃伅鍖哄煙 /// </summary> @@ -108,8 +111,8 @@ /// 鐢ㄦ埛閭淇℃伅鍓嶈繘鍥炬爣 /// </summary> Button btnUserEmailRight; - #endregion - #region 涓汉閫夐」-鎵嬫満淇℃伅鍖哄煙 +#endregion +#region 涓汉閫夐」-鎵嬫満淇℃伅鍖哄煙 /// <summary> /// 涓汉閫夐」-鎵嬫満淇℃伅鍖哄煙 /// </summary> @@ -126,8 +129,8 @@ /// 鐢ㄦ埛鎵嬫満淇℃伅鍓嶈繘鍥炬爣 /// </summary> Button btnUserPhoneRight; - #endregion - #region 涓汉閫夐」-绗笁鏂规巿鏉冨尯鍩� +#endregion +#region 涓汉閫夐」-绗笁鏂规巿鏉冨尯鍩� /// <summary> /// 涓汉閫夐」-绗笁鏂规巿鏉冨尯鍩� /// </summary> @@ -137,7 +140,7 @@ /// </summary> Button btnThirdPartyAuthorizationTitle; Button btnThirdPartyAuthorizationRight; - #region 涓汉閫夐」-淇敼鐧诲綍瀵嗙爜鍖哄煙 +#region 涓汉閫夐」-淇敼鐧诲綍瀵嗙爜鍖哄煙 /// <summary> /// 涓汉閫夐」-淇敼鐧诲綍瀵嗙爜鍖哄煙 /// </summary> @@ -147,10 +150,10 @@ /// </summary> Button btnResetPasswordText; Button btnResetPasswordRight; - #endregion +#endregion - #region 涓汉閫夐」-鏂板浣忓畢 +#region 涓汉閫夐」-鏂板浣忓畢 /// <summary> /// 涓汉閫夐」-鏂板浣忓畢鍖哄煙 /// </summary> @@ -160,10 +163,10 @@ /// </summary> Button btnAddResidenceText; Button btnAddResidenceScan; - #endregion +#endregion - #region 涓汉閫夐」-浜鸿劯閫氳绠$悊 +#region 涓汉閫夐」-浜鸿劯閫氳绠$悊 /// <summary> /// 涓汉閫夐」-浜鸿劯閫氳绠$悊琛� /// </summary> @@ -172,29 +175,40 @@ /// 浜鸿劯閫氳绠$悊鏂囨湰 /// </summary> Button btnFaceManagementText; - #endregion +#endregion +#region 涓汉閫夐」-璁垮绠$悊 + /// <summary> + /// 涓汉閫夐」-璁垮绠$悊 + /// + /// </summary> + FrameLayout visitorManagementView; + /// <summary> + /// 浜鸿劯閫氳绠$悊鏂囨湰isitor + /// </summary> + Button btnisitorVManagementText; +#endregion - #endregion +#endregion - #endregion +#endregion - #region 瑙i攣璁剧疆鍖哄煙 +#region 瑙i攣璁剧疆鍖哄煙 /// <summary> /// 瑙i攣璁剧疆鍖哄煙 /// </summary> - FrameLayout interpretationSettingsView; - Button btnInterpretationSettingsTitle; - Button btnInterpretationSettingsTip; - Button btnInterpretationSettingsRight; - #endregion + //FrameLayout interpretationSettingsView; + //Button btnInterpretationSettingsTitle; + //Button btnInterpretationSettingsTip; + //Button btnInterpretationSettingsRight; +#endregion /// <summary> /// 閫�鍑虹櫥褰曟寜閽� /// </summary> Button btnLogout; - #endregion +#endregion /// <summary> /// 鏇存柊澶村儚鐨勫洖璋冨嚱鏁� /// </summary> @@ -248,7 +262,7 @@ }; headPortraitView.AddChidren(userHeadImageView); - #region 涓汉淇℃伅閫夐」鍖哄煙 +#region 涓汉淇℃伅閫夐」鍖哄煙 var topPaddingView = new FrameLayout() { Height = Application.GetRealHeight(8) @@ -266,12 +280,23 @@ }; bodyScrolView.AddChidren(optionListView); + //鏍规嵁闇�瑕佹坊鍔犺 + int addRow = 0; if(Entity.DB_ResidenceData.Instance.SupportFacePass) { - optionListView.Height = Application.GetRealHeight(51 * (6 + 1)); + addRow += 1; } - #region 涓汉閫夐」-鍚嶅瓧鍖哄煙 + if (Entity.DB_ResidenceData.Instance.SupportVisitorManage) + { + addRow += 1; + } + + //鏈夊叏瑙嗛�氱殑鎯呭喌 + optionListView.Height = Application.GetRealHeight(51 * (6 + addRow)); + + +#region 涓汉閫夐」-鍚嶅瓧鍖哄煙 /// <summary> /// 涓汉閫夐」-鍚嶅瓧鍖哄煙 /// </summary> @@ -319,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> @@ -367,8 +392,8 @@ UnSelectedImagePath = "Public/Right.png", }; _QRcodeView.AddChidren(btnQRcodeRight); - #endregion - #region 涓汉閫夐」-閭淇℃伅鍖哄煙 +#endregion +#region 涓汉閫夐」-閭淇℃伅鍖哄煙 /// <summary> /// 涓汉閫夐」-閭淇℃伅鍖哄煙 /// </summary> @@ -416,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> @@ -465,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> /// 涓汉閫夐」-绗笁鏂规巿鏉冨尯鍩� @@ -498,8 +523,8 @@ UnSelectedImagePath = "Public/Right.png", }; thirdPartyAuthorizationView.AddChidren(btnThirdPartyAuthorizationRight); - #endregion - #region 涓汉閫夐」-淇敼鐧诲綍瀵嗙爜鍖哄煙 +#endregion +#region 涓汉閫夐」-淇敼鐧诲綍瀵嗙爜鍖哄煙 /// <summary> /// 涓汉閫夐」-淇敼鐧诲綍瀵嗙爜鍖哄煙 /// </summary> @@ -531,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), @@ -560,7 +585,7 @@ btnAddResidenceText.MouseUpEventHandler = (sender, e) => { - Scan.OpenScan((scanString) => + Scan.Ins.OpenScan((scanString) => { if (string.IsNullOrEmpty(scanString)) { @@ -580,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); @@ -633,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() @@ -674,70 +699,124 @@ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; - #endregion +#endregion } - #endregion + //璁垮绠$悊 +#region 涓汉閫夐」-璁垮绠$悊 + if (Entity.DB_ResidenceData.Instance.SupportVisitorManage)//鍒ゆ柇鏄惁鏀寔璁垮绠$悊 + { + optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); - #region 瑙i攣璁剧疆鍖哄煙 + visitorManagementView = new FrameLayout() + { + Height = Application.GetRealHeight(50), + }; + optionListView.AddChidren(visitorManagementView); + + + 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); + + 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); - /// <summary> - /// 瑙i攣璁剧疆鍖哄煙 - /// </summary> - interpretationSettingsView = new FrameLayout() - { - BackgroundColor = CSS_Color.MainBackgroundColor, - Height = Application.GetRealHeight(70), - }; - bodyScrolView.AddChidren(interpretationSettingsView); - if(Language.CurrentLanguage != "Chinese") - { - interpretationSettingsView.Height = Application.GetRealHeight(80); - } - btnInterpretationSettingsTitle = new Button() - { - X = Application.GetRealWidth(16), - Height = Application.GetRealHeight(32), - TextAlignment = TextAlignment.BottomLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextID = StringId.InterpretationSettings, - }; - interpretationSettingsView.AddChidren(btnInterpretationSettingsTitle); +#region 瑙i攣璁剧疆鍖哄煙 + ///// <summary> + ///// 瑙i攣璁剧疆鍖哄煙 + ///// </summary> + //interpretationSettingsView = new FrameLayout() + //{ + // BackgroundColor = CSS_Color.MainBackgroundColor, + // Height = Application.GetRealHeight(70), + //}; + //bodyScrolView.AddChidren(interpretationSettingsView); + //if(Language.CurrentLanguage != "Chinese") + //{ + // interpretationSettingsView.Height = Application.GetRealHeight(80); + //} - btnInterpretationSettingsTip = new Button() - { - X = Application.GetRealWidth(16), - 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, - IsMoreLines = true, - }; - interpretationSettingsView.AddChidren(btnInterpretationSettingsTip); + //btnInterpretationSettingsTitle = new Button() + //{ + // X = Application.GetRealWidth(16), + // Height = Application.GetRealHeight(32), + // TextAlignment = TextAlignment.BottomLeft, + // TextColor = CSS_Color.FirstLevelTitleColor, + // TextSize = CSS_FontSize.SubheadingFontSize, + // TextID = StringId.InterpretationSettings, + //}; + //interpretationSettingsView.AddChidren(btnInterpretationSettingsTitle); - btnInterpretationSettingsRight = new Button() - { - X = Application.GetRealWidth(339), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), - UnSelectedImagePath = "Public/Right.png", - }; - interpretationSettingsView.AddChidren(btnInterpretationSettingsRight); - interpretationSettingsView.AddChidren(new LineView(interpretationSettingsView.Height)); - #endregion + //btnInterpretationSettingsTip = new Button() + //{ + // X = Application.GetRealWidth(16), + // 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, + // IsMoreLines = true, + //}; + //interpretationSettingsView.AddChidren(btnInterpretationSettingsTip); - #region 鏈嶅姟鍣ㄤ俊鎭� + //btnInterpretationSettingsRight = new Button() + //{ + // X = Application.GetRealWidth(339), + // Gravity = Gravity.CenterVertical, + // Width = Application.GetMinRealAverage(16), + // Height = Application.GetMinRealAverage(16), + // UnSelectedImagePath = "Public/Right.png", + //}; + //interpretationSettingsView.AddChidren(btnInterpretationSettingsRight); + //interpretationSettingsView.AddChidren(new LineView(interpretationSettingsView.Height)); +#endregion + +#region 鏈嶅姟鍣ㄤ俊鎭� ListCellView myServerInfoCellView = new ListCellView() { }; @@ -752,9 +831,29 @@ }; myServerInfoCellView.GoAction = selectAction; myServerInfoCellView.BtnTilte.Text = Language.StringByID(StringId.ServerInformation); - myServerInfoCellView.LineView.RemoveFromParent(); + //myServerInfoCellView.LineView.RemoveFromParent(); - #endregion +#endregion + + +#region 娉ㄩ攢璐﹀彿 + ListCellView logOffView = new ListCellView() + { + }; + bodyScrolView.AddChidren(logOffView); + //娉ㄩ攢璐﹀彿鐣岄潰 + Action logOffAction = () => + { + var myServerInfoPage = new CancelAccountPage(); + MainPage.BasePageView.AddChidren(myServerInfoPage); + myServerInfoPage.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + logOffView.GoAction = logOffAction; + logOffView.BtnTilte.Text = Language.StringByID(StringId.CancelAccount); + logOffView.LineView.RemoveFromParent(); + +#endregion btnLogout = new Button() { -- Gitblit v1.8.0