wxr
2024-09-24 3aba1c7fea5f0adb1b169e8060ce956188e80a2b
删除解锁APP的模式
16个文件已修改
4381 ■■■■ 已修改文件
HDL-ON_iOS/AppDelegate.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/ViewController.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/HDLCommon.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/OnAppConfig.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPageBLL.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs 850 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs 924 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPage.cs 1432 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs 1022 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SiriIntents/Server/HttpUtil.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/AppDelegate.cs
@@ -410,9 +410,8 @@
                        {
                            if (pushMes.Extras.Contains("OffLine"))
                            {
                                //haveToSignOut = true;
                                //强制下线
                                UserInfo.Current.LastTime = DateTime.MinValue;
                                UserInfo.Current.ValidToken = false;
                                UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//重置用户头像
                                UserInfo.Current.SaveUserInfo();
                                HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices));
HDL-ON_iOS/ViewController.cs
@@ -56,18 +56,20 @@
            }
            //启动友盟sdk
            new System.Threading.Thread(() => {
                while (true)
                {
                    if (OnAppConfig.Instance.IsLogin)
                    {
                        //var um = new UMSdk.HDLUMSDK();
                        //UMSdk.HDLUMSDK.InitUMSDKWithAppKey("61d56642e0f9bb492bbc3e72", "IOS");
                        break;
                    }
                    System.Threading.Thread.Sleep(1000);
                }
            }) { IsBackground = true }.Start();
            //new System.Threading.Thread(() => {
            //    int count = 0;
            //    while (count<5)
            //    {
            //        count++;
            //        if (OnAppConfig.Instance.IsLogin)
            //        {
            //            var um = new UMSdk.HDLUMSDK();
            //            UMSdk.HDLUMSDK.InitUMSDKWithAppKey("61d56642e0f9bb492bbc3e72", "IOS");
            //            break;
            //        }
            //        System.Threading.Thread.Sleep(1000);
            //    }
            //}) { IsBackground = true }.Start();
            
HDL_ON/Common/ApiUtlis.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using HDL_ON;
using HDL_ON.DAL;
using System.Net.Http;
using System.Threading.Tasks;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.UI2.FuntionControlView.Video;
@@ -76,7 +76,7 @@
        /// <summary>
        /// token是否有效
        /// </summary>
        public bool tokenInvalid = false;
        public bool IsValidToken = false;
        public bool hadInternet = true;
        /// <summary>
@@ -104,12 +104,12 @@
            string code = StateCode.SUCCESS;
            Inverter.Ins.H5Page = null;//重置光伏页面
            var downloadDataThread = new System.Threading.Thread(() =>
            var downloadDataThread = new System.Threading.Thread(async() =>
            {
                try
                {
                    //增加3秒云服务器连接检测,连不上服务器的时候不刷新数据
                    hadInternet = true;
                    //hadInternet = true;
                    var dataList = new List<GlobalRegionListRes>();
                    var requestJson = HttpUtil.GetSignRequestJson(new GetRegionListObj() { regionMark = HttpUtil.RegionMark });
                    var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost, "", 3);
@@ -163,6 +163,7 @@
                }
                finally
                {
                    MainPage.Log("服务器连接状态:" + hadInternet);
                    if (!hadInternet)
                    {
                        Application.RunOnMainThread(() =>
@@ -181,7 +182,7 @@
                if (code != StateCode.SUCCESS)
                {
                    DownloadDataComplete = true;
                    hadInternet = false;
                    IsValidToken= false;
                    try
                    {
                        var spatialInfoDataBytes = FileUtlis.Files.ReadFile("SpatialInfoData");
@@ -214,14 +215,8 @@
                        MainPage.Log("Error", $"{this.GetType()}:加载缓存设备数据异常:{ex.StackTrace}");
                    }
                    MainPage.Log($"刷新token失败");
                    return;
                }
                else
                {
                    hadInternet = true;
                }
                if (code != StateCode.SUCCESS)
                {
                    if (waitPage != null)
                    {
                        Application.RunOnMainThread(() =>
@@ -236,6 +231,10 @@
                        });
                    }
                    return;
                }
                else
                {
                    hadInternet = true;
                }
                MainPage.Log($"刷新token成功");
                //===================刷新住宅信息=======================
@@ -824,6 +823,24 @@
            var pack = Ins.HttpRequest.GetSecurityList();
        }
        //public async Task<bool> CanConnectToHost()
        //{
        //    try
        //    {
        //        using (HttpClient client = new HttpClient())
        //        {
        //            client.Timeout = TimeSpan.FromSeconds(3); // 超时时间
        //            HttpResponseMessage response = await client.GetAsync(HttpUtil.GlobalRequestHttpsHost);
        //            return response.IsSuccessStatusCode;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        MainPage.Log(ex.StackTrace);
        //        return false;
        //    }
        //}
    }
}
HDL_ON/Common/HDLCommon.cs
@@ -537,10 +537,7 @@
            switch (UserInfo.Current.AccountString)
            {
                case "464027401@qq.com":
                case "649362315@qq.com":
                case "13580507523":
                case "15626203746":
                case "18316672920":
                    
                    return;
            }
@@ -589,8 +586,10 @@
                            //2.注销推送
                            new HttpServerRequest().SignOutPush();
                            //3.跳转登录页面
                            UserInfo.Current.LastTime = DateTime.MinValue;
                            UserInfo.Current.ValidToken = false;
                            UserInfo.Current.SaveUserInfo();
                            OnAppConfig.Instance.LastLoginUserId = "";
                            OnAppConfig.Instance.SaveConfig();
                            DB_ResidenceData.Instance.EixtAccount();
                            MainPage.Log("退出账号清空数据");
                            //4.注销HDLSIP账号登录 2021-08-20
@@ -644,7 +643,7 @@
        public void ShowAlarmPushMessage(JPushMessageInfo jpushMessageInfo, bool isAlarm)
        {
            //没登录不处理
            if (UserInfo.Current == null || !UserInfo.Current.IsLogin || MainPage.BasePageView == null)
            if (UserInfo.Current == null || MainPage.BasePageView == null)
            {
                return;
            }
HDL_ON/Common/OnAppConfig.cs
@@ -65,7 +65,6 @@
                    return false;
                else
                {
                    //return (DateTime.Now - LastTime).TotalDays < 7;
                    return true;
                }
            }
HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,13 +18,13 @@
        /// 固定域名,正式环境
        /// 公共域名就近解析
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string APP_KEY = "HDL-HOME-APP";
        public const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC";
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string APP_KEY = "HDL-HOME-APP";
        //public const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
        //public const string APP_KEY = "HDL-HOME-APP-TEST";
        //public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
        public const string APP_KEY = "HDL-HOME-APP-TEST";
        public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
        //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm
        //const string APP_KEY = "CPEVRLRT";
@@ -330,7 +330,7 @@
                    UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken;
                    UserInfo.Current.AccessToken = revertData.accessToken;
                    UserInfo.Current.RefreshToken = revertData.refreshToken;
                    UserInfo.Current.LastTime = DateTime.Now;
                    UserInfo.Current.ValidToken = true;
                    UserInfo.Current.SaveUserInfo();
#if __IOS__
                    var sdm = new SiriKit.SceneDateManager();
@@ -341,7 +341,7 @@
                }
                else //if (revertObj.Code == StateCode.PasswrodError)
                {
                    UserInfo.Current.LastTime = DateTime.MinValue;
                    UserInfo.Current.ValidToken = false;
                }
                return false;
            }
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -320,7 +320,7 @@
                    etAccount.Text = "13682244600";
                    etAccount.Text = "pjh@hdlchina.com.cn";
                    etAccount.Text = "13580507523";
                    etAccount.Text = "18475593023";
                    //etAccount.Text = "18475593023";
                }
                else
                {
@@ -337,6 +337,7 @@
                    etAccount.Text = "15626203746";
                }
                //etAccount.Text = "13580507523";
                b = !b;
                etPassword.Text = "123456";
                if (etAccount.Text == "13682244600")
HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -648,24 +648,6 @@
                        var getResidencesResult = LoadMethod_GetResidences();
                        if (getResidencesResult)
                        {
                            /*
                             * Wait : 推送注册
                             */
                            /*
                             * 查看本地是否存在数据
                             * 存在则导出
                             */
                            //var isExis = FileUtils.IsExisFolder(DB_ResidenceData.residenceData.CurReginID);
                            //if (isExis)
                            //{
                            //    FileUtils.DeleteAllFile();
                            //    string regionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID);
                            //    FileUtils.RestoreRegionFiles(regionRootPath);
                            //    DB_ResidenceData.residenceData.EixtAccount();
                            //    OnAppConfig.Instance.RefreshUserConfig();
                            //    SpatialInfo.CurrentSpatial.InitRoomFunction();
                            //}
                            Application.RunOnMainThread(() =>
                            {
                                //20201223-登录成功之后,将下载数据完成标记标记为false,防止主页提前加载
@@ -677,18 +659,9 @@
                        }
                        else
                        {
                            //Application.RunOnMainThread(() =>
                            //{
                            //    BindingResidencePage page = new BindingResidencePage();
                            //    MainPage.BaseView.AddChidren(page);
                            //    page.LoadView();
                            //});
                            //2020-11-13 待确认
                            //获取住宅失败,重新标记为未登录状态
                            UserInfo.Current.LastTime = DateTime.MinValue;
                            UserInfo.Current.ValidToken = false;
                            UserInfo.Current.SaveUserInfo();
                            //登录失败,请先添加住宅!
                            //Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList));
@@ -748,7 +721,7 @@
                UserInfo.Current.ClearUserInfo();
                UserInfo.Current.userType = revertData.userType;
                UserInfo.Current.AccountString = account;
                UserInfo.Current.LastTime = DateTime.Now;
                UserInfo.Current.ValidToken = true;
                UserInfo.Current.ID = revertData.userId;
                UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken;
                UserInfo.Current.AccessToken = revertData.accessToken;
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -535,7 +535,7 @@
                #region 功能场景切换
                bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0x00000000 });
                bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0xFFFF0000 });
                loadNavView();
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -271,10 +271,6 @@
            {
                bodyView.divLinkStateTip.Visible = true;
            }
            //else if ()
            //{
            //    bodyView.divLinkStateTip.Visible = true;
            //}
            else
            {
                bodyView.divLinkStateTip.Visible = false;
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -286,7 +286,6 @@
                btnExit.MouseUpEventHandler = (sender, e) =>
                {
                    MainPage.NoLoginMode = false;
                    UserInfo.Current.ClearUserInfo();
                    HDLCommon.Current.Logout();
                };
                bodyView.AddChidren(btnExit);
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs
@@ -1,462 +1,462 @@
using System;
using HDL_ON.UI.CSS;
using Shared;
using HDL_ON.DAL.Server;
//using System;
//using HDL_ON.UI.CSS;
//using Shared;
//using HDL_ON.DAL.Server;
namespace HDL_ON.UI
{
    /// <summary>
    /// 手势解锁
    /// </summary>
    public class AppUnlockGesturePage : FrameLayout
    {
        /// <summary>
        ///
        /// </summary>
        FrameLayout bodyView;
        /// <summary>
        /// 错误提示按钮
        /// </summary>
        Button btnTipMsg;
//namespace HDL_ON.UI
//{
//    /// <summary>
//    /// 手势解锁
//    /// </summary>
//    public class AppUnlockGesturePage : FrameLayout
//    {
//        /// <summary>
//        ///
//        /// </summary>
//        FrameLayout bodyView;
//        /// <summary>
//        /// 错误提示按钮
//        /// </summary>
//        Button btnTipMsg;
        string passwrod = "";
        string oldPasswrod = "";
        Action backAction;
        public AppUnlockGesturePage(string pw, Action action)
        {
            bodyView = this;
            bodyView.Tag = "unlockpage";
            oldPasswrod = pw;
            backAction = action;
        }
//        string passwrod = "";
//        string oldPasswrod = "";
//        Action backAction;
//        public AppUnlockGesturePage(string pw, Action action)
//        {
//            bodyView = this;
//            bodyView.Tag = "unlockpage";
//            oldPasswrod = pw;
//            backAction = action;
//        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="optionType">
        /// 操作方式:
        /// 1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;
        /// 5:关闭指纹ID;6:关闭面容ID;7:解锁验证
        /// </param>
        public void LoadPage(string optionType)
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //解锁验证无法后退,必须验证
            if (optionType != "7")
            {
                if (oldPasswrod == "")
                    new TopViewDiv(bodyView, Language.StringByID(StringId.SetGesturePassword)).LoadTopView();
                else
                    new TopViewDiv(bodyView, Language.StringByID(StringId.VerifyGesturePassword)).LoadTopView();
            }
            Button btnGestureIcon = new Button()
            {
                Y = Application.GetRealHeight(96),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(64),
                Height = Application.GetRealWidth(64),
                //UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureGrayIcon.png",
            };
            bodyView.AddChidren(btnGestureIcon);
//        /// <summary>
//        ///
//        /// </summary>
//        /// <param name="optionType">
//        /// 操作方式:
//        /// 1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;
//        /// 5:关闭指纹ID;6:关闭面容ID;7:解锁验证
//        /// </param>
//        public void LoadPage(string optionType)
//        {
//            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
//            //解锁验证无法后退,必须验证
//            if (optionType != "7")
//            {
//                if (oldPasswrod == "")
//                    new TopViewDiv(bodyView, Language.StringByID(StringId.SetGesturePassword)).LoadTopView();
//                else
//                    new TopViewDiv(bodyView, Language.StringByID(StringId.VerifyGesturePassword)).LoadTopView();
//            }
//            Button btnGestureIcon = new Button()
//            {
//                Y = Application.GetRealHeight(96),
//                Gravity = Gravity.CenterHorizontal,
//                Width = Application.GetRealWidth(64),
//                Height = Application.GetRealWidth(64),
//                //UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureGrayIcon.png",
//            };
//            bodyView.AddChidren(btnGestureIcon);
            Button btnTipTitle = new Button()
            {
                Y = Application.GetRealHeight(4) + btnGestureIcon.Bottom,
                TextAlignment = TextAlignment.Center,
                Height = Application.GetRealHeight(36),
                IsBold = true,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
                TextID =  StringId.VerifyGesturePassword,
            };
            bodyView.AddChidren(btnTipTitle);
//            Button btnTipTitle = new Button()
//            {
//                Y = Application.GetRealHeight(4) + btnGestureIcon.Bottom,
//                TextAlignment = TextAlignment.Center,
//                Height = Application.GetRealHeight(36),
//                IsBold = true,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
//                TextID =  StringId.VerifyGesturePassword,
//            };
//            bodyView.AddChidren(btnTipTitle);
            btnTipMsg = new Button()
            {
                Y = btnTipTitle.Bottom,
                TextAlignment = TextAlignment.Center,
                Height = Application.GetRealHeight(36),
                IsBold = true,
                TextColor = CSS_Color.TextualColor,
                SelectedTextColor = CSS_Color.WarningColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.DrawUnlockPattern,
            };
            bodyView.AddChidren(btnTipMsg);
//            btnTipMsg = new Button()
//            {
//                Y = btnTipTitle.Bottom,
//                TextAlignment = TextAlignment.Center,
//                Height = Application.GetRealHeight(36),
//                IsBold = true,
//                TextColor = CSS_Color.TextualColor,
//                SelectedTextColor = CSS_Color.WarningColor,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextID = StringId.DrawUnlockPattern,
//            };
//            bodyView.AddChidren(btnTipMsg);
            if (optionType == "1")
            {
                btnTipMsg.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.DrawUnlockPattern : StringId.DrawUnlockPatternAgain;
                //设置手势密码
                btnTipTitle.TextID = StringId.SetGesturePassword;
            }else if(optionType == "2")
            {
                //请输入原手势密码
                btnTipTitle.TextID = StringId.PleaseDrawTheOriginalGesturePassword;
            }
//            if (optionType == "1")
//            {
//                btnTipMsg.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.DrawUnlockPattern : StringId.DrawUnlockPatternAgain;
//                //设置手势密码
//                btnTipTitle.TextID = StringId.SetGesturePassword;
//            }else if(optionType == "2")
//            {
//                //请输入原手势密码
//                btnTipTitle.TextID = StringId.PleaseDrawTheOriginalGesturePassword;
//            }
            //if (optionType == "7")
            //{
            //    //请绘制解锁图案
            //    btnTipTitle.TextID = StringId.DrawUnlockPattern;
            //}
//            //if (optionType == "7")
//            //{
//            //    //请绘制解锁图案
//            //    btnTipTitle.TextID = StringId.DrawUnlockPattern;
//            //}
            GestureLockView mGestureLockView = new GestureLockView
            {
                Y = Application.GetRealHeight(260),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(215),
                Height = Application.GetRealWidth(215),
                LockViewCorrectColor = CSS_Color.MainColor,//0xFF00FF00,//默认和正确 时显示的颜色
                LockViewErrorColor = 0xFFFF0000, //错误时 显示的颜色
                BackgroundColor = CSS_Color.BackgroundColor,
            };
            bodyView.AddChidren(mGestureLockView);
            mGestureLockView.SetSolidType(true);
            //滑动结束 回调密码结果和密码长度
            mGestureLockView.OnLockVerifyEvent += (selectNumStr, selectCount) =>
            {
                //自行验证密码,提示正确或者错误 false为显示红色错误, 自行选择调用时机
                mGestureLockView.showCorrectStatus(false);
                if (selectCount < 4)
                {
                    btnTipMsg.Text = Language.StringByID(StringId.DrawingLengthError);
                    btnTipMsg.TextColor = CSS_Color.WarningColor;
                    return;
                }
//            GestureLockView mGestureLockView = new GestureLockView
//            {
//                Y = Application.GetRealHeight(260),
//                Gravity = Gravity.CenterHorizontal,
//                Width = Application.GetRealWidth(215),
//                Height = Application.GetRealWidth(215),
//                LockViewCorrectColor = CSS_Color.MainColor,//0xFF00FF00,//默认和正确 时显示的颜色
//                LockViewErrorColor = 0xFFFF0000, //错误时 显示的颜色
//                BackgroundColor = CSS_Color.BackgroundColor,
//            };
//            bodyView.AddChidren(mGestureLockView);
//            mGestureLockView.SetSolidType(true);
//            //滑动结束 回调密码结果和密码长度
//            mGestureLockView.OnLockVerifyEvent += (selectNumStr, selectCount) =>
//            {
//                //自行验证密码,提示正确或者错误 false为显示红色错误, 自行选择调用时机
//                mGestureLockView.showCorrectStatus(false);
//                if (selectCount < 4)
//                {
//                    btnTipMsg.Text = Language.StringByID(StringId.DrawingLengthError);
//                    btnTipMsg.TextColor = CSS_Color.WarningColor;
//                    return;
//                }
                passwrod = selectNumStr;
//                passwrod = selectNumStr;
                if (string.IsNullOrEmpty(oldPasswrod))
                {
                    this.RemoveFromParent();
                    var page = new AppUnlockGesturePage(passwrod, backAction);
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage(optionType);
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                }
                else
                {
                    //2020-12-11 密码校验
                    if (passwrod == oldPasswrod)
                    {
                        //密码验证通过
                        PasswordInputPassed(optionType);
                    }
                    else
                    {
                        //密码验证失败
                        PasswordInputError(optionType);
                    }
//                if (string.IsNullOrEmpty(oldPasswrod))
//                {
//                    this.RemoveFromParent();
//                    var page = new AppUnlockGesturePage(passwrod, backAction);
//                    MainPage.BasePageView.AddChidren(page);
//                    page.LoadPage(optionType);
//                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//                }
//                else
//                {
//                    //2020-12-11 密码校验
//                    if (passwrod == oldPasswrod)
//                    {
//                        //密码验证通过
//                        PasswordInputPassed(optionType);
//                    }
//                    else
//                    {
//                        //密码验证失败
//                        PasswordInputError(optionType);
//                    }
                    
                }
//                }
            };
//            };
            
            if (optionType == "7")
            {
                //使用账户密码登录按钮 提示按钮
                AddLoginTipButton();
            }
            else if (optionType != "1")
            {
                //输入登录密码验证 提示按钮
                AddInputPasswordTipButton(optionType);
            }
//            if (optionType == "7")
//            {
//                //使用账户密码登录按钮 提示按钮
//                AddLoginTipButton();
//            }
//            else if (optionType != "1")
//            {
//                //输入登录密码验证 提示按钮
//                AddInputPasswordTipButton(optionType);
//            }
            //if (optionType == "5" || optionType == "6" || optionType == "7")
            //{
            //    Button btnLoginAccountVerify = new Button()
            //    {
            //        Y = Application.GetRealHeight(517),
            //        Height = Application.GetRealHeight(60),
            //        TextAlignment = TextAlignment.Center,
            //        TextSize = CSS_FontSize.TextFontSize,
            //        TextColor = CSS_Color.MainColor,
            //        TextID = StringId.EnterLoginPasswordVerification,
            //    };
            //    bodyView.AddChidren(btnLoginAccountVerify);
//            //if (optionType == "5" || optionType == "6" || optionType == "7")
//            //{
//            //    Button btnLoginAccountVerify = new Button()
//            //    {
//            //        Y = Application.GetRealHeight(517),
//            //        Height = Application.GetRealHeight(60),
//            //        TextAlignment = TextAlignment.Center,
//            //        TextSize = CSS_FontSize.TextFontSize,
//            //        TextColor = CSS_Color.MainColor,
//            //        TextID = StringId.EnterLoginPasswordVerification,
//            //    };
//            //    bodyView.AddChidren(btnLoginAccountVerify);
            //    btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
            //    {
            //        if (optionType == "7")
            //        {
            //            MainPage.GoLoginPage(UserInfo.Current);
            //        }
            //        else
            //        {
            //            Action<string> action = (pw) =>
            //            {
            //                var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
            //                if (resultObj.Code == StateCode.SUCCESS)
            //                {
            //                    UserInfo.Current.appUnlockPasswrod = "";
            //                    UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();
            //                    UserInfo.Current.SaveUserInfo();
            //                    this.RemoveFromParent();
            //                    backAction();
            //                }
            //                else
            //                {
            //                    //登录失败
            //                    IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
            //                }
//            //    btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
//            //    {
//            //        if (optionType == "7")
//            //        {
//            //            MainPage.GoLoginPage(UserInfo.Current);
//            //        }
//            //        else
//            //        {
//            //            Action<string> action = (pw) =>
//            //            {
//            //                var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
//            //                if (resultObj.Code == StateCode.SUCCESS)
//            //                {
//            //                    UserInfo.Current.appUnlockPasswrod = "";
//            //                    UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();
//            //                    UserInfo.Current.SaveUserInfo();
//            //                    this.RemoveFromParent();
//            //                    backAction();
//            //                }
//            //                else
//            //                {
//            //                    //登录失败
//            //                    IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
//            //                }
            //            };
            //            new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true);
            //        }
            //    };
            //}
        }
//            //            };
//            //            new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true);
//            //        }
//            //    };
//            //}
//        }
        /// <summary>
        /// 手势密码输入错误显示错误信息
        /// </summary>
        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param>
        void PasswordInputError(string optionType)
        {
            int errorTextID = 0;
            if (optionType == "1")
            {
                //2次绘制点图案不一致,请重新绘制
                errorTextID = StringId.DrawingInconsistencyError;
            }
            else
            {
                //验证失败,密码错误.
                errorTextID = StringId.AuthenticationFailedPasswordError;
            }
//        /// <summary>
//        /// 手势密码输入错误显示错误信息
//        /// </summary>
//        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param>
//        void PasswordInputError(string optionType)
//        {
//            int errorTextID = 0;
//            if (optionType == "1")
//            {
//                //2次绘制点图案不一致,请重新绘制
//                errorTextID = StringId.DrawingInconsistencyError;
//            }
//            else
//            {
//                //验证失败,密码错误.
//                errorTextID = StringId.AuthenticationFailedPasswordError;
//            }
            btnTipMsg.TextID = errorTextID;
            btnTipMsg.IsSelected = true;
            btnTipMsg.Visible = true;
        }
//            btnTipMsg.TextID = errorTextID;
//            btnTipMsg.IsSelected = true;
//            btnTipMsg.Visible = true;
//        }
        /// <summary>
        /// 手势密码验证通过后的操作
        /// </summary>
        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param>
        void PasswordInputPassed(string optionType)
        {
            if (optionType == "1")
            {
                //设置密码 验证通过
                this.RemoveFromParent();
                var page = new OperationResultDisPalyPage();
                page.Show();
                page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), "");
                //page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), "");
                string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) :
                                Language.StringByID(StringId.TurnOnFaceIdUnlocking);
                if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None)
                {
                    var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4";
//        /// <summary>
//        /// 手势密码验证通过后的操作
//        /// </summary>
//        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param>
//        void PasswordInputPassed(string optionType)
//        {
//            if (optionType == "1")
//            {
//                //设置密码 验证通过
//                this.RemoveFromParent();
//                var page = new OperationResultDisPalyPage();
//                page.Show();
//                page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), "");
//                //page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), "");
//                string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) :
//                                Language.StringByID(StringId.TurnOnFaceIdUnlocking);
//                if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None)
//                {
//                    var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4";
                    //如果之前没设置指纹或者面容ID才显示是否开启
                    if (!UserInfo.Current.appUnlockType.Contains(unlockType))
                    {
                        Action<bool> action = (result) =>
                    {
                        if (result)
                        {
                            if (!UserInfo.Current.appUnlockType.Contains(unlockType))
                            {
                                UserInfo.Current.appUnlockType.Add(unlockType);
                            }
                        }
                        else
                        {
                            if (UserInfo.Current.appUnlockType.Contains(unlockType))
                            {
                                UserInfo.Current.appUnlockType.Remove(unlockType);
                            }
                        }
                        UserInfo.Current.SaveUserInfo();
                        backAction();
                    };
                        page.AdditionalOperations(tipMsg, action);
                    }
                }
                if (!UserInfo.Current.appUnlockType.Contains("2"))
                {
                    UserInfo.Current.appUnlockType.Add("2");
                }
                UserInfo.Current.appUnlockPasswrod = passwrod;
                UserInfo.Current.SaveUserInfo();
                backAction();
            }
            else if (optionType == "2")
            {
                //验证密码通过
                //移除当前界面,每次返回都返回到最上级
                this.RemoveFromParent();
                var page = new AppUnlockGesturePage("", backAction);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage("1");
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            }
            else if (optionType == "3" || optionType == "4")
            {
                //3:关闭密码;4:关闭解锁设置 通过
                if (optionType == "4")
                {
                    backAction();
                    this.RemoveFromParent();
                    return;
                }
                if (UserInfo.Current.appUnlockType.Contains("2"))
                {
                    UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();
                    UserInfo.Current.appUnlockPasswrod = "";
                    UserInfo.Current.SaveUserInfo();
                    this.RemoveFromParent();
                    backAction();
                }
//                    //如果之前没设置指纹或者面容ID才显示是否开启
//                    if (!UserInfo.Current.appUnlockType.Contains(unlockType))
//                    {
//                        Action<bool> action = (result) =>
//                    {
//                        if (result)
//                        {
//                            if (!UserInfo.Current.appUnlockType.Contains(unlockType))
//                            {
//                                UserInfo.Current.appUnlockType.Add(unlockType);
//                            }
//                        }
//                        else
//                        {
//                            if (UserInfo.Current.appUnlockType.Contains(unlockType))
//                            {
//                                UserInfo.Current.appUnlockType.Remove(unlockType);
//                            }
//                        }
//                        UserInfo.Current.SaveUserInfo();
//                        backAction();
//                    };
//                        page.AdditionalOperations(tipMsg, action);
//                    }
//                }
//                if (!UserInfo.Current.appUnlockType.Contains("2"))
//                {
//                    UserInfo.Current.appUnlockType.Add("2");
//                }
//                UserInfo.Current.appUnlockPasswrod = passwrod;
//                UserInfo.Current.SaveUserInfo();
//                backAction();
//            }
//            else if (optionType == "2")
//            {
//                //验证密码通过
//                //移除当前界面,每次返回都返回到最上级
//                this.RemoveFromParent();
//                var page = new AppUnlockGesturePage("", backAction);
//                MainPage.BasePageView.AddChidren(page);
//                page.LoadPage("1");
//                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//            }
//            else if (optionType == "3" || optionType == "4")
//            {
//                //3:关闭密码;4:关闭解锁设置 通过
//                if (optionType == "4")
//                {
//                    backAction();
//                    this.RemoveFromParent();
//                    return;
//                }
//                if (UserInfo.Current.appUnlockType.Contains("2"))
//                {
//                    UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();
//                    UserInfo.Current.appUnlockPasswrod = "";
//                    UserInfo.Current.SaveUserInfo();
//                    this.RemoveFromParent();
//                    backAction();
//                }
            }
            else if (optionType == "5")
            {
                //5:指纹ID开关 通过
                if (UserInfo.Current.appUnlockType.Contains("3"))
                    UserInfo.Current.appUnlockType.Remove("3");
                else
                    UserInfo.Current.appUnlockType.Add("3");
//            }
//            else if (optionType == "5")
//            {
//                //5:指纹ID开关 通过
//                if (UserInfo.Current.appUnlockType.Contains("3"))
//                    UserInfo.Current.appUnlockType.Remove("3");
//                else
//                    UserInfo.Current.appUnlockType.Add("3");
                UserInfo.Current.SaveUserInfo();
                this.RemoveFromParent();
                backAction();
            }
            else if (optionType == "6")
            {
                //6:面容ID开关 通过
                if (UserInfo.Current.appUnlockType.Contains("4"))
                    UserInfo.Current.appUnlockType.Remove("4");
                else
                    UserInfo.Current.appUnlockType.Add("4");
//                UserInfo.Current.SaveUserInfo();
//                this.RemoveFromParent();
//                backAction();
//            }
//            else if (optionType == "6")
//            {
//                //6:面容ID开关 通过
//                if (UserInfo.Current.appUnlockType.Contains("4"))
//                    UserInfo.Current.appUnlockType.Remove("4");
//                else
//                    UserInfo.Current.appUnlockType.Add("4");
                UserInfo.Current.SaveUserInfo();
                this.RemoveFromParent();
//                UserInfo.Current.SaveUserInfo();
//                this.RemoveFromParent();
            }
            else if (optionType == "7")
            {
                //7:解锁验证 通过
                this.RemoveFromParent();
                backAction();
            }
        }
//            }
//            else if (optionType == "7")
//            {
//                //7:解锁验证 通过
//                this.RemoveFromParent();
//                backAction();
//            }
//        }
        /// <summary>
        /// 使用账户密码登录按钮 提示按钮
        /// </summary>
        void AddLoginTipButton()
        {
            Button btnLoginAccountVerify = new Button()
            {
                Y = Application.GetRealHeight(517),
                Height = Application.GetRealHeight(60),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.MainColor,
                TextID = StringId.LogWithAccountAndPassword,
            };
            bodyView.AddChidren(btnLoginAccountVerify);
//        /// <summary>
//        /// 使用账户密码登录按钮 提示按钮
//        /// </summary>
//        void AddLoginTipButton()
//        {
//            Button btnLoginAccountVerify = new Button()
//            {
//                Y = Application.GetRealHeight(517),
//                Height = Application.GetRealHeight(60),
//                TextAlignment = TextAlignment.Center,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextColor = CSS_Color.MainColor,
//                TextID = StringId.LogWithAccountAndPassword,
//            };
//            bodyView.AddChidren(btnLoginAccountVerify);
            btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
            {
                //退出登录
                HDLCommon.Current.Logout();
            };
        }
//            btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
//            {
//                //退出登录
//                HDLCommon.Current.Logout();
//            };
//        }
        /// <summary>
        /// 输入登录密码验证 提示按钮
        /// </summary>
        void AddInputPasswordTipButton(string optionType)
        {
            Button btnLoginAccountVerify = new Button()
            {
                Y = Application.GetRealHeight(517),
                Height = Application.GetRealHeight(60),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.MainColor,
                TextID = StringId.EnterLoginPasswordVerification,
            };
            bodyView.AddChidren(btnLoginAccountVerify);
//        /// <summary>
//        /// 输入登录密码验证 提示按钮
//        /// </summary>
//        void AddInputPasswordTipButton(string optionType)
//        {
//            Button btnLoginAccountVerify = new Button()
//            {
//                Y = Application.GetRealHeight(517),
//                Height = Application.GetRealHeight(60),
//                TextAlignment = TextAlignment.Center,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextColor = CSS_Color.MainColor,
//                TextID = StringId.EnterLoginPasswordVerification,
//            };
//            bodyView.AddChidren(btnLoginAccountVerify);
            btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
            {
                //输入登录密码验证
                Action<string> action = (pw) =>
                {
                    AuthenticationByLoginPassword(pw, optionType);
                    //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
                    //if (resultObj.Code == StateCode.SUCCESS)
                    //{
                    //    PasswordInputPassed(optionType);
                    //}
                    //else
                    //{
                    //    Application.RunOnMainThread(() =>
                    //    {
                    //        Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
                    //    });
                    //}
//            btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
//            {
//                //输入登录密码验证
//                Action<string> action = (pw) =>
//                {
//                    AuthenticationByLoginPassword(pw, optionType);
//                    //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
//                    //if (resultObj.Code == StateCode.SUCCESS)
//                    //{
//                    //    PasswordInputPassed(optionType);
//                    //}
//                    //else
//                    //{
//                    //    Application.RunOnMainThread(() =>
//                    //    {
//                    //        Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
//                    //    });
//                    //}
                };
                new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true);
            };
        }
