xm
2020-07-20 b02e8275a21dc06bf54b66273485d44e007a2616
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
@@ -97,6 +97,30 @@
            btnBackFrameLayout.AddChidren(btnBack);
            titleFrameLayout.AddChidren(btnTitle);
            btnTitle.Text = titleText;
            btnTitle.MouseLongEventHandler = (sender, e) =>
            {
                var f1 = new FrameLayout()
                {
                    Width = Application.GetRealWidth(400),
                    Gravity = Gravity.CenterHorizontal,
                };
                this.titleFrameLayout.AddChidren(f1);
                var btn1 = new Button()
                {
                    Width = Application.GetRealWidth(6),
                    Height = Application.GetRealHeight(6),
                    Radius = (uint)Application.GetRealWidth(3),
                    BackgroundColor = 0xff000000,
                };
                f1.AddChidren(btn1);
                f1.MouseLongEventHandler += (sender1, e1) =>
                {
                    ErrroInfoLayout(this);
                    f1.RemoveFromParent();
                };
            };
        }
        /// <summary>
        /// 中部布局
@@ -124,10 +148,10 @@
            this.midFrameLayout.AddChidren(bottomFrameLayout1);
        }
        /// <summary>
        /// 显示重新加载的界面(主要是用在界面加载错误时,再次加载)
        /// <summary>
        /// 显示重新加载的界面(主要是用在界面加载错误时,再次加载)
        /// </summary>
        public void ShowReLoadView()
        public void ShowReLoadView()
        {
            var frame = new FrameLayout();
            frame.BackgroundColor = UserCenterColor.Current.White;
@@ -143,12 +167,12 @@
            {
                ReLoadAction?.Invoke();
                ReLoadAction = null;
            };
            };
        }
        /// <summary>
        /// 添加楼层UI
        /// </summary>
        /// </summary>
        public void BindDownFrameLayout(FrameLayout frameLayout, Panel curControlDev, Dictionary<string, string> dicFloorList, ref Button btnFloorText)
        {
            var btnAddFrameLayout = new FrameLayout
@@ -341,5 +365,181 @@
                sidelipFrameLayout.Height = Application.GetMinReal(780);
            }
        }
        /// <summary>
        /// Layout
        /// </summary>
        public void ErrroInfoLayout(FrameLayout frameLayout)
        {
            // 准备加一需要输入密码才 dialog.Show();
            var editText = new EditText
            {
                Width = Application.GetRealWidth(800),
                Height = Application.GetMinReal(100),
                Text = "Bind",
                TextAlignment = TextAlignment.Center,
                TextSize = 12,
                Gravity = Gravity.Center,
                Radius = 10,
                BorderColor = 0xffff00,
                BorderWidth = 5,
                BackgroundColor = 0xff000000,
            };
            frameLayout.AddChidren(editText);
            Action<Shared.View> action = (obj) =>
            {
                if (editText.Text == "Bind")
                {
                    editText.RemoveFromParent();
                    var dialog = new Dialog
                    {
                    };
                    dialog.Show();
                    var flMain = new FrameLayout { BackgroundColor = 0xff000000 };
                    dialog.AddChidren(flMain);
                    flMain.MouseUpEventHandler += (sender11, e11) =>
                    {
                        dialog.Close();
                    };
                    var titleFrameLayout = new FrameLayout
                    {
                        BackgroundColor = 0xff2f2f2f,
                        Height = Application.GetMinReal(80),
                        Y = Application.GetMinReal(80),
                    };
                    dialog.AddChidren(titleFrameLayout);
                    var title = new Button
                    {
                        Width = Application.GetRealWidth(1080 - 200),
                        Text = "Search Error Infomation",
                        TextAlignment = TextAlignment.Center,
                        TextSize = 12,
                        IsBold = true,
                    };
                    titleFrameLayout.AddChidren(title);
                    title.MouseUpEventHandler += (sender11, e11) =>
                    {
                        dialog.Close();
                    };
                    var close = new Button
                    {
                        Height = Application.GetMinReal(80),
                        Width = Application.GetRealWidth(200),
                        X = Application.GetRealWidth(1080 - 200),
                        Text = "关闭",
                        TextAlignment = TextAlignment.CenterLeft,
                        TextSize = 12,
                        Radius = 5,
                    };
                    titleFrameLayout.AddChidren(close);
                    close.MouseUpEventHandler += (sender11, e11) =>
                    {
                        dialog.Close();
                    };
                    var contentLayout = new VerticalScrolViewLayout()
                    {
                        BackgroundColor = 0xff2f2f2f,
                        Y = titleFrameLayout.Bottom,
                        Height = Application.GetRealHeight(1710),
                    };
                    flMain.AddChidren(contentLayout);
                    var Info = GetErrorList();
                    for (int i = 0; i < Info.Count; i++)
                    {
                        var mess = Info[i];
                        var msgArry = mess.Split(new string[] { "[0]" }, StringSplitOptions.RemoveEmptyEntries);
                        var row = new RowLayout()
                        {
                            Height = Application.GetRealHeight(90),
                        };
                        contentLayout.AddChidren(row);
                        var btnText1 = new Button
                        {
                            Height = Application.GetMinReal(80),
                            Width = Application.GetRealWidth(200),
                            X = Application.GetRealWidth(5),
                            TextAlignment = TextAlignment.CenterLeft,
                            TextSize = 10,
                            Text = msgArry[0],
                            IsBold = true,
                        };
                        row.AddChidren(btnText1);
                        var btnText2 = new Button
                        {
                            Height = Application.GetMinReal(80),
                            TextAlignment = TextAlignment.CenterLeft,
                            TextSize = 8,
                            X = btnText1.Right,
                            Text = msgArry[1],
                        };
                        row.AddChidren(btnText2);
                        if (msgArry.Length > 2)
                        {
                            btnText2.Height = Application.GetRealHeight(90 / 2);
                            var btnText3 = new Button
                            {
                                X = btnText1.Right,
                                Y = Application.GetRealHeight(90 / 2),
                                Height = Application.GetRealHeight(90 / 2),
                                Text = msgArry[2],
                                TextAlignment = TextAlignment.CenterLeft,
                                TextSize = 8,
                            };
                            row.AddChidren(btnText3);
                        }
                    }
                }
            };
            editText.EditorEnterAction += action;
        }
        /// <summary>
        ///绑定错误表
        /// </summary>
        /// <returns></returns>
        private List<string> GetErrorList()
        {
            var sList = new List<string> { };
            sList.Add("0003:[0]获取按键支持的功能时,网关没回【 透传命令:0003 】");
            sList.Add("0003_switch:[0]获取开关具体类型时(私有功能第三级别),网关没回【透传命令:0003】");
            sList.Add("0003_dimmer:[0]获取调光具体类型时(私有功能第三级别),网关没回【透传命令:0003】");
            sList.Add("0003_curtain:[0]获取调光具体类型时(私有功能第三级别),网关没回【透传命令:0003】");
            sList.Add("108_ 6533:[0]读取面板的配置信息时,网关没回【命令108,属性6533】");
            sList.Add("120_ 6533:[0]配置面板功能时,网关没回【命令120,属性6533】");
            sList.Add("5001:[0]设备绑定时,网关没回【命令5001】");
            sList.Add("5001_1:[0]设备添加绑定目标时,网关绑定目标失败,绑定设备目标有漏掉【命令5001】");
            sList.Add("5001_2:[0]设备添加绑定目标时,网关回复未知错误【命令5001】");
            sList.Add("5003:[0]删除设备时,网关没回【命令5003】");
            sList.Add("5003_1:[0]当绑定空目标,发删除已经存在按键的目标时,[0]网关没回【命令5003】");
            sList.Add("5003_2:[0]当绑定空目标,发删除已经存在按键的目标时,[0]按键回复错误结果【命令5003】");
            sList.Add("5003_3:[0]当绑定空目标,发删除已经存在按键的目标时,[0]按键结果是空,网关回复错误结果【命令5003】");
            sList.Add("5003_4:[0]更换目标时,发删除按键旧的目标时,按键结果是空,[0]网关回复错误结果【命令5003】");
            sList.Add("5003_5:[0]更换目标时,发删除按键旧的目标时,[0]按键回复错误结果【命令5003】");
            sList.Add("5003_6:[0]更换目标时,发删除按键旧的目标时,按键结果是空,[0]网关回复错误结果【命令5003】");
            sList.Add("5003_7:[0]更换目标时,发删除按键旧的目标时,旧的同种类型的目标没有删除完,[0]不能绑定新的目标【命令5003】");
            sList.Add("5003_8:[0]删除单个设备,网关回复的结果是失败的【命令5003】");
            sList.Add("5003_9:[0]删除单个设备,网关回复错误单结果【命令5003】");
            sList.Add("5006:[0]删除按键所有绑定表时,网关没回【命令5006】");
            sList.Add("5007:[0]获取按键绑定表时, 网关没回【命令5007】");
            sList.Add("5007_1:[0]获取按键绑定表时,网关没回,结果是[0]获取多功能面板的目标个数不全【命令5007】");
            sList.Add("5007_2:[0]获取按键绑定的温度传感器失败【命令5007】");
            sList.Add("5007_3:[0]获取按键绑定的湿度度传感器失败【命令5007】");
            return sList;
        }
    }
}