HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-01-17 4b378188ce972df432b23d9cb73babb6cc0679c6
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -40,16 +40,43 @@
            BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
        }
        #region ◆ 变量申明__________________________
        ZigBee.Device.DoorLock doorLock;//当前门锁
        VerticalListRefreshControl bodyView;//刷新View
        Button currentMethod;// 当前选择的方式
        Shared.Phone.UserCenter.MemberInfoRes curAccountObj;//当前账户
        #region 变量申明
        /// <summary>
        /// 当前门锁
        /// </summary>
        ZigBee.Device.DoorLock doorLock;
        /// <summary>
        /// 刷新View
        /// </summary>
        VerticalListRefreshControl bodyView;
        /// <summary>
        /// 当前选择的方式
        /// </summary>
        Button currentMethod;
        /// <summary>
        /// 当前账户
        /// </summary>
        Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
        /// <summary>
        /// 数据为空,UI显示的空图片
        /// </summary>
        Button entryStatusPic;
        /// <summary>
        /// 数据为空,UI显示的文本提示
        /// </summary>
        Button btnPicTip;
        /// <summary>
        /// 数据为空,UI显示的文本提示
        /// </summary>
        Button btnPicTip1;
        bool isSecondDel;//是否二次删除
        FrameLayout blankFrameLayout;//空数据显示布局
        /// <summary>
        /// //是否二次删除
        /// </summary>
        bool isSecondDel;
        /// <summary>
        /// 空数据显示布局
        /// </summary>
        FrameLayout blankFrameLayout;
        #endregion
        /// <summary>
@@ -90,6 +117,7 @@
        /// </summary>
        public void Show()
        {
            UserView.HomePage.Instance.ScrollEnabled = false;
            doorLock.currentUserDisplayMethod = "";
            this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.LockMethod));
            this.btnTitleLine.Visible = false;
@@ -154,7 +182,10 @@
                RefreshList();
            }
        }
        //中部布局
        /// <summary>
        /// 中部布局
        /// </summary>
        void MidFrameLayoutContent()
        {
            #region 开锁方式UI
@@ -283,6 +314,10 @@
                TextSize = 12,
            };
            blankFrameLayout.AddChidren(btnPicTip1);
            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
            {
                btnPicTip1.Width = 0;
            }
        }
        /// <summary>
@@ -616,9 +651,12 @@
            }
        }
        // 侧边导航栏
        /// <summary>
        /// 侧边导航栏
        /// </summary>
        void SideslipFramelayout()
        {
            #region sidelipFrameLayout UI
            var dialog = new Dialog
            {
            };
@@ -647,10 +685,13 @@
                Y = Application.GetRealHeight(28),
            };
            sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout);
            #endregion
            Button oldbutton = null;
            Button oldbuttonText = null;
            for (var i = 0; i < 4; i++)
            {
                #region rowFrameLayout UI
                var rowFrameLayout = new RowLayout()
                {
                    Height = Application.GetRealHeight(150),
@@ -678,7 +719,9 @@
                    TextAlignment = TextAlignment.CenterLeft,
                };
                rowFrameLayout.AddChidren(btnMethodText);
                #endregion
                #region 数据处理
                EventHandler<MouseEventArgs> hander = (sender, e) =>
                {
                    if (!btnAllMethod.IsSelected)
@@ -706,74 +749,35 @@
                btnAllMethod.MouseUpEventHandler += hander;
                btnMethodText.MouseUpEventHandler += hander;
                switch (i)
                {
                    case 0:
                        btnAllMethod.UnSelectedImagePath = "DoorLock/AllMethod.png";
                        btnAllMethod.SelectedImagePath = "DoorLock/AllMethodOn.png";
                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.AllMethod);
                        break;
                    case 1:
                        btnAllMethod.UnSelectedImagePath = "DoorLock/Password.png";
                        btnAllMethod.SelectedImagePath = "DoorLock/PasswordOn.png";
                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.PasswordUnlock);
                        break;
                    case 2:
                        btnAllMethod.UnSelectedImagePath = "DoorLock/Fingerprint.png";
                        btnAllMethod.SelectedImagePath = "DoorLock/FingerprintOn.png";
                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.FingerprintUnlock);
                        break;
                    case 3:
                        btnAllMethod.UnSelectedImagePath = "DoorLock/proximityCard.png";
                        btnAllMethod.SelectedImagePath = "DoorLock/proximityCardOn.png";
                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock);
                        break;
                }
                DisplayAllUnlockMethod(i, btnAllMethod, btnMethodText);
                if (string.IsNullOrEmpty(doorLock.currentUserDisplayMethod) && i == 0)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod) && i == 0)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock) && i == 1)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock) && i == 2)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock) && i == 3)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                #endregion
            }
        }
        //类型区分
        /// <summary>
        /// 类型区分
        /// </summary>
        void TypeRefresh()
        {
            if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock))
@@ -799,6 +803,7 @@
        /// </summary>
        public override void RemoveFromParent()
        {
            UserView.HomePage.Instance.ScrollEnabled = true;
            ZbGateway.StatusList.Remove(this);
            base.RemoveFromParent();
        }