//                };
//                new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true);
//            };
//        }
        /// <summary>
        /// 登录密码验证
        /// </summary>
        /// <param name="pw"></param>
        /// <param name="optionType"></param>
        void AuthenticationByLoginPassword(string pw, string optionType)
        {
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
//        /// <summary>
//        /// 登录密码验证
//        /// </summary>
//        /// <param name="pw"></param>
//        /// <param name="optionType"></param>
//        void AuthenticationByLoginPassword(string pw, string optionType)
//        {
//            var waitPage = new Loading();
//            bodyView.AddChidren(waitPage);
//            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new System.Threading.Thread(() =>
            {
                try
                {
                    var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
                    Application.RunOnMainThread(() =>
                    {
                        if (resultObj.Code == StateCode.SUCCESS)
                        {
                            PasswordInputPassed(optionType);
                        }
                        else
                        {
                            Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
                        }
                    });
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
    }
}
//            new System.Threading.Thread(() =>
//            {
//                try
//                {
//                    var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
//                    Application.RunOnMainThread(() =>
//                    {
//                        if (resultObj.Code == StateCode.SUCCESS)
//                        {
//                            PasswordInputPassed(optionType);
//                        }
//                        else
//                        {
//                            Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
//                        }
//                    });
//                }
//                catch { }
//                finally
//                {
//                    Application.RunOnMainThread(() =>
//                    {
//                        if (waitPage != null)
//                        {
//                            waitPage.RemoveFromParent();
//                            waitPage = null;
//                        }
//                    });
//                }
//            })
//            { IsBackground = true }.Start();
//        }
//    }
//}
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs
@@ -1,503 +1,503 @@
using System;
using Shared;
using HDL_ON.UI.CSS;
using HDL_ON.DAL.Server;
//using System;
//using Shared;
//using HDL_ON.UI.CSS;
//using HDL_ON.DAL.Server;
namespace HDL_ON.UI
{
    /// <summary>
    /// 密码解锁
    /// </summary>
    public partial class AppUnlockPasswordPage : FrameLayout
    {
        FrameLayout bodyView;
        EditText etPassword;
        /// <summary>
        ///
        /// </summary>
        Button btnTipError;
//namespace HDL_ON.UI
//{
//    /// <summary>
//    /// 密码解锁
//    /// </summary>
//    public partial class AppUnlockPasswordPage : FrameLayout
//    {
//        FrameLayout bodyView;
//        EditText etPassword;
//        /// <summary>
//        ///
//        /// </summary>
//        Button btnTipError;
        string passwrod = "";
        string oldPasswrod = "";
        Action backAction;
        public AppUnlockPasswordPage(string pw, Action action)
        {
            bodyView = this;
            bodyView.Tag = "unlockpage";
            oldPasswrod = pw;
            backAction = action;
        }
//        string passwrod = "";
//        string oldPasswrod = "";
//        Action backAction;
//        public AppUnlockPasswordPage(string pw, Action action)
//        {
//            bodyView = this;
//            bodyView.Tag = "unlockpage";
//            oldPasswrod = pw;
//            backAction = action;
//        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="optionType">
        /// 操作方式:
        /// 1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;
        /// 5:指纹ID开关;6:面容ID开关;7:解锁验证
        /// </param>
        public void LoadPage(string optionType)
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //解锁验证无法后退,必须验证
            if (optionType != "7")
            {
                if (oldPasswrod == "")
                    new TopViewDiv(bodyView, Language.StringByID(StringId.SetDigitalPassword)).LoadTopView();
                else
                    new TopViewDiv(bodyView, Language.StringByID(StringId.VerifyDigitalPassword)).LoadTopView();
            }
//        /// <summary>
//        ///
//        /// </summary>
//        /// <param name="optionType">
//        /// 操作方式:
//        /// 1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;
//        /// 5:指纹ID开关;6:面容ID开关;7:解锁验证
//        /// </param>
//        public void LoadPage(string optionType)
//        {
//            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
//            //解锁验证无法后退,必须验证
//            if (optionType != "7")
//            {
//                if (oldPasswrod == "")
//                    new TopViewDiv(bodyView, Language.StringByID(StringId.SetDigitalPassword)).LoadTopView();
//                else
//                    new TopViewDiv(bodyView, Language.StringByID(StringId.VerifyDigitalPassword)).LoadTopView();
//            }
            var btnTipTitle = new Button()
            {
                Y = Application.GetRealWidth(186),
                Height = Application.GetRealWidth(42),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword,
            };
            bodyView.AddChidren(btnTipTitle);
//            var btnTipTitle = new Button()
//            {
//                Y = Application.GetRealWidth(186),
//                Height = Application.GetRealWidth(42),
//                TextAlignment = TextAlignment.Center,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.SubheadingFontSize,
//                TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword,
//            };
//            bodyView.AddChidren(btnTipTitle);
            if (optionType == "1")
            {
                btnTipTitle.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword;
            }
            else if (optionType == "2")
            {
                btnTipTitle.TextID = StringId.PleaseEnterTheOriginalDigitalPassword;
            }
            else
            {
                btnTipTitle.TextID = StringId.PlsEntryPassword;
            }
//            if (optionType == "1")
//            {
//                btnTipTitle.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword;
//            }
//            else if (optionType == "2")
//            {
//                btnTipTitle.TextID = StringId.PleaseEnterTheOriginalDigitalPassword;
//            }
//            else
//            {
//                btnTipTitle.TextID = StringId.PlsEntryPassword;
//            }
            var btnTipIcon1 = new Button()
            {
                X = Application.GetRealWidth(132),
                Y = Application.GetRealWidth(238),
                Width = Application.GetRealWidth(16),
                Height = Application.GetRealWidth(16),
                BorderColor = CSS_Color.FirstLevelTitleColor,
                BorderWidth = (uint)Application.GetRealWidth(1),
                Radius = (uint)Application.GetRealWidth(8),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor,
            };
            bodyView.AddChidren(btnTipIcon1);
//            var btnTipIcon1 = new Button()
//            {
//                X = Application.GetRealWidth(132),
//                Y = Application.GetRealWidth(238),
//                Width = Application.GetRealWidth(16),
//                Height = Application.GetRealWidth(16),
//                BorderColor = CSS_Color.FirstLevelTitleColor,
//                BorderWidth = (uint)Application.GetRealWidth(1),
//                Radius = (uint)Application.GetRealWidth(8),
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//                SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor,
//            };
//            bodyView.AddChidren(btnTipIcon1);
            var btnTipIcon2 = new Button()
            {
                X = btnTipIcon1.Right + Application.GetRealWidth(16),
                Y = Application.GetRealWidth(238),
                Width = Application.GetRealWidth(16),
                Height = Application.GetRealWidth(16),
                BorderColor = CSS_Color.FirstLevelTitleColor,
                BorderWidth = (uint)Application.GetRealWidth(1),
                Radius = (uint)Application.GetRealWidth(8),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor,
            };
            bodyView.AddChidren(btnTipIcon2);
//            var btnTipIcon2 = new Button()
//            {
//                X = btnTipIcon1.Right + Application.GetRealWidth(16),
//                Y = Application.GetRealWidth(238),
//                Width = Application.GetRealWidth(16),
//                Height = Application.GetRealWidth(16),
//                BorderColor = CSS_Color.FirstLevelTitleColor,
//                BorderWidth = (uint)Application.GetRealWidth(1),
//                Radius = (uint)Application.GetRealWidth(8),
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//                SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor,
//            };
//            bodyView.AddChidren(btnTipIcon2);
            var btnTipIcon3 = new Button()
            {
                X = btnTipIcon2.Right + Application.GetRealWidth(16),
                Y = Application.GetRealWidth(238),
                Width = Application.GetRealWidth(16),
                Height = Application.GetRealWidth(16),
                BorderColor = CSS_Color.FirstLevelTitleColor,
                BorderWidth = (uint)Application.GetRealWidth(1),
                Radius = (uint)Application.GetRealWidth(8),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor,
            };
            bodyView.AddChidren(btnTipIcon3);
//            var btnTipIcon3 = new Button()
//            {
//                X = btnTipIcon2.Right + Application.GetRealWidth(16),
//                Y = Application.GetRealWidth(238),
//                Width = Application.GetRealWidth(16),
//                Height = Application.GetRealWidth(16),
//                BorderColor = CSS_Color.FirstLevelTitleColor,
//                BorderWidth = (uint)Application.GetRealWidth(1),
//                Radius = (uint)Application.GetRealWidth(8),
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//                SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor,
//            };
//            bodyView.AddChidren(btnTipIcon3);
            var btnTipIcon4 = new Button()
            {
                X = btnTipIcon3.Right + Application.GetRealWidth(16),
                Y = Application.GetRealWidth(238),
                Width = Application.GetRealWidth(16),
                Height = Application.GetRealWidth(16),
                BorderColor = CSS_Color.FirstLevelTitleColor,
                BorderWidth = (uint)Application.GetRealWidth(1),
                Radius = (uint)Application.GetRealWidth(8),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor,
            };
            bodyView.AddChidren(btnTipIcon4);
//            var btnTipIcon4 = new Button()
//            {
//                X = btnTipIcon3.Right + Application.GetRealWidth(16),
//                Y = Application.GetRealWidth(238),
//                Width = Application.GetRealWidth(16),
//                Height = Application.GetRealWidth(16),
//                BorderColor = CSS_Color.FirstLevelTitleColor,
//                BorderWidth = (uint)Application.GetRealWidth(1),
//                Radius = (uint)Application.GetRealWidth(8),
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//                SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor,
//            };
//            bodyView.AddChidren(btnTipIcon4);
            btnTipError = new Button()
            {
                Y = Application.GetRealWidth(258),
                Height = Application.GetRealWidth(40),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.WarningColor,
                TextSize = CSS_FontSize.TextFontSize,
                Visible = false,
            };
            bodyView.AddChidren(btnTipError);
//            btnTipError = new Button()
//            {
//                Y = Application.GetRealWidth(258),
//                Height = Application.GetRealWidth(40),
//                TextAlignment = TextAlignment.Center,
//                TextColor = CSS_Color.WarningColor,
//                TextSize = CSS_FontSize.TextFontSize,
//                Visible = false,
//            };
//            bodyView.AddChidren(btnTipError);
            etPassword = new EditText()
            {
                Y = Application.GetRealWidth(100),
                Height = 1,
                Foucs = true,
                //Visible = false,
                IsNumberKeyboardType = true,
            };
            bodyView.AddChidren(etPassword);
//            etPassword = new EditText()
//            {
//                Y = Application.GetRealWidth(100),
//                Height = 1,
//                Foucs = true,
//                //Visible = false,
//                IsNumberKeyboardType = true,
//            };
//            bodyView.AddChidren(etPassword);
            //etPassword.MouseUpEventHandler = (sender, e) => { };
//            //etPassword.MouseUpEventHandler = (sender, e) => { };
            etPassword.TextChangeEventHandler = (sender, e) =>
            {
                passwrod = etPassword.Text.Trim();
                switch (etPassword.Text.Trim().Length)
                {
                    case 0:
                        btnTipIcon1.IsSelected = false;
                        btnTipIcon2.IsSelected = false;
                        btnTipIcon3.IsSelected = false;
                        btnTipIcon4.IsSelected = false;
                        break;
                    case 1:
                        btnTipIcon1.IsSelected = true;
                        btnTipIcon2.IsSelected = false;
                        btnTipIcon3.IsSelected = false;
                        btnTipIcon4.IsSelected = false;
                        btnTipError.Visible = false;
                        break;
                    case 2:
                        btnTipIcon1.IsSelected = true;
                        btnTipIcon2.IsSelected = true;
                        btnTipIcon3.IsSelected = false;
                        btnTipIcon4.IsSelected = false;
                        break;
                    case 3:
                        btnTipIcon1.IsSelected = true;
                        btnTipIcon2.IsSelected = true;
                        btnTipIcon3.IsSelected = true;
                        btnTipIcon4.IsSelected = false;
                        break;
                    case 4:
                        btnTipIcon1.IsSelected = true;
                        btnTipIcon2.IsSelected = true;
                        btnTipIcon3.IsSelected = true;
                        btnTipIcon4.IsSelected = true;
                        Application.HideSoftInput();
                        if (string.IsNullOrEmpty(oldPasswrod))
                        {
                            //移除当前界面,每次返回都返回到最上级
                            this.RemoveFromParent();
                            var page = new AppUnlockPasswordPage(passwrod, backAction);
                            MainPage.BasePageView.AddChidren(page);
                            page.LoadPage(optionType);
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        }
                        else
                        {
                            //2020-12-11 密码校验
                            if (passwrod == oldPasswrod)
                            {
                                //密码验证通过
                                PasswordInputPassed(optionType);
                            }
                            else
                            {
                                //密码验证失败
                                PasswordInputError(optionType);
                            }
                        }
                        break;
                }
            };
//            etPassword.TextChangeEventHandler = (sender, e) =>
//            {
//                passwrod = etPassword.Text.Trim();
//                switch (etPassword.Text.Trim().Length)
//                {
//                    case 0:
//                        btnTipIcon1.IsSelected = false;
//                        btnTipIcon2.IsSelected = false;
//                        btnTipIcon3.IsSelected = false;
//                        btnTipIcon4.IsSelected = false;
//                        break;
//                    case 1:
//                        btnTipIcon1.IsSelected = true;
//                        btnTipIcon2.IsSelected = false;
//                        btnTipIcon3.IsSelected = false;
//                        btnTipIcon4.IsSelected = false;
//                        btnTipError.Visible = false;
//                        break;
//                    case 2:
//                        btnTipIcon1.IsSelected = true;
//                        btnTipIcon2.IsSelected = true;
//                        btnTipIcon3.IsSelected = false;
//                        btnTipIcon4.IsSelected = false;
//                        break;
//                    case 3:
//                        btnTipIcon1.IsSelected = true;
//                        btnTipIcon2.IsSelected = true;
//                        btnTipIcon3.IsSelected = true;
//                        btnTipIcon4.IsSelected = false;
//                        break;
//                    case 4:
//                        btnTipIcon1.IsSelected = true;
//                        btnTipIcon2.IsSelected = true;
//                        btnTipIcon3.IsSelected = true;
//                        btnTipIcon4.IsSelected = true;
//                        Application.HideSoftInput();
//                        if (string.IsNullOrEmpty(oldPasswrod))
//                        {
//                            //移除当前界面,每次返回都返回到最上级
//                            this.RemoveFromParent();
//                            var page = new AppUnlockPasswordPage(passwrod, backAction);
//                            MainPage.BasePageView.AddChidren(page);
//                            page.LoadPage(optionType);
//                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//                        }
//                        else
//                        {
//                            //2020-12-11 密码校验
//                            if (passwrod == oldPasswrod)
//                            {
//                                //密码验证通过
//                                PasswordInputPassed(optionType);
//                            }
//                            else
//                            {
//                                //密码验证失败
//                                PasswordInputError(optionType);
//                            }
//                        }
//                        break;
//                }
//            };
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                etPassword.Foucs = true;
            };
            bodyView.MouseUpEventHandler = eventHandler;
            btnTipIcon1.MouseUpEventHandler = eventHandler;
            btnTipIcon2.MouseUpEventHandler = eventHandler;
            btnTipIcon3.MouseUpEventHandler = eventHandler;
            btnTipIcon4.MouseUpEventHandler = eventHandler;
//            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
//            {
//                etPassword.Foucs = true;
//            };
//            bodyView.MouseUpEventHandler = eventHandler;
//            btnTipIcon1.MouseUpEventHandler = eventHandler;
//            btnTipIcon2.MouseUpEventHandler = eventHandler;
//            btnTipIcon3.MouseUpEventHandler = eventHandler;
//            btnTipIcon4.MouseUpEventHandler = eventHandler;
            etPassword.Foucs = true;
//            etPassword.Foucs = true;
            if (optionType == "7")
            {
                //使用账户密码登录按钮 提示按钮
                AddLoginTipButton();
            }
            else if (optionType != "1")
            {
                //输入登录密码验证 提示按钮
                AddInputPasswordTipButton(optionType);
            }
        }
//            if (optionType == "7")
//            {
//                //使用账户密码登录按钮 提示按钮
//                AddLoginTipButton();
//            }
//            else if (optionType != "1")
//            {
//                //输入登录密码验证 提示按钮
//                AddInputPasswordTipButton(optionType);
//            }
//        }
        /// <summary>
        /// 密码输入错误显示错误信息
        /// </summary>
        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param>
        void PasswordInputError(string optionType)
        {
            int errorTextID = 0;
            if (optionType == "1")
            {
                //两次输入密码不一致,请重新输入
                errorTextID = StringId.IncorrectRepeatPassword;
            }
            else
            {
                //验证失败,密码错误.
                errorTextID = StringId.AuthenticationFailedPasswordError;
            }
//        /// <summary>
//        /// 密码输入错误显示错误信息
//        /// </summary>
//        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param>
//        void PasswordInputError(string optionType)
//        {
//            int errorTextID = 0;
//            if (optionType == "1")
//            {
//                //两次输入密码不一致,请重新输入
//                errorTextID = StringId.IncorrectRepeatPassword;
//            }
//            else
//            {
//                //验证失败,密码错误.
//                errorTextID = StringId.AuthenticationFailedPasswordError;
//            }
            btnTipError.TextID = errorTextID;
            etPassword.Text = "";
            btnTipError.Visible = true;
        }
//            btnTipError.TextID = errorTextID;
//            etPassword.Text = "";
//            btnTipError.Visible = true;
//        }
        /// <summary>
        /// 密码验证通过后的操作
        /// </summary>
        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param>
        void PasswordInputPassed(string optionType)
        {
            if (optionType == "1")
            {
                //设置密码 验证通过
                this.RemoveFromParent();
                var page = new OperationResultDisPalyPage();
                page.Show();
//        /// <summary>
//        /// 密码验证通过后的操作
//        /// </summary>
//        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param>
//        void PasswordInputPassed(string optionType)
//        {
//            if (optionType == "1")
//            {
//                //设置密码 验证通过
//                this.RemoveFromParent();
//                var page = new OperationResultDisPalyPage();
//                page.Show();
                page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), "");
                string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) :
                                Language.StringByID(StringId.TurnOnFaceIdUnlocking);
