| | |
| | | }; |
| | | communityRow.AddChidren(btnCommunityAccessControlIcon); |
| | | |
| | | btnCommunityAccessControlIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnCommunityAccessControlIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if(customerObj.faceClose == 3)//没有人脸数据不能开启人脸通行功能 |
| | | { |
| | | return; |
| | |
| | | btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected; |
| | | int switchStatus = btnCommunityAccessControlIcon.IsSelected == true ? 1 :2; |
| | | |
| | | //失败回调 |
| | | Action action = () => { |
| | | btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected; |
| | | //刷新回调 |
| | | Action action = () => |
| | | { |
| | | initButtonStatus(); |
| | | }; |
| | | editFaceInfo(switchStatus,action); |
| | | }; |
| | |
| | | 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); |
| | |
| | | /// <summary> |
| | | /// 获取人脸信息 |
| | | /// </summary> |
| | | void ReadFaceInfo() |
| | | void ReadFaceInfo(bool isLoading = true) |
| | | { |
| | | var waitPage = new Loading(); |
| | | 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(); |
| | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => { |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = true; |
| | | }; |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => { |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = true; |
| | | }; |
| | | |
| | |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath,2,imageName); |
| | | }, imageName, 4, 6, 400); |
| | | }, imageName, 4, 6, 400);//OutputYSize目前仅对Android有些 400代表Y的最多分辨率,所以最终得到图片的分辨率为:266*400 |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | //上传成功到回调 |
| | | Action<bool> uploadSuccessAction = (isSuccess) => |
| | | { |
| | | Action action = () => { |
| | | //点击重新录入事件 |
| | | Action action = () => |
| | | { |
| | | if (!isSuccess) |
| | | { |
| | | if (imageSource == 1) |
| | |
| | | CropImageCallBack(imagePath, 1,imageName); |
| | | }, imageName, 4, 6, 400); |
| | | } |
| | | }else |
| | | { |
| | | ReadFaceInfo(); |
| | | } |
| | | }; |
| | | |
| | | if (isSuccess) |
| | | { |
| | | ReadFaceInfo(false); |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var page = new FaceSettingResultPage(action); |