wxr
2020-05-11 7f233a10afa6882b4d9531185af60e8843bc1af2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
using System;
using Shared;
namespace HDL_ON.UI
{
    /// <summary>
    /// app解锁界面
    /// </summary>
    public static class AppUnlockPage
    {
        static DateTime unlockTime = DateTime.MinValue;
        static Dialog Dialog;
        static void LoadOption()
        {
           
            Action action = () => {
                unlockTime = DateTime.Now;
            };
            //1:验证指纹
            if (MainPage.LoginUser.appUnlockType.Contains("3"))
            {
                TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
                TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
                {
                    if (e == TouchIDUtils.TouchIDState.Success)
                    {
                        MainPage.Log("KK:TouchID验证成功");
                        unlockTime = DateTime.Now;
                        MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
                    }
                    else
                    {
                        ///将验证指纹的页面移除
                        MainPage.BasePageView.RemoveAt( MainPage.BasePageView.ChildrenCount - 1);
 
                        if (MainPage.LoginUser.appUnlockType.Contains("1"))
                        {
                            var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action);
                            MainPage.BasePageView.AddChidren(page);
                            page.LoadPage("7");
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        }
                        else if (MainPage.LoginUser.appUnlockType.Contains("1"))
                        {
                            var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action);
                            MainPage.BasePageView.AddChidren(page);
                            page.LoadPage("7");
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        }
                    }
                };
            }
            else if (MainPage.LoginUser.appUnlockType.Contains("4"))
            {
                //Face ID验证
                //
            }
            else if (MainPage.LoginUser.appUnlockType.Contains("1"))
            {
                var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage("7");
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            }
            else if (MainPage.LoginUser.appUnlockType.Contains("2"))
            {
                var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage("7");
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            }
        }
 
 
        public static void LoadPage()
        {
            if (unlockTime.AddSeconds(60) > DateTime.Now || MainPage.LoginUser.appUnlockPasswrod == "" || MainPage.LoginUser.appUnlockPage.Count == 0)
            {
                return;
            }
            var bodyView = new FrameLayout()
            {
                BackgroundColor = CSS.CSS_Color.MainBackgroundColor
            };
            MainPage.BasePageView.AddChidren(bodyView);
            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
 
 
            bodyView.AddChidren(new Button() {
                Height = Application.GetRealHeight(64),
                BackgroundColor = CSS.CSS_Color.BackgroundColor,
            });
 
            bodyView.AddChidren(new Button()
            {
                Y = Application.GetRealHeight(196),
                Height = Application.GetRealHeight(42),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
                TextSize = CSS.CSS_FontSize.SubheadingFontSize,
                TextID = StringId.PleaseVerifyTheFingerprint,
            });
 
            var btnFingerIcon = new Button()
            {
                Y = Application.GetRealHeight(260),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(102),
                Height = Application.GetRealWidth(102),
                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FingerIconRed.png",
            };
            bodyView.AddChidren(btnFingerIcon);
 
            btnFingerIcon.MouseUpEventHandler = (sender, e) => {
                LoadOption();
            };
 
            var btnOtherVerify = new Button()
            {
                Y = Application.GetRealHeight(527),
                Height = Application.GetRealHeight(40),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS.CSS_Color.MainColor,
                TextSize = CSS.CSS_FontSize.TextFontSize,
                TextID = MainPage.LoginUser.appUnlockType.Contains("1") ? StringId.VerifyDigitalPassword : StringId.VerifyGesturePassword
            };
            bodyView.AddChidren(btnOtherVerify);
 
            btnOtherVerify.MouseUpEventHandler = (sender, e) => {
                ///将验证指纹的页面移除
                MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
 
                Action action = () => {
                    unlockTime = DateTime.Now;
                };
                if (MainPage.LoginUser.appUnlockType.Contains("1"))
                {
                    var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action);
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage("7");
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                }
                else if (MainPage.LoginUser.appUnlockType.Contains("2"))
                {
                    var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action);
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage("7");
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                }
            };
            LoadOption();
 
        }
    }
}