//                page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), "");
//                string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) :
//                                Language.StringByID(StringId.TurnOnFaceIdUnlocking);
                if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None)
                {
                    var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4";
//                if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None)
//                {
//                    var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4";
                    //如果之前没设置指纹或者面容ID才显示是否开启
                    if (!UserInfo.Current.appUnlockType.Contains(unlockType))
                    {
                        Action<bool> action = (result) =>
                        {
                            if (result)
                            {
                                if (!UserInfo.Current.appUnlockType.Contains(unlockType))
                                {
                                    UserInfo.Current.appUnlockType.Add(unlockType);
                                }
                            }
                            else
                            {
                                if (UserInfo.Current.appUnlockType.Contains(unlockType))
                                {
                                    UserInfo.Current.appUnlockType.Remove(unlockType);
                                }
                            }
                            backAction();
                            UserInfo.Current.SaveUserInfo();
                        };
//                    //如果之前没设置指纹或者面容ID才显示是否开启
//                    if (!UserInfo.Current.appUnlockType.Contains(unlockType))
//                    {
//                        Action<bool> action = (result) =>
//                        {
//                            if (result)
//                            {
//                                if (!UserInfo.Current.appUnlockType.Contains(unlockType))
//                                {
//                                    UserInfo.Current.appUnlockType.Add(unlockType);
//                                }
//                            }
//                            else
//                            {
//                                if (UserInfo.Current.appUnlockType.Contains(unlockType))
//                                {
//                                    UserInfo.Current.appUnlockType.Remove(unlockType);
//                                }
//                            }
//                            backAction();
//                            UserInfo.Current.SaveUserInfo();
//                        };
                        page.AdditionalOperations(tipMsg, action);
                    }
                }
                if (!UserInfo.Current.appUnlockType.Contains("1"))
                {
                    UserInfo.Current.appUnlockType.Add("1");
                }
                UserInfo.Current.appUnlockPasswrod = passwrod;
                UserInfo.Current.SaveUserInfo();
                backAction();
            }
            else if (optionType == "2")
            {
                //验证密码通过
                //移除当前界面,每次返回都返回到最上级
                this.RemoveFromParent();
                var page = new AppUnlockPasswordPage("", backAction);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage("1");
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            }
            else if (optionType == "3" || optionType == "4")
            {
                //3:关闭密码;4:关闭解锁设置 通过
                if (optionType == "4")
                {
                    backAction();
                    this.RemoveFromParent();
                    return;
                }
                if (UserInfo.Current.appUnlockType.Contains("1"))
                {
                    UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();//.Remove("1");
                    UserInfo.Current.appUnlockPasswrod = "";
                    UserInfo.Current.SaveUserInfo();
                    this.RemoveFromParent();
                    backAction();
                }
            }
            else if (optionType == "5")
            {
                //5:指纹ID开关 通过
                if (UserInfo.Current.appUnlockType.Contains("3"))
                {
                    UserInfo.Current.appUnlockType.Remove("3");
                }
                else
                {
                    UserInfo.Current.appUnlockType.Add("3");
                }
                UserInfo.Current.SaveUserInfo();
                this.RemoveFromParent();
                backAction();
            }
            else if (optionType == "6")
            {
                //6:面容ID开关 通过
                if (UserInfo.Current.appUnlockType.Contains("4"))
                {
                    UserInfo.Current.appUnlockType.Remove("4");
                }
                else
                {
                    UserInfo.Current.appUnlockType.Add("4");
                }
                UserInfo.Current.SaveUserInfo();
                this.RemoveFromParent();
                backAction();
            }
            else if (optionType == "7")
            {
                //7:解锁验证 通过
                this.RemoveFromParent();
                backAction();
            }
        }
//                        page.AdditionalOperations(tipMsg, action);
//                    }
//                }
//                if (!UserInfo.Current.appUnlockType.Contains("1"))
//                {
//                    UserInfo.Current.appUnlockType.Add("1");
//                }
//                UserInfo.Current.appUnlockPasswrod = passwrod;
//                UserInfo.Current.SaveUserInfo();
//                backAction();
//            }
//            else if (optionType == "2")
//            {
//                //验证密码通过
//                //移除当前界面,每次返回都返回到最上级
//                this.RemoveFromParent();
//                var page = new AppUnlockPasswordPage("", backAction);
//                MainPage.BasePageView.AddChidren(page);
//                page.LoadPage("1");
//                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//            }
//            else if (optionType == "3" || optionType == "4")
//            {
//                //3:关闭密码;4:关闭解锁设置 通过
//                if (optionType == "4")
//                {
//                    backAction();
//                    this.RemoveFromParent();
//                    return;
//                }
//                if (UserInfo.Current.appUnlockType.Contains("1"))
//                {
//                    UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();//.Remove("1");
//                    UserInfo.Current.appUnlockPasswrod = "";
//                    UserInfo.Current.SaveUserInfo();
//                    this.RemoveFromParent();
//                    backAction();
//                }
//            }
//            else if (optionType == "5")
//            {
//                //5:指纹ID开关 通过
//                if (UserInfo.Current.appUnlockType.Contains("3"))
//                {
//                    UserInfo.Current.appUnlockType.Remove("3");
//                }
//                else
//                {
//                    UserInfo.Current.appUnlockType.Add("3");
//                }
//                UserInfo.Current.SaveUserInfo();
//                this.RemoveFromParent();
//                backAction();
//            }
//            else if (optionType == "6")
//            {
//                //6:面容ID开关 通过
//                if (UserInfo.Current.appUnlockType.Contains("4"))
//                {
//                    UserInfo.Current.appUnlockType.Remove("4");
//                }
//                else
//                {
//                    UserInfo.Current.appUnlockType.Add("4");
//                }
//                UserInfo.Current.SaveUserInfo();
//                this.RemoveFromParent();
//                backAction();
//            }
//            else if (optionType == "7")
//            {
//                //7:解锁验证 通过
//                this.RemoveFromParent();
//                backAction();
//            }
//        }
        /// <summary>
        /// 使用账户密码登录按钮 提示按钮
        /// </summary>
        void AddLoginTipButton()
        {
            Button btnLoginAccountVerify = new Button()
            {
                Y = Application.GetRealHeight(517),
                Height = Application.GetRealHeight(60),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.MainColor,
                TextID = StringId.LogWithAccountAndPassword,
            };
            bodyView.AddChidren(btnLoginAccountVerify);
//        /// <summary>
//        /// 使用账户密码登录按钮 提示按钮
//        /// </summary>
//        void AddLoginTipButton()
//        {
//            Button btnLoginAccountVerify = new Button()
//            {
//                Y = Application.GetRealHeight(517),
//                Height = Application.GetRealHeight(60),
//                TextAlignment = TextAlignment.Center,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextColor = CSS_Color.MainColor,
//                TextID = StringId.LogWithAccountAndPassword,
//            };
//            bodyView.AddChidren(btnLoginAccountVerify);
            btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
            {
                //退出登录
                HDLCommon.Current.Logout();
            };
        }
//            btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
//            {
//                //退出登录
//                HDLCommon.Current.Logout();
//            };
//        }
        /// <summary>
        /// 输入登录密码验证 提示按钮
        /// </summary>
        void AddInputPasswordTipButton(string optionType)
        {
            Button btnLoginAccountVerify = new Button()
            {
                Y = Application.GetRealHeight(517),
                Height = Application.GetRealHeight(60),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.MainColor,
                TextID = StringId.EnterLoginPasswordVerification,
            };
            bodyView.AddChidren(btnLoginAccountVerify);
//        /// <summary>
//        /// 输入登录密码验证 提示按钮
//        /// </summary>
//        void AddInputPasswordTipButton(string optionType)
//        {
//            Button btnLoginAccountVerify = new Button()
//            {
//                Y = Application.GetRealHeight(517),
//                Height = Application.GetRealHeight(60),
//                TextAlignment = TextAlignment.Center,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextColor = CSS_Color.MainColor,
//                TextID = StringId.EnterLoginPasswordVerification,
//            };
//            bodyView.AddChidren(btnLoginAccountVerify);
            btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
            {
                //输入登录密码验证
                Action<string> action = (pw) =>
                {
                    AuthenticationByLoginPassword(pw, optionType);
                    //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
                    //if (resultObj.Code == StateCode.SUCCESS)
                    //{
                    //    PasswordInputPassed(optionType);
                    //}
                    //else
                    //{
                    //    Application.RunOnMainThread(() =>
                    //    {
                    //        Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
                    //    });
//            btnLoginAccountVerify.MouseUpEventHandler = (sender, e) =>
//            {
//                //输入登录密码验证
//                Action<string> action = (pw) =>
//                {
//                    AuthenticationByLoginPassword(pw, optionType);
//                    //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
//                    //if (resultObj.Code == StateCode.SUCCESS)
//                    //{
//                    //    PasswordInputPassed(optionType);
//                    //}
//                    //else
//                    //{
//                    //    Application.RunOnMainThread(() =>
//                    //    {
//                    //        Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
//                    //    });
                    //}
//                    //}
                };
                new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true);
            };
        }
