From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs |  243 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 234 insertions(+), 9 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
index 5c66c54..881efa8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindCommonLayout.cs
@@ -7,19 +7,19 @@
 {
     public class BindCommonLayout : FrameLayout
     {
-        public BindCommonLayout()
-        {
-
-        }
         #region 鈼� 鍙橀噺鐢虫槑__________________________
         /// <summary>
         /// 妤煎眰鍥炶皟
         /// </summary>
         public Action FloorAction = null;
         /// <summary>
-        /// 閫変腑鐨勬ゼ灞傚洖璋僛
+        /// 閫変腑鐨勬ゼ灞傚洖璋�
         /// </summary>
         public Action<string, Button> ChooseFloorAction = null;
+        /// <summary>
+        ///  閲嶆柊鍔犺浇
+        /// </summary>
+        public Action ReLoadAction = null;
 
         public FrameLayout topFrameLayout = new FrameLayout { Height = Application.GetRealHeight(184), BackgroundColor = ZigbeeColor.Current.XMTopFrameLayout };
         public FrameLayout midFrameLayout = new FrameLayout { Height = Application.GetRealHeight(1925 - 184), BackgroundColor = ZigbeeColor.Current.XMMidFrameLayout };
@@ -93,9 +93,33 @@
             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>
-        /// 闂ㄩ攣涓儴甯冨眬
+        /// 涓儴甯冨眬
         /// </summary>
         /// <param name="frameLayout"></param>
         public void MidFrameLayout(FrameLayout frameLayout)
@@ -106,7 +130,7 @@
         }
 
         /// <summary>
-        /// 闂ㄩ攣搴曢儴甯冨眬
+        /// 搴曢儴甯冨眬
         /// </summary>
         /// <param name="frameLayout"></param>
         public void BottomFrameLayout(FrameLayout frameLayout)
@@ -118,6 +142,28 @@
                 BackgroundColor = ZigbeeColor.Current.XMWhite,
             };
             this.midFrameLayout.AddChidren(bottomFrameLayout1);
+        }
+
+        /// <summary>
+        /// 鏄剧ず閲嶆柊鍔犺浇鐨勭晫闈�(涓昏鏄敤鍦ㄧ晫闈㈠姞杞介敊璇椂锛屽啀娆″姞杞�)
+        /// </summary>
+        public void ShowReLoadView()
+        {
+            var frame = new FrameLayout();
+            frame.BackgroundColor = UserCenterColor.Current.White;
+            frame.Tag = "ReLoadView";
+            this.midFrameLayout.AddChidren(frame);
+
+            //閲嶆柊鍔犺浇
+            var btnReLoad = new BottomClickButton();
+            btnReLoad.Gravity = Gravity.Center;
+            btnReLoad.TextID = R.MyInternationalizationString.uDoReload;
+            frame.AddChidren(btnReLoad);
+            btnReLoad.ButtonClickEvent += (sender, e) =>
+            {
+                ReLoadAction?.Invoke();
+                ReLoadAction = null;
+            };
         }
 
         /// <summary>
@@ -134,7 +180,6 @@
             btnFloorText = new Button
             {
                 Width = Application.GetRealWidth(300 - 69 - 58),
-                Text = Language.StringByID(R.MyInternationalizationString.FirstFloor),
                 TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                 TextSize = 14,
                 IsBold = true,
@@ -316,5 +361,185 @@
                 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銆�");
+            sList.Add("5020:[0]涓�瀵逛竴缁戝畾璁惧鏃�,缃戝叧娌″洖銆愬懡浠�5020銆�");
+            sList.Add("5020_1:[0]涓�瀵逛竴缁戝畾锛岃澶囨坊鍔犵粦瀹氱洰鏍囨椂,[0]缃戝叧缁戝畾鐩爣澶辫触锛岀粦瀹氳澶囦笉瀛樺湪銆愬懡浠�5020銆�");
+            sList.Add("5020_2:[0]涓�瀵逛竴缁戝畾锛岃澶囨坊鍔犵粦瀹氱洰鏍囨椂,缃戝叧缁戝畾鐩爣澶辫触锛孾0]缁戝畾鏈煡锛屽彲鑳芥槸绛夊緟鑺傜偣璁惧鍥炲銆愬懡浠�5020銆�");
+
+            return sList;
+        }
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.8.0