HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-03-06 a5b3c4bae726ef6770d4bfcbf2f4b50a37ed4a15
ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
@@ -23,6 +23,13 @@
            //设置头部信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uSecondAuthentication));
            var btntitle = (Button)topFrameLayout.GetTagByKey("txtTitle");
            btntitle.MouseLongEventHandler += (sender, e) =>
            {
                //显示数字命令窗口
                this.ShowKeyNumberComandDialog();
            };
            //初始化中部信息
            this.InitMiddleFrame();
        }
@@ -55,7 +62,7 @@
            rowFinger.AddChidren(btnEffect, ChidrenBindMode.NotBind);
            //开关按钮
            var btnFingerSwicth = rowFinger.AddMostRightSwitchIcon();
            btnFingerSwicth.IsSelected = UserCenterResourse.Option.FingerprintAuthentication;
            btnFingerSwicth.IsSelected = UserCenterResourse.AccountOption.FingerprintAuthentication;
            //底线
            rowFinger.AddBottomLine();
@@ -67,7 +74,7 @@
            rowPsw.AddRightArrow();
            //去设置
            var btnSettion1 = rowPsw.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uGotoSettion), 400);
            if (string.IsNullOrEmpty(UserCenterResourse.Option.PswAuthentication) == false)
            if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.PswAuthentication) == false)
            {
                //去修改
                btnSettion1.TextID = R.MyInternationalizationString.uGotoEditor;
@@ -83,7 +90,7 @@
            rowGesture.AddRightArrow();
            //去设置
            var btnSettion2 = rowGesture.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uGotoSettion), 400);
            if (string.IsNullOrEmpty(UserCenterResourse.Option.GestureAuthentication) == false)
            if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.GestureAuthentication) == false)
            {
                //去修改
                btnSettion2.TextID = R.MyInternationalizationString.uGotoEditor;
@@ -138,7 +145,7 @@
            var btnLockSwicth = rowLock.AddMostRightSwitchIcon();
            //底线
            rowLock.AddBottomLine();
            btnLockSwicth.IsSelected = UserCenterResourse.Option.DoorUnLockByRemote;
            btnLockSwicth.IsSelected = UserCenterResourse.AccountOption.DoorUnLockByRemote;
            var rowSafety = new FrameRowControl(frameButtom.rowSpace / 2);
            rowSafety.UseClickStatu = false;
@@ -189,7 +196,7 @@
            rowPsw.ButtonClickEvent += (sender, e) =>
            {
                //如果没有密码验证
                if (string.IsNullOrEmpty(UserCenterResourse.Option.PswAuthentication) == true)
                if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.PswAuthentication) == true)
                {
                    //如果设置有其他验证方式,则需要验证,否则直接跳过验证
                    HdlCheckLogic.Current.CheckSecondarySecurity(
@@ -206,7 +213,7 @@
            rowGesture.ButtonClickEvent += (sender, e) =>
            {
                //如果没有手势验证
                if (string.IsNullOrEmpty(UserCenterResourse.Option.GestureAuthentication) == true)
                if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.GestureAuthentication) == true)
                {
                    //如果设置有其他验证方式,则需要验证,否则直接跳过验证
                    HdlCheckLogic.Current.CheckSecondarySecurity(
@@ -256,22 +263,22 @@
                    return;
                }
                UserCenterResourse.Option.FingerprintAuthentication = !btnFingerSwicth.IsSelected;
                UserCenterResourse.Option.Save();
                UserCenterResourse.AccountOption.FingerprintAuthentication = !btnFingerSwicth.IsSelected;
                UserCenterResourse.AccountOption.Save();
                //重新刷新界面
                this.InitMiddleFrame();
            }
            else
            {
                if (string.IsNullOrEmpty(UserCenterResourse.Option.GestureAuthentication) == true
                    && string.IsNullOrEmpty(UserCenterResourse.Option.PswAuthentication) == true
                if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.GestureAuthentication) == true
                    && string.IsNullOrEmpty(UserCenterResourse.AccountOption.PswAuthentication) == true
                    && btnLockSwicth.IsSelected == true)
                {
                    //所有验证都取消了,则取消远程开锁功能
                    UserCenterResourse.Option.DoorUnLockByRemote = false;
                    UserCenterResourse.AccountOption.DoorUnLockByRemote = false;
                }
                UserCenterResourse.Option.FingerprintAuthentication = !btnFingerSwicth.IsSelected;
                UserCenterResourse.Option.Save();
                UserCenterResourse.AccountOption.FingerprintAuthentication = !btnFingerSwicth.IsSelected;
                UserCenterResourse.AccountOption.Save();
                //重新刷新界面
                this.InitMiddleFrame();
            }
@@ -288,11 +295,11 @@
        private void DoRemoteUnLocks(MostRightIconControl btnLockSwicth)
        {
            if (btnLockSwicth.IsSelected == false
                && string.IsNullOrEmpty(UserCenterResourse.Option.GestureAuthentication) == true
                && string.IsNullOrEmpty(UserCenterResourse.Option.PswAuthentication) == true)
                && string.IsNullOrEmpty(UserCenterResourse.AccountOption.GestureAuthentication) == true
                && string.IsNullOrEmpty(UserCenterResourse.AccountOption.PswAuthentication) == true)
            {
                TouchIDUtils.TouchIDSupperType type = TouchIDUtils.getTouchIDSupperType();
                if (type == TouchIDUtils.TouchIDSupperType.None || UserCenterResourse.Option.FingerprintAuthentication == false)
                if (type == TouchIDUtils.TouchIDSupperType.None || UserCenterResourse.AccountOption.FingerprintAuthentication == false)
                {
                    //远程开锁开启失败,请先设置{0}二次安全验证方式
                    string msg = Language.StringByID(R.MyInternationalizationString.uUseUnLockByRemoteFailMsg);
@@ -304,8 +311,8 @@
                    return;
                }
            }
            UserCenterResourse.Option.DoorUnLockByRemote = !btnLockSwicth.IsSelected;
            UserCenterResourse.Option.Save();
            UserCenterResourse.AccountOption.DoorUnLockByRemote = !btnLockSwicth.IsSelected;
            UserCenterResourse.AccountOption.Save();
            //重新刷新界面
            this.InitMiddleFrame();
        }
@@ -372,6 +379,34 @@
            }
        }
        /// <summary>
        /// 显示数字命令窗口
        /// </summary>
        private void ShowKeyNumberComandDialog()
        {
            //生成一个弹窗画面
            var dialogForm = new DialogInputControl();
            dialogForm.SetTitleText("?????");
            //按下确认按钮
            dialogForm.ComfirmClickEvent += ((textValue) =>
            {
                dialogForm.CloseDialog();
                if (textValue == "2887")
                {
                    //开启隐藏菜单
                    UserCenterResourse.HideOption.CenterHideMenu = 1;
                    this.ShowMassage(ShowMsgType.Tip, "Ok!");
                }
                if (textValue == "0001")
                {
                    var form = new Guide.GuideHouseForm();
                    form.ShowFrom();
                    this.ShowMassage(ShowMsgType.Tip, "Ok!");
                }
            });
        }
        #endregion
    }
}