//                };
//                new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true);
//            };
//        }
        /// <summary>
        /// 登录密码验证
        /// </summary>
        /// <param name="pw"></param>
        /// <param name="optionType"></param>
        void AuthenticationByLoginPassword(string pw, string optionType)
        {
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
//        /// <summary>
//        /// 登录密码验证
//        /// </summary>
//        /// <param name="pw"></param>
//        /// <param name="optionType"></param>
//        void AuthenticationByLoginPassword(string pw, string optionType)
//        {
//            var waitPage = new Loading();
//            bodyView.AddChidren(waitPage);
//            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new System.Threading.Thread(() =>
            {
                try
                {
                    var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
                    Application.RunOnMainThread(() =>
                    {
                        if (resultObj.Code == StateCode.SUCCESS)
                        {
                            PasswordInputPassed(optionType);
                        }
                        else
                        {
                            Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
                        }
                    });
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
    }
}
//            new System.Threading.Thread(() =>
//            {
//                try
//                {
//                    var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw);
//                    Application.RunOnMainThread(() =>
//                    {
//                        if (resultObj.Code == StateCode.SUCCESS)
//                        {
//                            PasswordInputPassed(optionType);
//                        }
//                        else
//                        {
//                            Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError));
//                        }
//                    });
//                }
//                catch { }
//                finally
//                {
//                    Application.RunOnMainThread(() =>
//                    {
//                        if (waitPage != null)
//                        {
//                            waitPage.RemoveFromParent();
//                            waitPage = null;
//                        }
//                    });
//                }
//            })
//            { IsBackground = true }.Start();
//        }
//    }
//}
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPage.cs
@@ -1,810 +1,810 @@
using System;
using HDL_ON.UI.CSS;
using Shared;
//using System;
//using HDL_ON.UI.CSS;
//using Shared;
namespace HDL_ON.UI
{
    public partial class AppUnlockSettingsPage : FrameLayout
    {
        #region 控件列表
        FrameLayout bodyView;
//namespace HDL_ON.UI
//{
//    public partial class AppUnlockSettingsPage : FrameLayout
//    {
//        #region 控件列表
//        FrameLayout bodyView;
        /// <summary>
        /// 上部分显示区域
        /// </summary>
        FrameLayout topContentView;
        /// <summary>
        /// 解锁页面选择列表view
        /// </summary>
        HorizontalScrolViewLayout optionView;
//        /// <summary>
//        /// 上部分显示区域
//        /// </summary>
//        FrameLayout topContentView;
//        /// <summary>
//        /// 解锁页面选择列表view
//        /// </summary>
//        HorizontalScrolViewLayout optionView;
        /// <summary>
        /// 无保护选项提示
        /// </summary>
        Button btnUnprotectedSelectionTip;
        /// <summary>
        /// 无保护选项选中图标
        /// </summary>
        Button btnUnprotectedSelectionIcon;
        /// <summary>
        /// 无保护选项背景
        /// </summary>
        Button btnUnprotectedBg;
//        /// <summary>
//        /// 无保护选项提示
//        /// </summary>
//        Button btnUnprotectedSelectionTip;
//        /// <summary>
//        /// 无保护选项选中图标
//        /// </summary>
//        Button btnUnprotectedSelectionIcon;
//        /// <summary>
//        /// 无保护选项背景
//        /// </summary>
//        Button btnUnprotectedBg;
        /// <summary>
        /// 启动时选项提示
        /// </summary>
        Button btnStartupSelectionTip;
        /// <summary>
        /// 启动时选项选中图标
        /// </summary>
        Button btnStartupSelectionIcon;
        /// <summary>
        /// 启动时选项背景
        /// </summary>
        Button btnStartupBg;
//        /// <summary>
//        /// 启动时选项提示
//        /// </summary>
//        Button btnStartupSelectionTip;
//        /// <summary>
//        /// 启动时选项选中图标
//        /// </summary>
//        Button btnStartupSelectionIcon;
//        /// <summary>
//        /// 启动时选项背景
//        /// </summary>
//        Button btnStartupBg;
        #region F3阶段
        ///// <summary>
        ///// 设置安防选项提示
        ///// </summary>
        //Button btnSecuritySelectionTip;
        ///// <summary>
        ///// 设置安防选项选中图标
        ///// </summary>
        //Button btnSecuritySelectionIcon;
        ///// <summary>
        ///// 设置安防选项背景
        ///// </summary>
        //Button btnSecurityBg;
//        #region F3阶段
//        ///// <summary>
//        ///// 设置安防选项提示
//        ///// </summary>
//        //Button btnSecuritySelectionTip;
//        ///// <summary>
//        ///// 设置安防选项选中图标
//        ///// </summary>
//        //Button btnSecuritySelectionIcon;
//        ///// <summary>
//        ///// 设置安防选项背景
//        ///// </summary>
//        //Button btnSecurityBg;
        /// <summary>
        /// 设置门锁选项提示
        /// </summary>
        Button btnDoorlockSelectionTip;
        /// <summary>
        /// 设置门锁选项选中图标
        /// </summary>
        Button btnDoorlockSelectionIcon;
        /// <summary>
        /// 设置门锁选项背景
        /// </summary>
        Button btnDoorlockBg;
        #endregion
//        /// <summary>
//        /// 设置门锁选项提示
//        /// </summary>
//        Button btnDoorlockSelectionTip;
//        /// <summary>
//        /// 设置门锁选项选中图标
//        /// </summary>
//        Button btnDoorlockSelectionIcon;
//        /// <summary>
//        /// 设置门锁选项背景
//        /// </summary>
//        Button btnDoorlockBg;
//        #endregion
        /// <summary>
        /// 密码使用选择的详细内容提示
        /// </summary>
        Button btnTipMsg;
//        /// <summary>
//        /// 密码使用选择的详细内容提示
//        /// </summary>
//        Button btnTipMsg;
        /// <summary>
        /// 解锁方式区域view
        /// </summary>
        VerticalScrolViewLayout unlockOptionView;
//        /// <summary>
//        /// 解锁方式区域view
//        /// </summary>
//        VerticalScrolViewLayout unlockOptionView;
        /// <summary>
        /// 密码设置文本
        /// 事件跳转按钮
        /// </summary>
        Button btnPasswordUnlockTitle;
        /// <summary>
        /// 修改密码文本
        /// 事件跳转按钮
        /// </summary>
        Button btnResetPasswordTitle;
//        /// <summary>
//        /// 密码设置文本
//        /// 事件跳转按钮
//        /// </summary>
//        Button btnPasswordUnlockTitle;
//        /// <summary>
//        /// 修改密码文本
//        /// 事件跳转按钮
//        /// </summary>
//        Button btnResetPasswordTitle;
        /// <summary>
        /// 手势设置文本
        /// 事件跳转按钮
        /// </summary>
        Button btnGestureUnlockTitle;
        /// <summary>
        /// 修改手势密码
        /// 事件跳转按钮
        /// </summary>
        Button btnResetGestureTitle;
//        /// <summary>
//        /// 手势设置文本
//        /// 事件跳转按钮
//        /// </summary>
//        Button btnGestureUnlockTitle;
//        /// <summary>
//        /// 修改手势密码
//        /// 事件跳转按钮
//        /// </summary>
//        Button btnResetGestureTitle;
        /// <summary>
        /// 指纹设置文本
        /// 事件跳转按钮
        /// </summary>
        Button btnFingerprintUnlockSwtichIcon;
        /// <summary>
        /// 面容ID设置文本
        /// 事件跳转按钮
        /// </summary>
        Button btnFaceIdUnlockSwtichIcon;
//        /// <summary>
//        /// 指纹设置文本
//        /// 事件跳转按钮
//        /// </summary>
//        Button btnFingerprintUnlockSwtichIcon;
//        /// <summary>
//        /// 面容ID设置文本
//        /// 事件跳转按钮
//        /// </summary>
//        Button btnFaceIdUnlockSwtichIcon;
        /// <summary>
        /// 指纹解锁方式Row
        /// </summary>
        FrameLayout fingerprintUnlockDiv;
        /// <summary>
        /// 面容解锁方式Row
        /// </summary>
        FrameLayout faceIdUnlockDiv;
        #endregion
//        /// <summary>
//        /// 指纹解锁方式Row
//        /// </summary>
//        FrameLayout fingerprintUnlockDiv;
//        /// <summary>
//        /// 面容解锁方式Row
//        /// </summary>
//        FrameLayout faceIdUnlockDiv;
//        #endregion
        /// <summary>
        /// 是否支持指纹解锁
        /// </summary>
        bool sTouchID = false;
        /// <summary>
        /// 是否支持面容解锁
        /// </summary>
        bool sFaceID = false;
//        /// <summary>
//        /// 是否支持指纹解锁
//        /// </summary>
//        bool sTouchID = false;
//        /// <summary>
//        /// 是否支持面容解锁
//        /// </summary>
//        bool sFaceID = false;
        public AppUnlockSettingsPage()
        {
            bodyView = this;
        }
//        public AppUnlockSettingsPage()
//        {
//            bodyView = this;
//        }
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //如果用户配置了需要解锁的界面但是没有设置密码,则在返回时清空需要解锁的界面
            Action action = () => {
                if(UserInfo.Current.appUnlockPage.Count > 0&& UserInfo.Current.appUnlockPasswrod == "")
                {
                    UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>();
                    UserInfo.Current.SaveUserInfo();
                }
            };
            new TopViewDiv(bodyView, Language.StringByID(StringId.InterpretationSettings)).LoadTopView(action);
//        public void LoadPage()
//        {
//            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
//            //如果用户配置了需要解锁的界面但是没有设置密码,则在返回时清空需要解锁的界面
//            Action action = () => {
//                if(UserInfo.Current.appUnlockPage.Count > 0&& UserInfo.Current.appUnlockPasswrod == "")
//                {
//                    UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>();
//                    UserInfo.Current.SaveUserInfo();
//                }
//            };
//            new TopViewDiv(bodyView, Language.StringByID(StringId.InterpretationSettings)).LoadTopView(action);
            topContentView = new FrameLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealWidth(332),
                BackgroundColor = CSS_Color.MainBackgroundColor
            };
            bodyView.AddChidren(topContentView);
//            topContentView = new FrameLayout()
//            {
//                Y = Application.GetRealHeight(64),
//                Height = Application.GetRealWidth(332),
//                BackgroundColor = CSS_Color.MainBackgroundColor
//            };
//            bodyView.AddChidren(topContentView);
            Button btnTip1 = new Button()
            {
                Y = Application.GetRealHeight(8),
                Height = Application.GetRealHeight(30),
                TextAlignment = TextAlignment.Center,
                IsBold = true,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.PleaseSelectThePageToBeUnlocked,
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            topContentView.AddChidren(btnTip1);
//            Button btnTip1 = new Button()
//            {
//                Y = Application.GetRealHeight(8),
//                Height = Application.GetRealHeight(30),
//                TextAlignment = TextAlignment.Center,
//                IsBold = true,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.SubheadingFontSize,
//                TextID = StringId.PleaseSelectThePageToBeUnlocked,
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//            };
//            topContentView.AddChidren(btnTip1);
            Button btnTip2 = new Button()
            {
                Y = btnTip1.Bottom,
                Height = Application.GetRealHeight(25),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                BackgroundColor = CSS_Color.MainBackgroundColor,
                TextID = StringId.MultipleChoicesOfPagesYouNeedToProtect,
                IsMoreLines = true,
            };
            topContentView.AddChidren(btnTip2);
            if(Language.CurrentLanguage == "Engligh")
            {
                btnTip2.Height = Application.GetRealHeight(30);
            }
//            Button btnTip2 = new Button()
//            {
//                Y = btnTip1.Bottom,
//                Height = Application.GetRealHeight(25),
//                TextAlignment = TextAlignment.Center,
//                TextColor = CSS_Color.PromptingColor1,
//                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//                TextID = StringId.MultipleChoicesOfPagesYouNeedToProtect,
//                IsMoreLines = true,
//            };
//            topContentView.AddChidren(btnTip2);
//            if(Language.CurrentLanguage == "Engligh")
//            {
//                btnTip2.Height = Application.GetRealHeight(30);
//            }
            optionView = new HorizontalScrolViewLayout()
            {
                Y = Application.GetRealWidth(143 - 64),
                Height = Application.GetRealWidth(209),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            topContentView.AddChidren(optionView);
//            optionView = new HorizontalScrolViewLayout()
//            {
//                Y = Application.GetRealWidth(143 - 64),
//                Height = Application.GetRealWidth(209),
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//            };
//            topContentView.AddChidren(optionView);
            LoadView_OptionView();
//            LoadView_OptionView();
            btnTipMsg = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealWidth(288),
                Width = Application.GetRealWidth(311),
                Height = Application.GetRealWidth(28),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.FirstLevelTitleColor,
                SelectedTextColor = CSS_Color.FirstLevelTitleColor,
                BorderColor = CSS_Color.MainColor,
                BorderWidth = 1,
                Radius = 1,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                TextID = StringId.UnprotectedTipMsg,
            };
            topContentView.AddChidren(btnTipMsg);
            if (Language.CurrentLanguage == "Engligh")
            {
                btnTip2.Height = Application.GetRealHeight(40);
                topContentView.Height = Application.GetRealHeight(360);
            }
//            btnTipMsg = new Button()
//            {
//                Gravity = Gravity.CenterHorizontal,
//                Y = Application.GetRealWidth(288),
//                Width = Application.GetRealWidth(311),
//                Height = Application.GetRealWidth(28),
//                TextAlignment = TextAlignment.Center,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                SelectedTextColor = CSS_Color.FirstLevelTitleColor,
//                BorderColor = CSS_Color.MainColor,
//                BorderWidth = 1,
//                Radius = 1,
//                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
//                TextID = StringId.UnprotectedTipMsg,
//            };
//            topContentView.AddChidren(btnTipMsg);
//            if (Language.CurrentLanguage == "Engligh")
//            {
//                btnTip2.Height = Application.GetRealHeight(40);
//                topContentView.Height = Application.GetRealHeight(360);
//            }
            LoadEventList();
//            LoadEventList();
            LoadView_UnlockView();
//            LoadView_UnlockView();
        }
        /// <summary>
        /// 加载选项卡
        /// </summary>
        void LoadView_OptionView()
        {
            #region Unprotected
            optionView.AddChidren(new Button() { Width = Application.GetRealWidth(24) });
//        }
//        /// <summary>
//        /// 加载选项卡
//        /// </summary>
//        void LoadView_OptionView()
//        {
//            #region Unprotected
//            optionView.AddChidren(new Button() { Width = Application.GetRealWidth(24) });
            FrameLayout unprotectedDiv = new FrameLayout()
            {
                Width = Application.GetRealWidth(94),
            };
            optionView.AddChidren(unprotectedDiv);
//            FrameLayout unprotectedDiv = new FrameLayout()
//            {
//                Width = Application.GetRealWidth(94),
//            };
//            optionView.AddChidren(unprotectedDiv);
            btnUnprotectedBg = new Button()
            {
                Height = Application.GetRealWidth(174),
                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/1.png",
                SelectedImagePath = "PersonalCenter/AppUnlockSetting/1On.png"
            };
            unprotectedDiv.AddChidren(btnUnprotectedBg);
//            btnUnprotectedBg = new Button()
//            {
//                Height = Application.GetRealWidth(174),
//                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/1.png",
//                SelectedImagePath = "PersonalCenter/AppUnlockSetting/1On.png"
//            };
//            unprotectedDiv.AddChidren(btnUnprotectedBg);
            btnUnprotectedSelectionIcon = new Button()
            {
                X = Application.GetRealWidth(5),
                Y = Application.GetRealWidth(174),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = "Public/ChooseIcon.png",
                SelectedImagePath = "Public/ChooseOnIcon.png",
            };
            unprotectedDiv.AddChidren(btnUnprotectedSelectionIcon);
//            btnUnprotectedSelectionIcon = new Button()
//            {
//                X = Application.GetRealWidth(5),
//                Y = Application.GetRealWidth(174),
//                Width = Application.GetRealWidth(30),
//                Height = Application.GetRealWidth(30),
//                UnSelectedImagePath = "Public/ChooseIcon.png",
//                SelectedImagePath = "Public/ChooseOnIcon.png",
//            };
//            unprotectedDiv.AddChidren(btnUnprotectedSelectionIcon);
            btnUnprotectedSelectionTip = new Button()
            {
                X = Application.GetRealWidth(30),
                Y = Application.GetRealWidth(174),
                Width = Application.GetRealWidth(74),
                Height = Application.GetRealWidth(30),
                TextID = StringId.Unprotected,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                SelectedTextColor = CSS_Color.MainColor,
            };
            unprotectedDiv.AddChidren(btnUnprotectedSelectionTip);
            #endregion
//            btnUnprotectedSelectionTip = new Button()
//            {
//                X = Application.GetRealWidth(30),
//                Y = Application.GetRealWidth(174),
//                Width = Application.GetRealWidth(74),
//                Height = Application.GetRealWidth(30),
//                TextID = StringId.Unprotected,
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
//                SelectedTextColor = CSS_Color.MainColor,
//            };
//            unprotectedDiv.AddChidren(btnUnprotectedSelectionTip);
//            #endregion
            #region Startup
            optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) });
//            #region Startup
//            optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) });
            FrameLayout startupDiv = new FrameLayout()
            {
                Width = Application.GetRealWidth(94),
            };
            optionView.AddChidren(startupDiv);
//            FrameLayout startupDiv = new FrameLayout()
//            {
//                Width = Application.GetRealWidth(94),
//            };
//            optionView.AddChidren(startupDiv);
            btnStartupBg = new Button()
            {
                Height = Application.GetRealWidth(174),
                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/2.png",
                SelectedImagePath = "PersonalCenter/AppUnlockSetting/2On.png"
            };
            startupDiv.AddChidren(btnStartupBg);
//            btnStartupBg = new Button()
//            {
//                Height = Application.GetRealWidth(174),
//                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/2.png",
//                SelectedImagePath = "PersonalCenter/AppUnlockSetting/2On.png"
//            };
//            startupDiv.AddChidren(btnStartupBg);
            btnStartupSelectionIcon = new Button()
            {
                X = Application.GetRealWidth(5),
                Y = Application.GetRealWidth(174),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = "Public/ChooseIcon.png",
                SelectedImagePath = "Public/ChooseOnIcon.png",
            };
            startupDiv.AddChidren(btnStartupSelectionIcon);
//            btnStartupSelectionIcon = new Button()
//            {
//                X = Application.GetRealWidth(5),
//                Y = Application.GetRealWidth(174),
//                Width = Application.GetRealWidth(30),
//                Height = Application.GetRealWidth(30),
//                UnSelectedImagePath = "Public/ChooseIcon.png",
//                SelectedImagePath = "Public/ChooseOnIcon.png",
//            };
//            startupDiv.AddChidren(btnStartupSelectionIcon);
            btnStartupSelectionTip = new Button()
            {
                X = Application.GetRealWidth(30),
                Y = Application.GetRealWidth(174),
                Width = Application.GetRealWidth(74),
                Height = Application.GetRealWidth(30),
                TextID = StringId.AtStartup,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel
            };
            startupDiv.AddChidren(btnStartupSelectionTip);
            #endregion
//            btnStartupSelectionTip = new Button()
//            {
//                X = Application.GetRealWidth(30),
//                Y = Application.GetRealWidth(174),
//                Width = Application.GetRealWidth(74),
//                Height = Application.GetRealWidth(30),
//                TextID = StringId.AtStartup,
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                SelectedTextColor = CSS_Color.MainColor,
//                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel
//            };
//            startupDiv.AddChidren(btnStartupSelectionTip);
//            #endregion
            #region F3阶段
            #region Security
            //optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) });
//            #region F3阶段
//            #region Security
//            //optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) });
            //FrameLayout securityDiv = new FrameLayout()
            //{
            //    Width = Application.GetRealWidth(94),
            //};
            //optionView.AddChidren(securityDiv);
//            //FrameLayout securityDiv = new FrameLayout()
//            //{
//            //    Width = Application.GetRealWidth(94),
//            //};
//            //optionView.AddChidren(securityDiv);
            //btnSecurityBg = new Button()
            //{
            //    Height = Application.GetRealWidth(174),
            //    UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/3.png",
            //    SelectedImagePath = "PersonalCenter/AppUnlockSetting/3On.png"
            //};
            //securityDiv.AddChidren(btnSecurityBg);
//            //btnSecurityBg = new Button()
//            //{
//            //    Height = Application.GetRealWidth(174),
//            //    UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/3.png",
//            //    SelectedImagePath = "PersonalCenter/AppUnlockSetting/3On.png"
//            //};
//            //securityDiv.AddChidren(btnSecurityBg);
            //btnSecuritySelectionIcon = new Button()
            //{
            //    X = Application.GetRealWidth(5),
            //    Y = Application.GetRealWidth(174),
            //    Width = Application.GetRealWidth(30),
            //    Height = Application.GetRealWidth(30),
            //    UnSelectedImagePath = "Public/ChooseIcon.png",
            //    SelectedImagePath = "Public/ChooseOnIcon.png",
            //};
            //securityDiv.AddChidren(btnSecuritySelectionIcon);
//            //btnSecuritySelectionIcon = new Button()
//            //{
//            //    X = Application.GetRealWidth(5),
//            //    Y = Application.GetRealWidth(174),
//            //    Width = Application.GetRealWidth(30),
//            //    Height = Application.GetRealWidth(30),
//            //    UnSelectedImagePath = "Public/ChooseIcon.png",
//            //    SelectedImagePath = "Public/ChooseOnIcon.png",
//            //};
//            //securityDiv.AddChidren(btnSecuritySelectionIcon);
            //btnSecuritySelectionTip = new Button()
            //{
            //    X = Application.GetRealWidth(30),
            //    Y = Application.GetRealWidth(174),
            //    Width = Application.GetRealWidth(74),
            //    Height = Application.GetRealWidth(30),
            //    TextID = StringId.DefenseAndUndefense,
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.FirstLevelTitleColor,
            //    SelectedTextColor = CSS_Color.MainColor,
            //    TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel
            //};
            //securityDiv.AddChidren(btnSecuritySelectionTip);
            #endregion
//            //btnSecuritySelectionTip = new Button()
//            //{
//            //    X = Application.GetRealWidth(30),
//            //    Y = Application.GetRealWidth(174),
//            //    Width = Application.GetRealWidth(74),
//            //    Height = Application.GetRealWidth(30),
//            //    TextID = StringId.DefenseAndUndefense,
//            //    TextAlignment = TextAlignment.CenterLeft,
//            //    TextColor = CSS_Color.FirstLevelTitleColor,
//            //    SelectedTextColor = CSS_Color.MainColor,
//            //    TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel
//            //};
//            //securityDiv.AddChidren(btnSecuritySelectionTip);
//            #endregion
            #region Doorlock
            optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) });
//            #region Doorlock
//            optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) });
            FrameLayout doorlockDiv = new FrameLayout()
            {
                Width = Application.GetRealWidth(94),
            };
            optionView.AddChidren(doorlockDiv);
//            FrameLayout doorlockDiv = new FrameLayout()
//            {
//                Width = Application.GetRealWidth(94),
//            };
//            optionView.AddChidren(doorlockDiv);
            btnDoorlockBg = new Button()
            {
                Height = Application.GetRealWidth(174),
                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/4.png",
                SelectedImagePath = "PersonalCenter/AppUnlockSetting/4On.png"
            };
            doorlockDiv.AddChidren(btnDoorlockBg);
//            btnDoorlockBg = new Button()
//            {
//                Height = Application.GetRealWidth(174),
//                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/4.png",
//                SelectedImagePath = "PersonalCenter/AppUnlockSetting/4On.png"
//            };
//            doorlockDiv.AddChidren(btnDoorlockBg);
            btnDoorlockSelectionIcon = new Button()
            {
                X = Application.GetRealWidth(5),
                Y = Application.GetRealWidth(174),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = "Public/ChooseIcon.png",
                SelectedImagePath = "Public/ChooseOnIcon.png",
            };
            doorlockDiv.AddChidren(btnDoorlockSelectionIcon);
//            btnDoorlockSelectionIcon = new Button()
//            {
//                X = Application.GetRealWidth(5),
//                Y = Application.GetRealWidth(174),
//                Width = Application.GetRealWidth(30),
//                Height = Application.GetRealWidth(30),
//                UnSelectedImagePath = "Public/ChooseIcon.png",
//                SelectedImagePath = "Public/ChooseOnIcon.png",
//            };
//            doorlockDiv.AddChidren(btnDoorlockSelectionIcon);
            btnDoorlockSelectionTip = new Button()
            {
                X = Application.GetRealWidth(30),
                Y = Application.GetRealWidth(174),
                Width = Application.GetRealWidth(74),
                Height = Application.GetRealWidth(30),
                TextID = StringId.RemoteUnlocking,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel
            };
            doorlockDiv.AddChidren(btnDoorlockSelectionTip);
            #endregion
            #endregion
//            btnDoorlockSelectionTip = new Button()
//            {
//                X = Application.GetRealWidth(30),
//                Y = Application.GetRealWidth(174),
//                Width = Application.GetRealWidth(74),
//                Height = Application.GetRealWidth(30),
//                TextID = StringId.RemoteUnlocking,
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                SelectedTextColor = CSS_Color.MainColor,
//                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel
//            };
//            doorlockDiv.AddChidren(btnDoorlockSelectionTip);
//            #endregion
//            #endregion
            optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) });
        }
