| | |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | |
| | | var view = new VerticalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(300), |
| | | }; |
| | | contentView.AddChidren(view); |
| | | |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var pack = ApiUtlis.Ins.HttpRequest.GetFaceUnlockCfg(device.deviceId); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //更新界面 |
| | | faceUnlockSetup = Newtonsoft.Json.JsonConvert.DeserializeObject<FaceUnlockSetupObj>(pack.Data.ToString()); |
| | | btnFaceUnlockSwitchIcon.IsSelected = faceUnlockSetup.enabled; |
| | | loadSubView(view, faceUnlockSetup); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | | Text = $"{pack.message}({pack.Code})", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"UnlockSettingPage error : {ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | void loadSubView(VerticalScrolViewLayout view, FaceUnlockSetupObj faceUnlockSetup) |
| | | { |
| | | if (faceUnlockSetup.enabled) |
| | | { |
| | | #region 触发方式 TriggerMode |
| | | var triggerModeView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(triggerModeView); |
| | | view.AddChidren(triggerModeView); |
| | | |
| | | var btnTriggerModeRight = new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | triggerModeView.AddChidren(btnTriggerModeStateText); |
| | | btnTriggerModeStateText.TextID = faceUnlockSetup.mode == 0 ? StringId.AutomaticTriggering : StringId.ManualTriggering; |
| | | |
| | | var btnTriggerModeText = new Button() |
| | | { |
| | |
| | | }; |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.PromptingColor1, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }); |
| | | |
| | | |
| | | view.AddChidren(new Button { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | #region 人脸录入帮助 |
| | | var faceEntryHelpView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(faceEntryHelpView); |
| | | view.AddChidren(faceEntryHelpView); |
| | | |
| | | var btnFaceEntryHelpRight = new Button() |
| | | { |
| | |
| | | }; |
| | | faceEntryHelpView.AddChidren(btnFaceEntryHelpText); |
| | | |
| | | btnFaceEntryHelpText.MouseUpEventHandler = (sender, e) => { |
| | | btnFaceEntryHelpText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new VideoDoorlockFaceUnlockHelpPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var pack = ApiUtlis.Ins.HttpRequest.GetFaceUnlockCfg(device.deviceId); |
| | | if (pack != null && pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //更新界面 |
| | | faceUnlockSetup = Newtonsoft.Json.JsonConvert.DeserializeObject<FaceUnlockSetupObj>(pack.Data.ToString()); |
| | | btnFaceUnlockSwitchIcon.IsSelected = faceUnlockSetup.enabled; |
| | | |
| | | btnTriggerModeStateText.TextID = faceUnlockSetup.mode == 0 ? StringId.AutomaticTriggering : StringId.ManualTriggering; |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | | Text = $"{pack.message}({pack.Code})", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"UnlockSettingPage error : {ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 开关 |
| | | /// </summary> |
| | | public bool enabled; |
| | | public bool enabled = false; |
| | | /// <summary> |
| | | /// 解锁方式 0-自动 1-手动 |
| | | /// </summary> |