| | |
| | | contentView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667-64), |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | |
| | | }; |
| | | topView.AddChidren(btnText1); |
| | | |
| | | topView.AddChidren(new Button() { Height = 1,BackgroundColor = CSS_Color.DividingLineColor,Y = Application.GetRealHeight(188) ,X = Application.GetRealWidth(16),Width = Application.GetRealWidth(359)}); |
| | | topView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(188), X = Application.GetRealWidth(16), Width = Application.GetRealWidth(359) }); |
| | | |
| | | #region 社区门禁通行 |
| | | var communityRow = new FrameLayout() |
| | |
| | | }; |
| | | communityRow.AddChidren(btnCommunityAccessControlIcon); |
| | | |
| | | btnCommunityAccessControlIcon.MouseUpEventHandler = (sender, e) => { |
| | | if(customerObj.faceClose == 3)//没有人脸数据不能开启人脸通行功能 |
| | | btnCommunityAccessControlIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (customerObj.faceClose == 3)//没有人脸数据不能开启人脸通行功能 |
| | | { |
| | | return; |
| | | } |
| | | btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected; |
| | | int switchStatus = btnCommunityAccessControlIcon.IsSelected == true ? 1 :2; |
| | | int switchStatus = btnCommunityAccessControlIcon.IsSelected == true ? 1 : 2; |
| | | |
| | | //失败回调 |
| | | Action action = () => { |
| | | btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected; |
| | | //刷新回调 |
| | | Action action = () => |
| | | { |
| | | initButtonStatus(); |
| | | }; |
| | | editFaceInfo(switchStatus,action); |
| | | editFaceInfo(switchStatus, action); |
| | | }; |
| | | |
| | | #endregion |
| | |
| | | IsBold = true, |
| | | }; |
| | | contentView.AddChidren(btnSetFaceId); |
| | | btnSetFaceId.MouseUpEventHandler = (sender, e) => { |
| | | btnSetFaceId.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadPictureOptionView(); |
| | | }; |
| | | |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | }; |
| | | btnEraseData.MouseUpEventHandler = (sender,e) => { |
| | | Action action = () => { |
| | | btnEraseData.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action action = () => |
| | | { |
| | | initButtonStatus(); |
| | | }; |
| | | editFaceInfo(3,action); |
| | | editFaceInfo(3, action); |
| | | }; |
| | | |
| | | ReadFaceInfo(); |
| | |
| | | /// <summary> |
| | | /// 获取人脸信息 |
| | | /// </summary> |
| | | void ReadFaceInfo() |
| | | void ReadFaceInfo(bool isLoading = true) |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | Loading waitPage = null; |
| | | if (isLoading) |
| | | { |
| | | waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | } |
| | | |
| | | new Thread(() => |
| | | { |
| | | try |
| | |
| | | |
| | | } |
| | | } |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取人脸信息异常:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | |
| | | /// <summary> |
| | | /// 清除人脸数据 |
| | | /// </summary> |
| | | void editFaceInfo(int status,Action action) |
| | | void editFaceInfo(int status, Action action) |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | |
| | | return; |
| | | } |
| | | } |
| | | btnCommunityAccessControlIcon.IsSelected = false; |
| | | btnEraseData.RemoveFromParent(); |
| | | btnSetFaceId.TextID = StringId.SetFace; |
| | | btnCommunityAccessControlIcon.IsSelected = false; |
| | | btnEraseData.RemoveFromParent(); |
| | | btnSetFaceId.TextID = StringId.SetFace; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | pictureOptionView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(445+50), |
| | | Y = Application.GetRealHeight(445 + 50), |
| | | Height = Application.GetRealHeight(250), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => { |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = true; |
| | | }; |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | |
| | | var imageName = Guid.NewGuid().ToString(); |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath,1,imageName); |
| | | CropImageCallBack(imagePath, 1, imageName); |
| | | }, imageName, 4, 6, 400); |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => { |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = true; |
| | | }; |
| | | |
| | |
| | | //var imageName = scene.sid; |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath,2,imageName); |
| | | }, imageName, 4, 6, 400); |
| | | CropImageCallBack(imagePath, 2, imageName); |
| | | }, imageName, 4, 6, 400);//OutputYSize目前仅对Android有些 400代表Y的最多分辨率,所以最终得到图片的分辨率为:266*400 |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 裁剪完照片回调,统一处理 |
| | | /// </summary> |
| | | /// <param name="imagePath">裁剪后的真实路径</param> |
| | | /// <param name="imageSource">照片来源;1:拍照;2:图库</param> |
| | | void CropImageCallBack(string selectImagePath,int imageSource,string imageName) |
| | | void CropImageCallBack(string selectImagePath, int imageSource, string imageName) |
| | | { |
| | | if (string.IsNullOrEmpty(selectImagePath) == true) |
| | | { |
| | |
| | | //上传成功到回调 |
| | | Action<bool> uploadSuccessAction = (isSuccess) => |
| | | { |
| | | Action action = () => { |
| | | //点击重新录入事件 |
| | | Action action = () => |
| | | { |
| | | if (!isSuccess) |
| | | { |
| | | if (imageSource == 1) |
| | |
| | | { |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 1,imageName); |
| | | CropImageCallBack(imagePath, 1, imageName); |
| | | }, imageName, 4, 6, 400); |
| | | } |
| | | }else |
| | | { |
| | | ReadFaceInfo(); |
| | | } |
| | | }; |
| | | |
| | | if (isSuccess) |
| | | { |
| | | ReadFaceInfo(false); |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var page = new FaceSettingResultPage(action); |