//            optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) });
//        }
        /// <summary>
        /// 加载解锁方式区域
        /// </summary>
        void LoadView_UnlockView()
        {
            if(unlockOptionView!= null)
            {
                unlockOptionView.RemoveAll();
            }
            unlockOptionView = new VerticalScrolViewLayout()
            {
                Y = topContentView.Bottom + Application.GetRealHeight(8),
                Height = Application.GetRealHeight(260),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                ScrollEnabled = false,
                Visible = UserInfo.Current.appUnlockPage.Count > 0
            };
            bodyView.AddChidren(unlockOptionView);
//        /// <summary>
//        /// 加载解锁方式区域
//        /// </summary>
//        void LoadView_UnlockView()
//        {
//            if(unlockOptionView!= null)
//            {
//                unlockOptionView.RemoveAll();
//            }
//            unlockOptionView = new VerticalScrolViewLayout()
//            {
//                Y = topContentView.Bottom + Application.GetRealHeight(8),
//                Height = Application.GetRealHeight(260),
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//                ScrollEnabled = false,
//                Visible = UserInfo.Current.appUnlockPage.Count > 0
//            };
//            bodyView.AddChidren(unlockOptionView);
            #region 标题栏
            var unlockTitleDiv = new FrameLayout()
            {
                Height = Application.GetRealHeight(59),
            };
            unlockOptionView.AddChidren(unlockTitleDiv);
//            #region 标题栏
//            var unlockTitleDiv = new FrameLayout()
//            {
//                Height = Application.GetRealHeight(59),
//            };
//            unlockOptionView.AddChidren(unlockTitleDiv);
            var btnUnlockTitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealWidth(6),
                Width = Application.GetRealWidth(263),
                Height = Application.GetRealWidth(26),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                IsBold = true,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.SetUnlockingMethod,
            };
            unlockTitleDiv.AddChidren(btnUnlockTitle);
//            var btnUnlockTitle = new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Y = Application.GetRealWidth(6),
//                Width = Application.GetRealWidth(263),
//                Height = Application.GetRealWidth(26),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                IsBold = true,
//                TextSize = CSS_FontSize.SubheadingFontSize,
//                TextID = StringId.SetUnlockingMethod,
//            };
//            unlockTitleDiv.AddChidren(btnUnlockTitle);
            var btnUnlockTitleTip = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = btnUnlockTitle.Bottom,
                Width = Application.GetRealWidth(263),
                Height = Application.GetRealWidth(21),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = StringId.ValidForNativeOnly,
            };
            unlockTitleDiv.AddChidren(btnUnlockTitleTip);
//            var btnUnlockTitleTip = new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Y = btnUnlockTitle.Bottom,
//                Width = Application.GetRealWidth(263),
//                Height = Application.GetRealWidth(21),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.PromptingColor1,
//                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
//                TextID = StringId.ValidForNativeOnly,
//            };
//            unlockTitleDiv.AddChidren(btnUnlockTitleTip);
            unlockOptionView.AddChidren(new Button()
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(359),
                Height = 1,
                BackgroundColor = CSS_Color.BackgroundColor,
            });
            #endregion
//            unlockOptionView.AddChidren(new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Width = Application.GetRealWidth(359),
//                Height = 1,
//                BackgroundColor = CSS_Color.BackgroundColor,
//            });
//            #endregion
            #region 密码解锁
            var passwordUnlockDiv = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
            };
            if ( !UserInfo.Current.appUnlockType.Contains("2"))
            {
                unlockOptionView.AddChidren(passwordUnlockDiv);
            }
//            #region 密码解锁
//            var passwordUnlockDiv = new FrameLayout()
//            {
//                Height = Application.GetRealHeight(50),
//            };
//            if ( !UserInfo.Current.appUnlockType.Contains("2"))
//            {
//                unlockOptionView.AddChidren(passwordUnlockDiv);
//            }
            var btnPasswordUnlockIcon = new Button()
            {
                X = Application.GetRealWidth(16),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/PasswordIcon.png",
            };
            passwordUnlockDiv.AddChidren(btnPasswordUnlockIcon);
//            var btnPasswordUnlockIcon = new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetRealWidth(32),
//                Height = Application.GetRealWidth(32),
//                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/PasswordIcon.png",
//            };
//            passwordUnlockDiv.AddChidren(btnPasswordUnlockIcon);
            //var btnPasswordUnlockRightIcon = new Button()
            //{
            //    X = Application.GetRealWidth(339),
            //    Gravity = Gravity.CenterVertical,
            //    Width = Application.GetMinRealAverage(16),
            //    Height = Application.GetMinRealAverage(16),
            //    UnSelectedImagePath = "Public/Right.png",
            //};
            //passwordUnlockDiv.AddChidren(btnPasswordUnlockRightIcon);
//            //var btnPasswordUnlockRightIcon = new Button()
//            //{
//            //    X = Application.GetRealWidth(339),
//            //    Gravity = Gravity.CenterVertical,
//            //    Width = Application.GetMinRealAverage(16),
//            //    Height = Application.GetMinRealAverage(16),
//            //    UnSelectedImagePath = "Public/Right.png",
//            //};
//            //passwordUnlockDiv.AddChidren(btnPasswordUnlockRightIcon);
            var btnPasswordUnlockkSwtichIcon = new Button()
            {
                X = Application.GetRealWidth(322),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(38),
                Height = Application.GetMinRealAverage(38),
                UnSelectedImagePath = "Public/Switch_2.png",
                SelectedImagePath = "Public/SwitchOn_2.png",
                IsSelected = UserInfo.Current.appUnlockType.Contains("1")
            };
            passwordUnlockDiv.AddChidren(btnPasswordUnlockkSwtichIcon);
//            var btnPasswordUnlockkSwtichIcon = new Button()
//            {
//                X = Application.GetRealWidth(322),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetMinRealAverage(38),
//                Height = Application.GetMinRealAverage(38),
//                UnSelectedImagePath = "Public/Switch_2.png",
//                SelectedImagePath = "Public/SwitchOn_2.png",
//                IsSelected = UserInfo.Current.appUnlockType.Contains("1")
//            };
//            passwordUnlockDiv.AddChidren(btnPasswordUnlockkSwtichIcon);
            btnPasswordUnlockTitle = new Button()
            {
                X = Application.GetRealWidth(66),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.PasswordUnlock,
            };
            passwordUnlockDiv.AddChidren(btnPasswordUnlockTitle);
//            btnPasswordUnlockTitle = new Button()
//            {
//                X = Application.GetRealWidth(66),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextID = StringId.PasswordUnlock,
//            };
//            passwordUnlockDiv.AddChidren(btnPasswordUnlockTitle);
            unlockOptionView.AddChidren(new Button()
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(343),
                Height = 1,
                BackgroundColor = CSS_Color.BackgroundColor,
            });
            #endregion
//            unlockOptionView.AddChidren(new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Width = Application.GetRealWidth(343),
//                Height = 1,
//                BackgroundColor = CSS_Color.BackgroundColor,
//            });
//            #endregion
            #region 修改密码
            var resetPasswordDiv = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
            };
            if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("1"))
            {
                unlockOptionView.AddChidren(resetPasswordDiv);
            }
            var btnPasswordUnlockRightIcon = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            resetPasswordDiv.AddChidren(btnPasswordUnlockRightIcon);
//            #region 修改密码
//            var resetPasswordDiv = new FrameLayout()
//            {
//                Height = Application.GetRealHeight(50),
//            };
//            if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("1"))
//            {
//                unlockOptionView.AddChidren(resetPasswordDiv);
//            }
//            var btnPasswordUnlockRightIcon = new Button()
//            {
//                X = Application.GetRealWidth(339),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetMinRealAverage(16),
//                Height = Application.GetMinRealAverage(16),
//                UnSelectedImagePath = "Public/Right.png",
//            };
//            resetPasswordDiv.AddChidren(btnPasswordUnlockRightIcon);
            btnResetPasswordTitle = new Button()
            {
                X = Application.GetRealWidth(66),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.ResetDigitalPassword,
            };
            resetPasswordDiv.AddChidren(btnResetPasswordTitle);
//            btnResetPasswordTitle = new Button()
//            {
//                X = Application.GetRealWidth(66),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextID = StringId.ResetDigitalPassword,
//            };
//            resetPasswordDiv.AddChidren(btnResetPasswordTitle);
            if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("1"))
            {
                unlockOptionView.AddChidren(new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(343),
                    Height = 1,
                    BackgroundColor = CSS_Color.BackgroundColor,
                });
            }
            #endregion
//            if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("1"))
//            {
//                unlockOptionView.AddChidren(new Button()
//                {
//                    X = Application.GetRealWidth(16),
//                    Width = Application.GetRealWidth(343),
//                    Height = 1,
//                    BackgroundColor = CSS_Color.BackgroundColor,
//                });
//            }
//            #endregion
            #region 手势解锁
            var gestureUnlockDiv = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
            };
            if (!UserInfo.Current.appUnlockType.Contains("1"))
            {
                unlockOptionView.AddChidren(gestureUnlockDiv);
            }
            var btnGestureUnlockIcon = new Button()
            {
                X = Application.GetRealWidth(16),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureIcon.png",
            };
            gestureUnlockDiv.AddChidren(btnGestureUnlockIcon);
//            #region 手势解锁
//            var gestureUnlockDiv = new FrameLayout()
//            {
//                Height = Application.GetRealHeight(50),
//            };
//            if (!UserInfo.Current.appUnlockType.Contains("1"))
//            {
//                unlockOptionView.AddChidren(gestureUnlockDiv);
//            }
//            var btnGestureUnlockIcon = new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetRealWidth(32),
//                Height = Application.GetRealWidth(32),
//                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureIcon.png",
//            };
//            gestureUnlockDiv.AddChidren(btnGestureUnlockIcon);
            //var btnGestureUnlockRightIcon = new Button()
            //{
            //    X = Application.GetRealWidth(339),
            //    Gravity = Gravity.CenterVertical,
            //    Width = Application.GetMinRealAverage(16),
            //    Height = Application.GetMinRealAverage(16),
            //    UnSelectedImagePath = "Public/Right.png",
            //};
            //gestureUnlockDiv.AddChidren(btnGestureUnlockRightIcon);
//            //var btnGestureUnlockRightIcon = new Button()
//            //{
//            //    X = Application.GetRealWidth(339),
//            //    Gravity = Gravity.CenterVertical,
//            //    Width = Application.GetMinRealAverage(16),
//            //    Height = Application.GetMinRealAverage(16),
//            //    UnSelectedImagePath = "Public/Right.png",
//            //};
//            //gestureUnlockDiv.AddChidren(btnGestureUnlockRightIcon);
           var btnGestureUnlockkSwtichIcon = new Button()
            {
                X = Application.GetRealWidth(322),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(38),
                Height = Application.GetMinRealAverage(38),
                UnSelectedImagePath = "Public/Switch_2.png",
                SelectedImagePath = "Public/SwitchOn_2.png",
                IsSelected = UserInfo.Current.appUnlockType.Contains("2")
            };
            gestureUnlockDiv.AddChidren(btnGestureUnlockkSwtichIcon);
//           var btnGestureUnlockkSwtichIcon = new Button()
//            {
//                X = Application.GetRealWidth(322),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetMinRealAverage(38),
//                Height = Application.GetMinRealAverage(38),
//                UnSelectedImagePath = "Public/Switch_2.png",
//                SelectedImagePath = "Public/SwitchOn_2.png",
//                IsSelected = UserInfo.Current.appUnlockType.Contains("2")
//            };
//            gestureUnlockDiv.AddChidren(btnGestureUnlockkSwtichIcon);
            btnGestureUnlockTitle = new Button()
            {
                X = Application.GetRealWidth(66),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.GestureUnlock,
            };
            gestureUnlockDiv.AddChidren(btnGestureUnlockTitle);
//            btnGestureUnlockTitle = new Button()
//            {
//                X = Application.GetRealWidth(66),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextID = StringId.GestureUnlock,
//            };
//            gestureUnlockDiv.AddChidren(btnGestureUnlockTitle);
            if (!UserInfo.Current.appUnlockType.Contains("1"))
            {
                unlockOptionView.AddChidren(new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(343),
                    Height = 1,
                    BackgroundColor = CSS_Color.BackgroundColor,
                });
            }
            #endregion
//            if (!UserInfo.Current.appUnlockType.Contains("1"))
//            {
//                unlockOptionView.AddChidren(new Button()
//                {
//                    X = Application.GetRealWidth(16),
//                    Width = Application.GetRealWidth(343),
//                    Height = 1,
//                    BackgroundColor = CSS_Color.BackgroundColor,
//                });
//            }
//            #endregion
            #region 修改手势
            var resetGestureDiv = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
            };
            if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("2"))
            {
                unlockOptionView.AddChidren(resetGestureDiv);
            }
            var btnGestureRightIcon = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            resetGestureDiv.AddChidren(btnGestureRightIcon);
//            #region 修改手势
//            var resetGestureDiv = new FrameLayout()
//            {
//                Height = Application.GetRealHeight(50),
//            };
//            if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("2"))
//            {
//                unlockOptionView.AddChidren(resetGestureDiv);
//            }
//            var btnGestureRightIcon = new Button()
//            {
//                X = Application.GetRealWidth(339),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetMinRealAverage(16),
//                Height = Application.GetMinRealAverage(16),
//                UnSelectedImagePath = "Public/Right.png",
//            };
//            resetGestureDiv.AddChidren(btnGestureRightIcon);
            btnResetGestureTitle = new Button()
            {
                X = Application.GetRealWidth(66),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.ResetGesturePassword,
            };
            resetGestureDiv.AddChidren(btnResetGestureTitle);
//            btnResetGestureTitle = new Button()
//            {
//                X = Application.GetRealWidth(66),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextID = StringId.ResetGesturePassword,
//            };
//            resetGestureDiv.AddChidren(btnResetGestureTitle);
            if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("2"))
            {
                unlockOptionView.AddChidren(new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(343),
                    Height = 1,
                    BackgroundColor = CSS_Color.BackgroundColor,
                });
            }
            #endregion
//            if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("2"))
//            {
//                unlockOptionView.AddChidren(new Button()
//                {
//                    X = Application.GetRealWidth(16),
//                    Width = Application.GetRealWidth(343),
//                    Height = 1,
//                    BackgroundColor = CSS_Color.BackgroundColor,
//                });
//            }
//            #endregion
            #region 查询设备是否支持面容ID,指纹ID
            TouchIDUtils.TouchIDSupperType type = TouchIDUtils.getTouchIDSupperType();
            if (type == TouchIDUtils.TouchIDSupperType.TouchID)
            {
                sTouchID = true;
                MainPage.Log("KK:支持TouchID");
            }
            else if (type == TouchIDUtils.TouchIDSupperType.FaceID)
            {
                sFaceID = true;
                MainPage.Log("KK:支持FaceID");
            }
//            #region 查询设备是否支持面容ID,指纹ID
//            TouchIDUtils.TouchIDSupperType type = TouchIDUtils.getTouchIDSupperType();
//            if (type == TouchIDUtils.TouchIDSupperType.TouchID)
//            {
//                sTouchID = true;
//                MainPage.Log("KK:支持TouchID");
//            }
//            else if (type == TouchIDUtils.TouchIDSupperType.FaceID)
//            {
//                sFaceID = true;
//                MainPage.Log("KK:支持FaceID");
//            }
            #endregion
//            #endregion
            #region 指纹解锁
            fingerprintUnlockDiv = new FrameLayout()
            {
                Height = Application.GetRealHeight(51),
            };
            if (sTouchID && UserInfo.Current.appUnlockPasswrod != "" && !UserInfo.Current.appUnlockType.Contains("4"))
            {
                unlockOptionView.AddChidren(fingerprintUnlockDiv);
            }
//            #region 指纹解锁
//            fingerprintUnlockDiv = new FrameLayout()
//            {
//                Height = Application.GetRealHeight(51),
//            };
//            if (sTouchID && UserInfo.Current.appUnlockPasswrod != "" && !UserInfo.Current.appUnlockType.Contains("4"))
//            {
//                unlockOptionView.AddChidren(fingerprintUnlockDiv);
//            }
            var btnFingerprintUnlockIcon = new Button()
            {
                X = Application.GetRealWidth(16),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FingerprintIcon.png",
            };
            fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockIcon);
//            var btnFingerprintUnlockIcon = new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetRealWidth(32),
//                Height = Application.GetRealWidth(32),
//                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FingerprintIcon.png",
//            };
//            fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockIcon);
            var btnFingerprintUnlockTitle = new Button()
            {
                X = Application.GetRealWidth(66),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.FingerprintUnlock,
            };
            fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockTitle);
//            var btnFingerprintUnlockTitle = new Button()
//            {
//                X = Application.GetRealWidth(66),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextID = StringId.FingerprintUnlock,
//            };
//            fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockTitle);
            btnFingerprintUnlockSwtichIcon = new Button()
            {
                X = Application.GetRealWidth(322),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(38),
                Height = Application.GetMinRealAverage(38),
                UnSelectedImagePath = "Public/Switch_2.png",
                SelectedImagePath = "Public/SwitchOn_2.png",
                IsSelected = UserInfo.Current.appUnlockType.Contains("3")
            };
            fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockSwtichIcon);
//            btnFingerprintUnlockSwtichIcon = new Button()
//            {
//                X = Application.GetRealWidth(322),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetMinRealAverage(38),
//                Height = Application.GetMinRealAverage(38),
//                UnSelectedImagePath = "Public/Switch_2.png",
//                SelectedImagePath = "Public/SwitchOn_2.png",
//                IsSelected = UserInfo.Current.appUnlockType.Contains("3")
//            };
//            fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockSwtichIcon);
            fingerprintUnlockDiv.AddChidren(new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(50),
                Width = Application.GetRealWidth(343),
                Height = 1,
                BackgroundColor = CSS_Color.BackgroundColor,
                //Visible = sFaceID
            });
