黄学彪
2020-02-21 bd46c57c77c276014db3192a4e2cc96e23c93202
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -7,23 +7,31 @@
{
    public class DoorLockCommonLayout : EditorCommonForm
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public DoorLockCommonLayout()
        {
        }
        #region ◆ 变量申明__________________________
        #region 变量申明
        public FrameLayout topFrameLayout = new FrameLayout { Height = Application.GetRealHeight(184), BackgroundColor = ZigbeeColor.Current.XMTopFrameLayout };
        public FrameLayout midFrameLayout = new FrameLayout { Height = Application.GetRealHeight(1921 - 184), BackgroundColor = ZigbeeColor.Current.XMMidFrameLayout };
        #region ◆ 底部有圆角布局__________________________
        #region 底部有圆角布局
        /// 背景阴影界面
        /// </summary>
        public FrameLayout shadowRadiusFrameLayout = new FrameLayout { BackgroundColor = 0x0f000000 };
        /// <summary>
        /// 设置圆角的界面
        /// </summary>
        public FrameLayout bottomRadiusFrameLayout = new FrameLayout()
        {
            Height = Application.GetRealHeight(806),
            Y = Application.GetRealHeight(930),
            BackgroundColor = ZigbeeColor.Current.XMWhite,
        };
        /// <summary>
        /// 底部圆角中的取消按钮
        /// </summary>
        public Button btnCancel = new Button
        {
            X = Application.GetRealWidth(81),
@@ -34,7 +42,9 @@
            TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
            TextSize = 14,
        };
        /// <summary>
        /// 底部圆角中的标题栏
        /// </summary>
        public Button btnBottomTitle = new Button
        {
            X = Application.GetRealWidth(446 - 50),
@@ -45,7 +55,9 @@
            TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
            TextSize = 16,
        };
        /// <summary>
        /// 底部圆角中的确认按钮
        /// </summary>
        public Button btnFinish = new Button
        {
            X = Application.GetRealWidth(919),
@@ -56,7 +68,9 @@
            TextColor = Shared.Common.ZigbeeColor.Current.XMOrange,
            TextSize = 14,
        };
        /// <summary>
        /// 底部圆角中的标题栏下的线条
        /// </summary>
        public Button line = new Button()
        {
            Y = Application.GetRealHeight(138),
@@ -66,15 +80,8 @@
        #endregion
        /// <summary>
        /// ◆ 中部刷新布局__________________________
        /// </summary>
        //public VerticalRefreshLayout midVerticalScrolViewLayout = new VerticalRefreshLayout()
        //{
        //};
        /// <summary>
        /// ◆ 标题栏布局__________________________
        /// 标题栏布局
        /// </summary>
        public FrameLayout titleFrameLayout = new FrameLayout
        {
@@ -139,6 +146,7 @@
            topFrameLayout.AddChidren(btnBackFrameLayout);
            topFrameLayout.AddChidren(titleFrameLayout);
            topFrameLayout.AddChidren(btnTitleLine);
            var title = new Button()
            {
                TextAlignment = TextAlignment.CenterLeft,
@@ -363,43 +371,20 @@
                //使用确认型弹框时,的回调函数
                alertRemoteUnlockRequest.ConfirmClickEvent += () =>
                {
                    if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                    var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                    Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                    Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                    functionSetting.Show();
                    functionSetting.devicNameAction += (deviceRename) =>
                    {
                        var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                        Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                        functionSetting.Show();
                        functionSetting.devicNameAction += (deviceRename) =>
                        if (!string.IsNullOrEmpty(deviceRename))
                        {
                            if (!string.IsNullOrEmpty(deviceRename))
                            if (btnDoorLockTitle != null)
                            {
                                if (btnDoorLockTitle != null)
                                {
                                    btnDoorLockTitle.Text = deviceRename;
                                }
                                btnDoorLockTitle.Text = deviceRename;
                            }
                        };
                    }
                    else
                    {
                        var functionSettingSub = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
                        Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSettingSub);
                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                        functionSettingSub.Show();
                        functionSettingSub.devicNameAction += (deviceRename) =>
                        {
                            if (!string.IsNullOrEmpty(deviceRename))
                            {
                                if (!string.IsNullOrEmpty(deviceRename))
                                {
                                    if (btnDoorLockTitle != null)
                                    {
                                        btnDoorLockTitle.Text = deviceRename;
                                    }
                                }
                            }
                        };
                    }
                        }
                    };
                };
                return;
            }
@@ -534,43 +519,20 @@
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.DoorlockPasswordDispear), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
                                        CommonPage.Loading.Hide();
                                        doorLock.RemoteUnlockPassword = "";
                                        if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                                        var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                                        Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                        functionSetting.Show();
                                        functionSetting.devicNameAction += (deviceRename) =>
                                        {
                                            var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                                            Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
                                            Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                            functionSetting.Show();
                                            functionSetting.devicNameAction += (deviceRename) =>
                                            if (!string.IsNullOrEmpty(deviceRename))
                                            {
                                                if (!string.IsNullOrEmpty(deviceRename))
                                                if (btnDoorLockTitle != null)
                                                {
                                                    if (btnDoorLockTitle != null)
                                                    {
                                                        btnDoorLockTitle.Text = deviceRename;
                                                    }
                                                    btnDoorLockTitle.Text = deviceRename;
                                                }
                                            };
                                        }
                                        else
                                        {
                                            var functionSettingSub = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
                                            Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSettingSub);
                                            Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                            functionSettingSub.Show();
                                            functionSettingSub.devicNameAction += (deviceRename) =>
                                            {
                                                if (!string.IsNullOrEmpty(deviceRename))
                                                {
                                                    if (!string.IsNullOrEmpty(deviceRename))
                                                    {
                                                        if (btnDoorLockTitle != null)
                                                        {
                                                            btnDoorLockTitle.Text = deviceRename;
                                                        }
                                                    }
                                                }
                                            };
                                        }
                                            }
                                        };
                                    });
                                }
                            }
@@ -613,5 +575,56 @@
        }
        // 获取到到名称更改回调通知
        public Action<string> devicNameSecAction;
        /// <summary>
        /// 当前选中的开锁方式
        /// </summary>
        /// <param name="btnAllMethod"></param>
        /// <param name="btnMethodText"></param>
        /// <param name="oldbutton"></param>
        /// <param name="oldbuttonText"></param>
        public void CurrentSelectUnlockMethod(Button btnAllMethod, Button btnMethodText, Button oldbutton, Button oldbuttonText)
        {
            btnAllMethod.IsSelected = true;
            btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
            btnMethodText.IsBold = true;
            oldbutton = btnAllMethod;
            oldbuttonText = btnMethodText;
        }
        /// <summary>
        /// 显示所有开锁方式的数据
        /// </summary>
        /// <param name="curIndex"></param>
        /// <param name="btnAllMethod"></param>
        /// <param name="btnMethodText"></param>
        public void DisplayAllUnlockMethod(int curIndex, Button btnAllMethod, Button btnMethodText)
        {
            switch (curIndex)
            {
                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;
            }
        }
    }
}