From 43b0d5870d528f23ecd6aeceb6cfd4325188b46f Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 01 七月 2021 15:50:43 +0800 Subject: [PATCH] Revert "1" --- HDL_ON/UI/UI0-Public/AppUnlockPage.cs | 150 ++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 108 insertions(+), 42 deletions(-) diff --git a/HDL_ON/UI/UI0-Public/AppUnlockPage.cs b/HDL_ON/UI/UI0-Public/AppUnlockPage.cs index 64d416a..637798b 100644 --- a/HDL_ON/UI/UI0-Public/AppUnlockPage.cs +++ b/HDL_ON/UI/UI0-Public/AppUnlockPage.cs @@ -73,7 +73,7 @@ { if (!isFirstOpen) { - if (UserInfo.Current.unlockTime.AddSeconds(5) > DateTime.Now || UserInfo.Current.appUnlockPasswrod == "" || UserInfo.Current.appUnlockPage.Count == 0) + if (UserInfo.Current.unlockTime.AddMinutes(5) > DateTime.Now || UserInfo.Current.appUnlockPasswrod == "" || UserInfo.Current.appUnlockPage.Count == 0) { return; } @@ -97,15 +97,18 @@ UserInfo.Current.unlockTime = DateTime.Now; }; + //鎻愮ず鏁板瓧瀵嗙爜楠岃瘉杩樻槸缁樺埗鎵嬪娍楠岃瘉 + string verificationTitleString = GetVerificationTitleString(); + //寮瑰嚭鎸囩汗楠岃瘉瀵硅瘽妗� Action fingerAction = () => { - TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); + TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); }; //鍔犺浇UI椤甸潰 - LoadGesturePage("7", fingerAction); + LoadGesturePage("7", fingerAction, null); - TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); + TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => { if (e == TouchIDUtils.TouchIDState.Success) @@ -140,7 +143,10 @@ /// <summary> /// 鍔犺浇鎸囩汗楠岃瘉鐣岄潰 /// </summary> - public void LoadGesturePage(string optionType, Action fingerAction) + /// <param name="optionType"></param> + /// <param name="fingerAction"></param> + /// <param name="successAction"></param> + public void LoadGesturePage(string optionType, Action fingerAction, Action successAction) { var bodyView = new FrameLayout() { @@ -194,25 +200,37 @@ { ///灏嗛獙璇佹寚绾圭殑椤甸潰绉婚櫎 MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); - Action action = () => - { - UserInfo.Current.unlockTime = DateTime.Now; - }; - if (UserInfo.Current.appUnlockType.Contains("1")) - { - var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(optionType); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else if (UserInfo.Current.appUnlockType.Contains("2")) - { - var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(optionType); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } + //Action action = () => + //{ + // UserInfo.Current.unlockTime = DateTime.Now; + //}; + //if (UserInfo.Current.appUnlockType.Contains("1")) + //{ + // var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action); + // MainPage.BasePageView.AddChidren(page); + // page.LoadPage(optionType); + // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + //} + //else if (UserInfo.Current.appUnlockType.Contains("2")) + //{ + // var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action); + // MainPage.BasePageView.AddChidren(page); + // page.LoadPage(optionType); + // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + //} + if (successAction == null) + { + Action action = () => + { + UserInfo.Current.unlockTime = DateTime.Now; + }; + GotogoToVerifyPasswordPage(optionType, action); + } + else + { + GotogoToVerifyPasswordPage(optionType, successAction); + } }; MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; @@ -232,15 +250,18 @@ UserInfo.Current.unlockTime = DateTime.Now; }; + //鎻愮ず鏁板瓧瀵嗙爜楠岃瘉杩樻槸缁樺埗鎵嬪娍楠岃瘉 + string verificationTitleString = GetVerificationTitleString(); + //寮瑰嚭鎸囩汗楠岃瘉瀵硅瘽妗� Action faceIDAction = () => { - TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); + TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); }; //鍔犺浇UI椤甸潰 - LoadFaceIDGesturePage("7", faceIDAction); + LoadFaceIDGesturePage("7", faceIDAction, null); - TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); + TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => { if (e == TouchIDUtils.TouchIDState.Success) @@ -273,9 +294,12 @@ } /// <summary> - /// 鍔犺浇闈㈠ID楠岃瘉鐣岄潰 + /// 鍔犺浇闈㈠ID楠岃瘉鐣岄潰 /// </summary> - public void LoadFaceIDGesturePage(string optionType, Action faceIDAction) + /// <param name="optionType"></param> + /// <param name="faceIDAction"></param> + /// <param name="successAction">鎸囧畾鎴愬姛鐨勪簨浠跺洖璋�</param> + public void LoadFaceIDGesturePage(string optionType, Action faceIDAction, Action successAction) { var bodyView = new FrameLayout() { @@ -329,23 +353,18 @@ { ///灏嗛獙璇侀潰瀹笽D鐨勯〉闈㈢Щ闄� MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); - Action action = () => + + if (successAction == null) { - UserInfo.Current.unlockTime = DateTime.Now; - }; - if (UserInfo.Current.appUnlockType.Contains("1")) - { - var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(optionType); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + Action action = () => + { + UserInfo.Current.unlockTime = DateTime.Now; + }; + GotogoToVerifyPasswordPage(optionType, action); } - else if (UserInfo.Current.appUnlockType.Contains("2")) + else { - var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(optionType); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + GotogoToVerifyPasswordPage(optionType, successAction); } }; @@ -354,5 +373,52 @@ } + /// <summary> + /// 璺宠浆鎵嬪娍鎴栬�呭瘑鐮侀獙璇佺晫闈� + /// </summary> + /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> + /// <param name="successAction"></param> + void GotogoToVerifyPasswordPage(string optionType, Action successAction) + { + if (UserInfo.Current.appUnlockType.Contains("1")) + { + var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, successAction); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(optionType); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + else if (UserInfo.Current.appUnlockType.Contains("2")) + { + var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, successAction); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(optionType); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + } + + /// <summary> + /// 鍒ゆ柇鏄惁鏁板瓧楠岃瘉銆佸惁鍒欑粯鍒舵墜鍔块獙璇� + /// </summary> + /// <returns></returns> + bool CheckIfUnlockPassword() + { + return UserInfo.Current.appUnlockType.Contains("1"); + } + + /// <summary> + /// 鍒ゆ柇鏄惁鏁板瓧楠岃瘉銆佸惁鍒欑粯鍒舵墜鍔块獙璇� + /// </summary> + /// <returns></returns> + string GetVerificationTitleString() + { + if (CheckIfUnlockPassword()) + { + return Language.StringByID(StringId.PasswordVerification); + } + else + { + return Language.StringByID(StringId.GestureVerification); + } + } } } \ No newline at end of file -- Gitblit v1.8.0