//            fingerprintUnlockDiv.AddChidren(new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Y = Application.GetRealHeight(50),
//                Width = Application.GetRealWidth(343),
//                Height = 1,
//                BackgroundColor = CSS_Color.BackgroundColor,
//                //Visible = sFaceID
//            });
            #endregion
//            #endregion
            #region 面容ID解锁
            faceIdUnlockDiv = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
            };
            if (sFaceID && UserInfo.Current.appUnlockPasswrod != "" && !UserInfo.Current.appUnlockType.Contains("3"))
            {
                unlockOptionView.AddChidren(faceIdUnlockDiv);
            }
            var btnFaceIdUnlockIcon = new Button()
            {
                X = Application.GetRealWidth(16),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FaceIdIcon.png",
            };
            faceIdUnlockDiv.AddChidren(btnFaceIdUnlockIcon);
//            #region 面容ID解锁
//            faceIdUnlockDiv = new FrameLayout()
//            {
//                Height = Application.GetRealHeight(50),
//            };
//            if (sFaceID && UserInfo.Current.appUnlockPasswrod != "" && !UserInfo.Current.appUnlockType.Contains("3"))
//            {
//                unlockOptionView.AddChidren(faceIdUnlockDiv);
//            }
//            var btnFaceIdUnlockIcon = new Button()
//            {
//                X = Application.GetRealWidth(16),
//                Gravity = Gravity.CenterVertical,
//                Width = Application.GetRealWidth(32),
//                Height = Application.GetRealWidth(32),
//                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FaceIdIcon.png",
//            };
//            faceIdUnlockDiv.AddChidren(btnFaceIdUnlockIcon);
            var btnFaceIdUnlockTitle = new Button()
            {
                X = Application.GetRealWidth(66),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.FaceIdUnlock,
            };
            faceIdUnlockDiv.AddChidren(btnFaceIdUnlockTitle);
//            var btnFaceIdUnlockTitle = new Button()
//            {
//                X = Application.GetRealWidth(66),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextColor = CSS_Color.FirstLevelTitleColor,
//                TextSize = CSS_FontSize.TextFontSize,
//                TextID = StringId.FaceIdUnlock,
//            };
//            faceIdUnlockDiv.AddChidren(btnFaceIdUnlockTitle);
            btnFaceIdUnlockSwtichIcon = new Button()
            {
                X = Application.GetRealWidth(322),
                Gravity= Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(38),
                Height = Application.GetMinRealAverage(38),
                UnSelectedImagePath = "Public/Switch_2.png",
                SelectedImagePath = "Public/SwitchOn_2.png",
                IsSelected = UserInfo.Current.appUnlockType.Contains("4")
            };
            faceIdUnlockDiv.AddChidren(btnFaceIdUnlockSwtichIcon);
//            btnFaceIdUnlockSwtichIcon = new Button()
//            {
//                X = Application.GetRealWidth(322),
//                Gravity= Gravity.CenterVertical,
//                Width = Application.GetMinRealAverage(38),
//                Height = Application.GetMinRealAverage(38),
//                UnSelectedImagePath = "Public/Switch_2.png",
//                SelectedImagePath = "Public/SwitchOn_2.png",
//                IsSelected = UserInfo.Current.appUnlockType.Contains("4")
//            };
//            faceIdUnlockDiv.AddChidren(btnFaceIdUnlockSwtichIcon);
            #endregion
//            #endregion
            LoadEvet_SkipEventList();
//            //LoadEvet_SkipEventList();
        }
//        }
    }
}
//    }
//}
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs
@@ -1,551 +1,551 @@
using System;
using Shared;
//using System;
//using Shared;
namespace HDL_ON.UI
{
    public partial class AppUnlockSettingsPage
    {
        Action refreshAction;
        void LoadEventList()
        {
            LoadEvent_OptionChange();
            LoadEvent_InitOptionState();
//namespace HDL_ON.UI
//{
//    public partial class AppUnlockSettingsPage
//    {
//        Action refreshAction;
//        void LoadEventList()
//        {
//            LoadEvent_OptionChange();
//            LoadEvent_InitOptionState();
            refreshAction = () =>
            {
                LoadView_UnlockView();
                //fingerprintUnlockDiv.Visible = sTouchID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2"));
                //faceIdUnlockDiv.Visible = sFaceID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2"));
                //btnFingerprintUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("3");
                //btnFaceIdUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("4");
            };
        }
//            refreshAction = () =>
//            {
//                LoadView_UnlockView();
//                //fingerprintUnlockDiv.Visible = sTouchID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2"));
//                //faceIdUnlockDiv.Visible = sFaceID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2"));
//                //btnFingerprintUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("3");
//                //btnFaceIdUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("4");
//            };
//        }
        /// <summary>
        /// 加载密码选项事件
        /// </summary>
        void LoadEvent_OptionChange()
        {
            EventHandler<MouseEventArgs> eventHandler1 = (sender, e1) =>
            {
                Action action = () =>
                {
                    btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
                    btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = false;
                    #region F3阶段
                    //btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false;
                    btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = false;
                    #endregion
//        /// <summary>
//        /// 加载密码选项事件
//        /// </summary>
//        void LoadEvent_OptionChange()
//        {
//            EventHandler<MouseEventArgs> eventHandler1 = (sender, e1) =>
//            {
//                Action action = () =>
//                {
//                    btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
//                    btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = false;
//                    #region F3阶段
//                    //btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false;
//                    btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = false;
//                    #endregion
                    btnTipMsg.TextID = StringId.UnprotectedTipMsg;
//                    btnTipMsg.TextID = StringId.UnprotectedTipMsg;
                    UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>();
                    UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();
                    UserInfo.Current.appUnlockPasswrod = "";
                    UserInfo.Current.SaveUserInfo();
                    unlockOptionView.Visible = false;
                    refreshAction();
                };
                Action action1 = () =>
                {
                    if (!btnUnprotectedBg.IsSelected)
                    {
                        //1:验证指纹
                        if (UserInfo.Current.appUnlockType.Contains("3"))
                        {
                            TouchIDVerification_TurnOffUnlock(action);
                        }
                        else if (UserInfo.Current.appUnlockType.Contains("4"))
                        {
                            //Face ID验证
                            FaceIDVerification_TurnOffUnlock(action);
                        }
                        else if (UserInfo.Current.appUnlockType.Contains("1"))
                        {
                            var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action);
                            MainPage.BasePageView.AddChidren(page);
                            page.LoadPage("4");
                            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("4");
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        }
                    }
                };
//                    UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>();
//                    UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();
//                    UserInfo.Current.appUnlockPasswrod = "";
//                    UserInfo.Current.SaveUserInfo();
//                    unlockOptionView.Visible = false;
//                    refreshAction();
//                };
//                Action action1 = () =>
//                {
//                    if (!btnUnprotectedBg.IsSelected)
//                    {
//                        //1:验证指纹
//                        if (UserInfo.Current.appUnlockType.Contains("3"))
//                        {
//                            TouchIDVerification_TurnOffUnlock(action);
//                        }
//                        else if (UserInfo.Current.appUnlockType.Contains("4"))
//                        {
//                            //Face ID验证
//                            FaceIDVerification_TurnOffUnlock(action);
//                        }
//                        else if (UserInfo.Current.appUnlockType.Contains("1"))
//                        {
//                            var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action);
//                            MainPage.BasePageView.AddChidren(page);
//                            page.LoadPage("4");
//                            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("4");
//                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//                        }
//                    }
//                };
                if (UserInfo.Current.appUnlockPasswrod != "")
                {
                    new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TipTurnOffUnlockingSetting, action1);
                }
                else
                {
                    action();
                }
            };
            btnUnprotectedBg.MouseUpEventHandler = eventHandler1;
            btnUnprotectedSelectionIcon.MouseUpEventHandler = eventHandler1;
            btnUnprotectedSelectionTip.MouseUpEventHandler = eventHandler1;
//                if (UserInfo.Current.appUnlockPasswrod != "")
//                {
//                    new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TipTurnOffUnlockingSetting, action1);
//                }
//                else
//                {
//                    action();
//                }
//            };
//            btnUnprotectedBg.MouseUpEventHandler = eventHandler1;
//            btnUnprotectedSelectionIcon.MouseUpEventHandler = eventHandler1;
//            btnUnprotectedSelectionTip.MouseUpEventHandler = eventHandler1;
            EventHandler<MouseEventArgs> eventHandler2 = (sender, e) =>
            {
                bool result = !btnStartupBg.IsSelected;
                if (!result)
                {
                    //如果启动解锁 不能取消启动解锁
                    if (!CheckIfCanDeselect("1")) return;
                }
                btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = result;
//            EventHandler<MouseEventArgs> eventHandler2 = (sender, e) =>
//            {
//                bool result = !btnStartupBg.IsSelected;
//                if (!result)
//                {
//                    //如果启动解锁 不能取消启动解锁
//                    if (!CheckIfCanDeselect("1")) return;
//                }
//                btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = result;
                btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg);
                if (result)
                {
                    btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
                    if (!UserInfo.Current.appUnlockPage.Contains("1"))
                    {
                        UserInfo.Current.appUnlockPage.Add("1");
                        if (UserInfo.Current.appUnlockPasswrod != "")
                            UserInfo.Current.SaveUserInfo();
                    }
                    unlockOptionView.Visible = true;
                }
                else
                {
                    if (UserInfo.Current.appUnlockPage.Contains("1"))
                    {
                        UserInfo.Current.appUnlockPage.Remove("1");
                    }
                    if (UserInfo.Current.appUnlockPage.Count == 0)
                    {
                        btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
                        btnTipMsg.TextID = StringId.UnprotectedTipMsg;
                        UserInfo.Current.appUnlockPasswrod = "";
                        unlockOptionView.Visible = false;
                        refreshAction();
                    }
                    UserInfo.Current.SaveUserInfo();
                }
            };
            btnStartupBg.MouseUpEventHandler = eventHandler2;
            btnStartupSelectionIcon.MouseUpEventHandler = eventHandler2;
            btnStartupSelectionTip.MouseUpEventHandler = eventHandler2;
//                btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg);
//                if (result)
//                {
//                    btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
//                    if (!UserInfo.Current.appUnlockPage.Contains("1"))
//                    {
//                        UserInfo.Current.appUnlockPage.Add("1");
//                        if (UserInfo.Current.appUnlockPasswrod != "")
//                            UserInfo.Current.SaveUserInfo();
//                    }
//                    unlockOptionView.Visible = true;
//                }
//                else
//                {
//                    if (UserInfo.Current.appUnlockPage.Contains("1"))
//                    {
//                        UserInfo.Current.appUnlockPage.Remove("1");
//                    }
//                    if (UserInfo.Current.appUnlockPage.Count == 0)
//                    {
//                        btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
//                        btnTipMsg.TextID = StringId.UnprotectedTipMsg;
//                        UserInfo.Current.appUnlockPasswrod = "";
//                        unlockOptionView.Visible = false;
//                        refreshAction();
//                    }
//                    UserInfo.Current.SaveUserInfo();
//                }
//            };
//            btnStartupBg.MouseUpEventHandler = eventHandler2;
//            btnStartupSelectionIcon.MouseUpEventHandler = eventHandler2;
//            btnStartupSelectionTip.MouseUpEventHandler = eventHandler2;
            #region F3阶段
            //EventHandler<MouseEventArgs> eventHandler3 = (sender, e) =>
            //{
            //    bool result = !btnSecurityBg.IsSelected;
            //    if (!result)
            //    {
            //        //如果只剩布防/撤防一种 不能取消布防/撤防
            //        if (!CheckIfCanDeselect("2")) return;
            //    }
            //    btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result;
            //    btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg);
            //    if (result)
            //    {
            //        btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
            //        if (!UserInfo.Current.appUnlockPage.Contains("2"))
            //        {
            //            UserInfo.Current.appUnlockPage.Add("2");
            //            if (UserInfo.Current.appUnlockPasswrod != "")
            //                UserInfo.Current.SaveUserInfo();
            //        }
            //        unlockOptionView.Visible = true;
            //    }
            //    else
            //    {
            //        if (UserInfo.Current.appUnlockPage.Contains("2"))
            //        {
            //            UserInfo.Current.appUnlockPage.Remove("2");
            //        }
            //        if (UserInfo.Current.appUnlockPage.Count == 0)
            //        {
            //            btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = result;
            //            btnTipMsg.TextID = StringId.UnprotectedTipMsg;
            //            UserInfo.Current.appUnlockPasswrod = "";
            //            unlockOptionView.Visible = false;
            //            refreshAction();
            //        }
            //        UserInfo.Current.SaveUserInfo();
            //    }
            //};
            //btnSecurityBg.MouseUpEventHandler = eventHandler3;
            //btnSecuritySelectionIcon.MouseUpEventHandler = eventHandler3;
            //btnSecuritySelectionTip.MouseUpEventHandler = eventHandler3;
//            #region F3阶段
//            //EventHandler<MouseEventArgs> eventHandler3 = (sender, e) =>
//            //{
//            //    bool result = !btnSecurityBg.IsSelected;
//            //    if (!result)
//            //    {
//            //        //如果只剩布防/撤防一种 不能取消布防/撤防
//            //        if (!CheckIfCanDeselect("2")) return;
//            //    }
//            //    btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result;
//            //    btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg);
//            //    if (result)
//            //    {
//            //        btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
//            //        if (!UserInfo.Current.appUnlockPage.Contains("2"))
//            //        {
//            //            UserInfo.Current.appUnlockPage.Add("2");
//            //            if (UserInfo.Current.appUnlockPasswrod != "")
//            //                UserInfo.Current.SaveUserInfo();
//            //        }
//            //        unlockOptionView.Visible = true;
//            //    }
//            //    else
//            //    {
//            //        if (UserInfo.Current.appUnlockPage.Contains("2"))
//            //        {
//            //            UserInfo.Current.appUnlockPage.Remove("2");
//            //        }
//            //        if (UserInfo.Current.appUnlockPage.Count == 0)
//            //        {
//            //            btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = result;
//            //            btnTipMsg.TextID = StringId.UnprotectedTipMsg;
//            //            UserInfo.Current.appUnlockPasswrod = "";
//            //            unlockOptionView.Visible = false;
//            //            refreshAction();
//            //        }
//            //        UserInfo.Current.SaveUserInfo();
//            //    }
//            //};
//            //btnSecurityBg.MouseUpEventHandler = eventHandler3;
//            //btnSecuritySelectionIcon.MouseUpEventHandler = eventHandler3;
//            //btnSecuritySelectionTip.MouseUpEventHandler = eventHandler3;
            EventHandler<MouseEventArgs> eventHandler4 = (sender, e) =>
            {
                bool result = !btnDoorlockBg.IsSelected;
                if (!result)
                {
                    //如果只剩远程开锁不能取消远程开锁
                    if (!CheckIfCanDeselect("3")) return;
                }
//            EventHandler<MouseEventArgs> eventHandler4 = (sender, e) =>
//            {
//                bool result = !btnDoorlockBg.IsSelected;
//                if (!result)
//                {
//                    //如果只剩远程开锁不能取消远程开锁
//                    if (!CheckIfCanDeselect("3")) return;
//                }
                btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = result;
//                btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = result;
                btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg);
                if (result)
                {
                    btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
                    if (!UserInfo.Current.appUnlockPage.Contains("3"))
                    {
                        UserInfo.Current.appUnlockPage.Add("3");
                        if (UserInfo.Current.appUnlockPasswrod != "")
                            UserInfo.Current.SaveUserInfo();
                    }
                    unlockOptionView.Visible = true;
                }
                else
                {
                    if (UserInfo.Current.appUnlockPage.Contains("3"))
                    {
                        UserInfo.Current.appUnlockPage.Remove("3");
                    }
                    if (UserInfo.Current.appUnlockPage.Count == 0)
                    {
                        btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
                        btnTipMsg.TextID = StringId.UnprotectedTipMsg;
                        UserInfo.Current.appUnlockPasswrod = "";
                        unlockOptionView.Visible = false;
                        refreshAction();
                    }
                    UserInfo.Current.SaveUserInfo();
                }
            };
            btnDoorlockBg.MouseUpEventHandler = eventHandler4;
            btnDoorlockSelectionIcon.MouseUpEventHandler = eventHandler4;
            btnDoorlockSelectionTip.MouseUpEventHandler = eventHandler4;
            #endregion
        }
