From b02e8275a21dc06bf54b66273485d44e007a2616 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 20 七月 2020 14:50:17 +0800
Subject: [PATCH] 新代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs |  210 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 205 insertions(+), 5 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
index e96f1f3..b25f90f 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
+++ b/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;
+        }
     }
 }

--
Gitblit v1.8.0