| | |
| | | using System; |
| | | using System; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 当前 |
| | | /// </summary> |
| | | VerticalScrolViewLayout bodyScrolView; |
| | | |
| | | /// <summary> |
| | | /// 头像区域 |
| | | /// </summary> |
| | | FrameLayout headPortraitView; |
| | |
| | | /// 头像按钮 |
| | | /// </summary> |
| | | ImageView userHeadImageView; |
| | | |
| | | |
| | | #region 图标选择部分图标 |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | Button btnCancel; |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region 个人信息选项区域 |
| | | /// <summary> |
| | |
| | | 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 |
| | | |
| | | #region 解锁设置区域 |
| | |
| | | /// 更新头像的回调函数 |
| | | /// </summary> |
| | | Action updataHeadImage; |
| | | /// <summary> |
| | | /// 更新用户名称的回调函数 |
| | | /// </summary> |
| | | Action updataUserName; |
| | | |
| | | public PersonalDataPage(Action upHeadImage) |
| | | public PersonalDataPage(Action upHeadImage, Action upUserName) |
| | | { |
| | | updataHeadImage = upHeadImage; |
| | | updataUserName = upUserName; |
| | | bodyView = this; |
| | | } |
| | | |
| | | public void LoadView() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.PersonalCenter)).LoadTopView(); |
| | | //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.PersonalCenter)); |
| | | |
| | | bodyScrolView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | VerticalScrollBarEnabled = false, |
| | | Height = Application.GetRealHeight(551), |
| | | }; |
| | | bodyView.AddChidren(bodyScrolView); |
| | | |
| | | if (MainPage.Increase) |
| | | { |
| | | bodyScrolView.Height = Application.GetRealHeight(541); |
| | | } |
| | | |
| | | headPortraitView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | //Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(124), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(headPortraitView); |
| | | |
| | | bodyScrolView.AddChidren(headPortraitView); |
| | | |
| | | userHeadImageView = new ImageView() |
| | | { |
| | |
| | | Width = Application.GetMinRealAverage(84), |
| | | Height = Application.GetMinRealAverage(84), |
| | | Radius = (uint)Application.GetMinRealAverage(42), |
| | | ImagePath = MainPage.LoginUser.headImagePagePath, |
| | | ImagePath = UserInfo.Current.headImagePagePath, |
| | | }; |
| | | headPortraitView.AddChidren(userHeadImageView); |
| | | |
| | | #region 个人信息选项区域 |
| | | var topPaddingView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(8) |
| | | }; |
| | | bodyScrolView.AddChidren(topPaddingView); |
| | | |
| | | /// <summary> |
| | | /// 个人信息选项区域 |
| | | /// </summary> |
| | | optionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = headPortraitView.Bottom + Application.GetRealHeight(8), |
| | | Height = Application.GetRealHeight(51 * 6), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | ScrollEnabled = false, |
| | | }; |
| | | bodyView.AddChidren(optionListView); |
| | | bodyScrolView.AddChidren(optionListView); |
| | | |
| | | if(Entity.DB_ResidenceData.Instance.SupportFacePass) |
| | | { |
| | | optionListView.Height = Application.GetRealHeight(51 * (6 + 1)); |
| | | } |
| | | |
| | | #region 个人选项-名字区域 |
| | | /// <summary> |
| | | /// 个人选项-名字区域 |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = string.IsNullOrEmpty(MainPage.LoginUser.userName) ? "不愿意透露姓名的用户" : MainPage.LoginUser.userName |
| | | Text = string.IsNullOrEmpty(UserInfo.Current.userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : UserInfo.Current.userName |
| | | }; |
| | | userNameView.AddChidren(btnUserName); |
| | | /// <summary> |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userEmailInfo |
| | | Text = GetBindAccountText(UserInfo.Current.userEmailInfo) |
| | | }; |
| | | userEmailInfoView.AddChidren(btnUserEmailInfo); |
| | | /// <summary> |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userMobileInfo |
| | | Text = GetBindAccountText(UserInfo.Current.userMobileInfo) |
| | | }; |
| | | userPhoneInfoView.AddChidren(btnUserPhoneInfo); |
| | | /// <summary> |
| | |
| | | optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | #region 个人选项-第三方授权区域 |
| | | //2020-12-08 暂时隐藏第三方授权功能 |
| | | /// <summary> |
| | | /// 个人选项-第三方授权区域 |
| | | /// </summary> |
| | |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | optionListView.AddChidren(thirdPartyAuthorizationView); |
| | | //optionListView.AddChidren(thirdPartyAuthorizationView); |
| | | /// <summary> |
| | | /// 第三方授权文本提示信息按钮 |
| | | /// </summary> |
| | |
| | | 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> |
| | |
| | | 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, |
| | |
| | | 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.AddResidence, |
| | | }; |
| | | addResidenceView.AddChidren(btnAddResidenceText); |
| | | |
| | | btnAddResidenceText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Scan.OpenScan((scanString) => |
| | | { |
| | | //执行绑定住宅 |
| | | 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 |
| | | |
| | | if (Entity.DB_ResidenceData.Instance.SupportFacePass) |
| | | { |
| | | #region 个人选项-人脸通行管理 |
| | | 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 解锁设置区域 |
| | | var topPaddingView2 = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(8) |
| | | }; |
| | | bodyScrolView.AddChidren(topPaddingView2); |
| | | /// <summary> |
| | | /// 解锁设置区域 |
| | | /// </summary> |
| | | interpretationSettingsView = new FrameLayout() |
| | | { |
| | | Y = optionListView.Bottom + Application.GetRealHeight(8), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Height = Application.GetRealHeight(65), |
| | | Height = Application.GetRealHeight(70), |
| | | }; |
| | | bodyView.AddChidren(interpretationSettingsView); |
| | | bodyScrolView.AddChidren(interpretationSettingsView); |
| | | if(Language.CurrentLanguage != "Chinese") |
| | | { |
| | | interpretationSettingsView.Height = Application.GetRealHeight(80); |
| | | } |
| | | |
| | | btnInterpretationSettingsTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | |
| | | TextID = StringId.InterpretationSettings, |
| | | }; |
| | | interpretationSettingsView.AddChidren(btnInterpretationSettingsTitle); |
| | | |
| | | 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.InterpretationSettingsTip |
| | | TextID = StringId.AppUnlockSettingsTip, |
| | | IsMoreLines = true, |
| | | }; |
| | | interpretationSettingsView.AddChidren(btnInterpretationSettingsTip); |
| | | |
| | |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | interpretationSettingsView.AddChidren(btnInterpretationSettingsRight); |
| | | interpretationSettingsView.AddChidren(new LineView(interpretationSettingsView.Height)); |
| | | #endregion |
| | | |
| | | #region 服务器信息 |
| | | ListCellView myServerInfoCellView = new ListCellView() |
| | | { |
| | | }; |
| | | bodyScrolView.AddChidren(myServerInfoCellView); |
| | | //跳转服务器信息 |
| | | Action selectAction = () => |
| | | { |
| | | var myServerInfoPage = new MyServerInfoPage(); |
| | | MainPage.BasePageView.AddChidren(myServerInfoPage); |
| | | myServerInfoPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | myServerInfoCellView.GoAction = selectAction; |
| | | myServerInfoCellView.BtnTilte.Text = Language.StringByID(StringId.ServerInformation); |
| | | myServerInfoCellView.LineView.RemoveFromParent(); |
| | | |
| | | #endregion |
| | | |
| | | btnLogout = new Button() |
| | |
| | | }; |
| | | bodyView.AddChidren(btnLogout); |
| | | |
| | | if (MainPage.Increase) |
| | | { |
| | | btnLogout.Y = Application.GetRealHeight(613); |
| | | btnLogout.Height = Application.GetRealHeight(50); |
| | | bodyView.AddChidren(new Button() { Y = Application.GetRealHeight(663), Height = Application.GetRealHeight(20), BackgroundColor = CSS_Color.MainBackgroundColor }); |
| | | } |
| | | |
| | | LoadEventList(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载图标选择选项 |
| | | /// </summary> |
| | | void LoadPictureOptionView() |
| | | { |
| | | pictureOptionView = new FrameLayout() |
| | | var pictureBaseView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | |
| | | }; |
| | | bodyView.AddChidren(pictureOptionView); |
| | | bodyView.AddChidren(pictureBaseView); |
| | | |
| | | pictureOptionView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(495), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | Height = Application.GetRealHeight(200), |
| | | }; |
| | | pictureBaseView.AddChidren(pictureOptionView); |
| | | |
| | | |
| | | optionView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(495), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Animate = Animate.DownToUp, |
| | | ScrollEnabled = false, |
| | | }; |
| | | pictureOptionView.AddChidren(optionView); |
| | | |
| | | //btnDefaultGallery = new Button() |
| | | //{ |
| | | // Height = Application.GetRealHeight(50), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.TextualColor, |
| | | // SelectedTextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // TextID = StringId.DefaultGallery, |
| | | //}; |
| | | //optionView.AddChidren(btnDefaultGallery); |
| | | //optionView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | btnTakePicture = new Button() |
| | | { |
| | |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(6), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | Animate = Animate.DownToUp |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | pictureOptionView.AddChidren(btnCancel); |
| | | |
| | | |
| | | LoadEvent_PictureOptionViewEventList(); |
| | | LoadEvent_PictureOptionViewEventList(pictureBaseView); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取绑定账号显示文本,空的时候显示为未绑定 |
| | | /// </summary> |
| | | /// <param name="account"></param> |
| | | string GetBindAccountText(string account) |
| | | { |
| | | return string.IsNullOrEmpty(account) ? Language.StringByID(StringId.Unbound) : account; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断是否为未绑定 |
| | | /// </summary> |
| | | /// <param name="account"></param> |
| | | /// <returns></returns> |
| | | bool CheckIfUnbound(string account) |
| | | { |
| | | return string.IsNullOrEmpty(account) || account == Language.StringByID(StringId.Unbound); |
| | | } |
| | | } |
| | | } |