//                btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg);
//                if (result)
//                {
//                    btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
//                    if (!UserInfo.Current.appUnlockPage.Contains("3"))
//                    {
//                        UserInfo.Current.appUnlockPage.Add("3");
//                        if (UserInfo.Current.appUnlockPasswrod != "")
//                            UserInfo.Current.SaveUserInfo();
//                    }
//                    unlockOptionView.Visible = true;
//                }
//                else
//                {
//                    if (UserInfo.Current.appUnlockPage.Contains("3"))
//                    {
//                        UserInfo.Current.appUnlockPage.Remove("3");
//                    }
//                    if (UserInfo.Current.appUnlockPage.Count == 0)
//                    {
//                        btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
//                        btnTipMsg.TextID = StringId.UnprotectedTipMsg;
//                        UserInfo.Current.appUnlockPasswrod = "";
//                        unlockOptionView.Visible = false;
//                        refreshAction();
//                    }
//                    UserInfo.Current.SaveUserInfo();
//                }
//            };
//            btnDoorlockBg.MouseUpEventHandler = eventHandler4;
//            btnDoorlockSelectionIcon.MouseUpEventHandler = eventHandler4;
//            btnDoorlockSelectionTip.MouseUpEventHandler = eventHandler4;
//            #endregion
//        }
        /// <summary>
        /// 加载用户密码选项状态
        /// </summary>
        void LoadEvent_InitOptionState()
        {
            if (UserInfo.Current.appUnlockPage.Count == 0)
            {
                btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
            }
            else
            {
                if (UserInfo.Current.appUnlockPage.Contains("1"))
                {
                    btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true;
                    btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg);
                }
                #region F3阶段
                //if (UserInfo.Current.appUnlockPage.Contains("2"))
                //{
                //    btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true;
                //    btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg);
                //}
                if (UserInfo.Current.appUnlockPage.Contains("3"))
                {
                    btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true;
                    btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg);
                }
                #endregion
            }
        }
//        /// <summary>
//        /// 加载用户密码选项状态
//        /// </summary>
//        void LoadEvent_InitOptionState()
//        {
//            if (UserInfo.Current.appUnlockPage.Count == 0)
//            {
//                btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
//            }
//            else
//            {
//                if (UserInfo.Current.appUnlockPage.Contains("1"))
//                {
//                    btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true;
//                    btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg);
//                }
//                #region F3阶段
//                //if (UserInfo.Current.appUnlockPage.Contains("2"))
//                //{
//                //    btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true;
//                //    btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg);
//                //}
//                if (UserInfo.Current.appUnlockPage.Contains("3"))
//                {
//                    btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true;
//                    btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg);
//                }
//                #endregion
//            }
//        }
        /// <summary>
        /// 密码设置跳转事件列表
        /// </summary>
        void LoadEvet_SkipEventList()
        {
            btnPasswordUnlockTitle.MouseUpEventHandler = (sender, e) =>
            {
                var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage(UserInfo.Current.appUnlockType.Contains("1") ? "3" : "1");
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
//        /// <summary>
//        /// 密码设置跳转事件列表
//        /// </summary>
//        void LoadEvet_SkipEventList()
//        {
//            btnPasswordUnlockTitle.MouseUpEventHandler = (sender, e) =>
//            {
//                var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction);
//                MainPage.BasePageView.AddChidren(page);
//                page.LoadPage(UserInfo.Current.appUnlockType.Contains("1") ? "3" : "1");
//                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//            };
            btnResetPasswordTitle.MouseUpEventHandler = (sender, e) =>
            {
                var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage("2");
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
//            btnResetPasswordTitle.MouseUpEventHandler = (sender, e) =>
//            {
//                var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction);
//                MainPage.BasePageView.AddChidren(page);
//                page.LoadPage("2");
//                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//            };
            btnGestureUnlockTitle.MouseUpEventHandler = (sender, e) =>
            {
                var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage(UserInfo.Current.appUnlockType.Contains("2") ? "3" : "1");
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            btnResetGestureTitle.MouseUpEventHandler = (sender, e) =>
            {
                var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage("2");//2020-12-11
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
//            btnGestureUnlockTitle.MouseUpEventHandler = (sender, e) =>
//            {
//                var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction);
//                MainPage.BasePageView.AddChidren(page);
//                page.LoadPage(UserInfo.Current.appUnlockType.Contains("2") ? "3" : "1");
//                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//            };
//            btnResetGestureTitle.MouseUpEventHandler = (sender, e) =>
//            {
//                var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction);
//                MainPage.BasePageView.AddChidren(page);
//                page.LoadPage("2");//2020-12-11
//                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//            };
            if (sTouchID)
            {
                btnFingerprintUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) =>
                {
                    TouchIDVerification_SwtichOnOff();
                };
            }
            if (sFaceID)
            {
                btnFaceIdUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) =>
                {
                    FaceIDVerification_SwtichOnOff();
                };
            }
        }
//            if (sTouchID)
//            {
//                btnFingerprintUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) =>
//                {
//                    TouchIDVerification_SwtichOnOff();
//                };
//            }
//            if (sFaceID)
//            {
//                btnFaceIdUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) =>
//                {
//                    FaceIDVerification_SwtichOnOff();
//                };
//            }
//        }
        /// <summary>
        /// 判断是否能够取消,如果只剩最后一种解锁方案禁止取消
        /// </summary>
        /// <param name="appUnlockPageType">1:启动时 2:布防撤防时 3:远程开锁时</param>
        /// <returns></returns>
        bool CheckIfCanDeselect(string appUnlockPageType)
        {
            if (UserInfo.Current.appUnlockPage.Count == 1 && UserInfo.Current.appUnlockPage.Contains(appUnlockPageType))
            {
                return false;
            }
//        /// <summary>
//        /// 判断是否能够取消,如果只剩最后一种解锁方案禁止取消
//        /// </summary>
//        /// <param name="appUnlockPageType">1:启动时 2:布防撤防时 3:远程开锁时</param>
//        /// <returns></returns>
//        bool CheckIfCanDeselect(string appUnlockPageType)
//        {
//            if (UserInfo.Current.appUnlockPage.Count == 1 && UserInfo.Current.appUnlockPage.Contains(appUnlockPageType))
//            {
//                return false;
//            }
            return true;
        }
//            return true;
//        }
        /// <summary>
        /// 面容ID验证弹窗
        /// </summary>
        /// <param name="successAction"></param>
        /// <param name="goToVerifyPasswordAction"></param>
        void FaceIDVerification_Show(Action successAction, Action goToVerifyPasswordAction)
        {
            //提示数字密码验证还是绘制手势验证
            string verificationTitleString = GetVerificationTitleString();
//        /// <summary>
//        /// 面容ID验证弹窗
//        /// </summary>
//        /// <param name="successAction"></param>
//        /// <param name="goToVerifyPasswordAction"></param>
//        void FaceIDVerification_Show(Action successAction, Action goToVerifyPasswordAction)
//        {
//            //提示数字密码验证还是绘制手势验证
//            string verificationTitleString = GetVerificationTitleString();
            TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID));
            TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
            {
                if (e == TouchIDUtils.TouchIDState.Success)
                {
                    MainPage.Log("KK:FaceID验证成功");
                    successAction?.Invoke();
                }
                else if (e == TouchIDUtils.TouchIDState.NotSupport)
                {
                    MainPage.Log("KK:当前设备不支持FaceID验证,请输入密码来验证");
                    goToVerifyPasswordAction();
                }
                else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout)
                {
                    MainPage.Log("KK:用户选择手动输入密码");
                    goToVerifyPasswordAction();
                }
            };
        }
//            TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID));
//            TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
//            {
//                if (e == TouchIDUtils.TouchIDState.Success)
//                {
//                    MainPage.Log("KK:FaceID验证成功");
//                    successAction?.Invoke();
//                }
//                else if (e == TouchIDUtils.TouchIDState.NotSupport)
//                {
//                    MainPage.Log("KK:当前设备不支持FaceID验证,请输入密码来验证");
//                    goToVerifyPasswordAction();
//                }
//                else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout)
//                {
//                    MainPage.Log("KK:用户选择手动输入密码");
//                    goToVerifyPasswordAction();
//                }
//            };
//        }
        /// <summary>
        /// 面容ID开启和关闭
        /// </summary>
        /// <param name="successAction">验证成功事件</param>
        void FaceIDVerification_SwtichOnOff()
        {
            //4:面容ID
            string faceIDUnlockType = "4";
            //6:面容ID开关
            string optionType = "6";
            //成功事件
            Action successAction = () =>
            {
                var result = btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected;
                if (result)
                {
                    if (!UserInfo.Current.appUnlockType.Contains(faceIDUnlockType))
                    {
                        UserInfo.Current.appUnlockType.Add(faceIDUnlockType);
                        UserInfo.Current.SaveUserInfo();
                    }
                }
                else
                {
                    if (UserInfo.Current.appUnlockType.Contains(faceIDUnlockType))
                    {
                        UserInfo.Current.appUnlockType.Remove(faceIDUnlockType);
                        UserInfo.Current.SaveUserInfo();
                    }
                }
            };
//        /// <summary>
//        /// 面容ID开启和关闭
//        /// </summary>
//        /// <param name="successAction">验证成功事件</param>
//        void FaceIDVerification_SwtichOnOff()
//        {
//            //4:面容ID
//            string faceIDUnlockType = "4";
//            //6:面容ID开关
//            string optionType = "6";
//            //成功事件
//            Action successAction = () =>
//            {
//                var result = btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected;
//                if (result)
//                {
//                    if (!UserInfo.Current.appUnlockType.Contains(faceIDUnlockType))
//                    {
//                        UserInfo.Current.appUnlockType.Add(faceIDUnlockType);
//                        UserInfo.Current.SaveUserInfo();
//                    }
//                }
//                else
//                {
//                    if (UserInfo.Current.appUnlockType.Contains(faceIDUnlockType))
//                    {
//                        UserInfo.Current.appUnlockType.Remove(faceIDUnlockType);
//                        UserInfo.Current.SaveUserInfo();
//                    }
//                }
//            };
            
            //跳转数字密码或者手势密码验证页面
            Action goToVerifyPasswordAction = () =>
            {
                //关闭解锁验证
                GotogoToVerifyPasswordPage(optionType, successAction);
            };
//            //跳转数字密码或者手势密码验证页面
//            Action goToVerifyPasswordAction = () =>
//            {
//                //关闭解锁验证
//                GotogoToVerifyPasswordPage(optionType, successAction);
//            };
            FaceIDVerification_Show(successAction, goToVerifyPasswordAction);
//            FaceIDVerification_Show(successAction, goToVerifyPasswordAction);
        }
//        }
        /// <summary>
        /// FaceID验证 关闭解锁设置
        /// </summary>
        /// <param name="action">验证成功事件</param>
        void FaceIDVerification_TurnOffUnlock(Action successAction)
        {
            //调整数字密码或者手势密码验证页面
            Action goToVerifyPasswordAction = () =>
            {
                //关闭解锁验证
                GotogoToVerifyPasswordPage("4", successAction);
            };
//        /// <summary>
//        /// FaceID验证 关闭解锁设置
//        /// </summary>
//        /// <param name="action">验证成功事件</param>
//        void FaceIDVerification_TurnOffUnlock(Action successAction)
//        {
//            //调整数字密码或者手势密码验证页面
//            Action goToVerifyPasswordAction = () =>
//            {
//                //关闭解锁验证
//                GotogoToVerifyPasswordPage("4", successAction);
//            };
            FaceIDVerification_Show(successAction, goToVerifyPasswordAction);
        }
//            FaceIDVerification_Show(successAction, goToVerifyPasswordAction);
//        }
        /// <summary>
        /// 指纹ID统一弹出
        /// </summary>
        /// <param name="optionType"></param>
        /// <param name="successAction"></param>
        /// <param name="goToVerifyPasswordAction"></param>
        void TouchIDVerification_Show(Action successAction, Action goToVerifyPasswordAction)
        {
            //提示数字密码验证还是绘制手势验证
            string verificationTitleString = GetVerificationTitleString();
//        /// <summary>
//        /// 指纹ID统一弹出
//        /// </summary>
//        /// <param name="optionType"></param>
//        /// <param name="successAction"></param>
//        /// <param name="goToVerifyPasswordAction"></param>
//        void TouchIDVerification_Show(Action successAction, Action goToVerifyPasswordAction)
//        {
//            //提示数字密码验证还是绘制手势验证
//            string verificationTitleString = GetVerificationTitleString();
            TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
            TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
            {
                if (e == TouchIDUtils.TouchIDState.NotSupport)
                {
                    MainPage.Log("KK:当前设备不支持TouchID验证,请输入密码来验证");
                    goToVerifyPasswordAction?.Invoke();
                }
                else if (e == TouchIDUtils.TouchIDState.Success)
                {
                    MainPage.Log("KK:TouchID验证成功");
                    successAction?.Invoke();
                }
                else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout)
                {
                    MainPage.Log("KK:用户选择手动输入密码");
                    goToVerifyPasswordAction?.Invoke();
                }
//            TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
//            TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
//            {
//                if (e == TouchIDUtils.TouchIDState.NotSupport)
//                {
//                    MainPage.Log("KK:当前设备不支持TouchID验证,请输入密码来验证");
//                    goToVerifyPasswordAction?.Invoke();
//                }
//                else if (e == TouchIDUtils.TouchIDState.Success)
//                {
//                    MainPage.Log("KK:TouchID验证成功");
//                    successAction?.Invoke();
//                }
//                else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout)
//                {
//                    MainPage.Log("KK:用户选择手动输入密码");
//                    goToVerifyPasswordAction?.Invoke();
//                }
            };
        }
//            };
//        }
        /// <summary>
        /// 指纹ID开启和关闭 5:指纹ID开关
        /// </summary>
        void TouchIDVerification_SwtichOnOff()
        {
            //指纹关闭成功事件 成功事件
            Action successAction = () =>
            {
                var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected;
                if (result)
                {
                    if (!UserInfo.Current.appUnlockType.Contains("3"))
                    {
                        UserInfo.Current.appUnlockType.Add("3");
                        UserInfo.Current.SaveUserInfo();
                    }
                }
                else
                {
                    if (UserInfo.Current.appUnlockType.Contains("3"))
                    {
                        UserInfo.Current.appUnlockType.Remove("3");
                        UserInfo.Current.SaveUserInfo();
                    }
                }
            };
//        /// <summary>
//        /// 指纹ID开启和关闭 5:指纹ID开关
//        /// </summary>
//        void TouchIDVerification_SwtichOnOff()
//        {
//            //指纹关闭成功事件 成功事件
//            Action successAction = () =>
//            {
//                var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected;
//                if (result)
//                {
//                    if (!UserInfo.Current.appUnlockType.Contains("3"))
//                    {
//                        UserInfo.Current.appUnlockType.Add("3");
//                        UserInfo.Current.SaveUserInfo();
//                    }
//                }
//                else
//                {
//                    if (UserInfo.Current.appUnlockType.Contains("3"))
//                    {
//                        UserInfo.Current.appUnlockType.Remove("3");
//                        UserInfo.Current.SaveUserInfo();
//                    }
//                }
//            };
            //5:指纹ID开关
            string optionType = "5";
            //跳转数字密码或者手势密码验证页面
            Action goToVerifyPasswordAction = () =>
            {
                //5:指纹ID开关
                GotogoToVerifyPasswordPage(optionType, successAction);
            };
//            //5:指纹ID开关
//            string optionType = "5";
//            //跳转数字密码或者手势密码验证页面
//            Action goToVerifyPasswordAction = () =>
//            {
//                //5:指纹ID开关
//                GotogoToVerifyPasswordPage(optionType, successAction);
//            };
            
            TouchIDVerification_Show(successAction, goToVerifyPasswordAction);
        }
//            TouchIDVerification_Show(successAction, goToVerifyPasswordAction);
//        }
        /// <summary>
        /// TouchID验证 4:关闭解锁设置
        /// </summary>
        /// <param name="action">验证成功事件</param>
        void TouchIDVerification_TurnOffUnlock(Action successAction)
        {
            //跳转数字密码或者手势密码验证页面
            Action goToVerifyPasswordAction = () =>
            {
                //4.关闭解锁验证
                GotogoToVerifyPasswordPage("4", successAction);
            };
//        /// <summary>
//        /// TouchID验证 4:关闭解锁设置
//        /// </summary>
//        /// <param name="action">验证成功事件</param>
//        void TouchIDVerification_TurnOffUnlock(Action successAction)
//        {
//            //跳转数字密码或者手势密码验证页面
//            Action goToVerifyPasswordAction = () =>
//            {
//                //4.关闭解锁验证
//                GotogoToVerifyPasswordPage("4", successAction);
//            };
            TouchIDVerification_Show(successAction, goToVerifyPasswordAction);
        }
//            TouchIDVerification_Show(successAction, goToVerifyPasswordAction);
//        }
        /// <summary>
        /// 跳转手势或者密码验证界面
        /// </summary>
        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</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>
//        /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</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>
//        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);
            }
        }
    }
}
//        /// <summary>
//        /// 判断是否数字验证、否则绘制手势验证
//        /// </summary>
//        /// <returns></returns>
//        string GetVerificationTitleString()
//        {
//            if (CheckIfUnlockPassword())
//            {
//                return Language.StringByID(StringId.PasswordVerification);
//            }
//            else
//            {
//                return Language.StringByID(StringId.GestureVerification);
//            }
//        }
//    }
//}
SiriIntents/Server/HttpUtil.cs
@@ -16,13 +16,13 @@
        /// 固定域名,正式环境
        /// 公共域名就近解析
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        const string APP_KEY = "HDL-HOME-APP";
        const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC";
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //const string APP_KEY = "HDL-HOME-APP";
        //const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
        //public const string APP_KEY = "HDL-HOME-APP-TEST";
        //public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
        public const string APP_KEY = "HDL-HOME-APP-TEST";
        public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
        //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm
        //const string APP_KEY = "CPEVRLRT";