From 94bed925cf453e148bc5a7556a8a86e0bcb9ad6c Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 24 三月 2021 14:11:16 +0800
Subject: [PATCH] Merge branch 'WJC' into temp-wxr

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
index 8f38cfb..c1169c5 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -14,7 +14,11 @@
         /// <summary>
         /// 鍥炶皟
         /// </summary>
-        public Action BackAction;
+        public static Action BackAction;
+        /// <summary>
+        /// 
+        /// </summary>
+        Button addDevice;
         /// <summary>
         /// 涓存椂鍌ㄥ瓨璁惧绫诲瀷鍒楄〃
         /// </summary>
@@ -26,9 +30,11 @@
             topView.topNameBtn.TextID = StringId.hongwaiyaokong;
             topView.topIconBtn.Visible = true;
             this.AddChidren(topView.FLayoutView());
-            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => {
-                BackAction();
-                this.RemoveFromParent(); };
+            topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
+            {
+               
+                RemoveFromParent();
+            };
 
             FrameLayout middFLayout = new FrameLayout();
             middFLayout.Y = Application.GetRealHeight(64);
@@ -38,19 +44,22 @@
             VerticalRefreshLayout vv = new VerticalRefreshLayout();
             middFLayout.AddChidren(vv);
             //鍔犲彿鍥炬爣
-            Button addDevice = new Button
+            addDevice = new Button
             {
                 Y = Application.GetRealHeight(480),
                 X = Application.GetRealWidth(293),
                 Width = Application.GetRealWidth(82),
                 Height = Application.GetRealWidth(84),
                 UnSelectedImagePath = "PirIcon/add.png",
-            };
+                Visible=false,
 
+            };
+            middFLayout.AddChidren(addDevice);
             if (Pir.currPir.FunctioList.Count < 10)
             {
                 //10涓仴鎺у櫒灏变細闅愯棌娣诲姞鍥炬爣
-                middFLayout.AddChidren(addDevice);
+                // middFLayout.AddChidren(addDevice);
+                addDevice.Visible = true;
             }
 
             vv.BeginHeaderRefreshingAction += () =>
@@ -77,7 +86,7 @@
                 MainPage.BasePageView.AddChidren(setPir);
                 setPir.Show(() =>
                 {
-                    BackAction();
+                    //BackAction();
                     ////鍒锋柊鐣岄潰
                     UIView(vv);
                 });
@@ -267,7 +276,12 @@
                                 Pir.currPir.FunctioList.Remove(Function);
                             }
                             UIView(vv);
-
+                            if (Pir.currPir.FunctioList.Count < 10)
+                            {
+                                //10涓仴鎺у櫒灏变細闅愯棌娣诲姞鍥炬爣
+                                // middFLayout.AddChidren(addDevice);
+                                addDevice.Visible = true;
+                            }
                         }, "鍒犻櫎", "dialog", null, dialog);
 
                     }, () => { }, false);
@@ -504,7 +518,15 @@
                 }
             }, id, "鍝佺墝鍒楄〃");
         }
-
+        /// <summary>
+        /// 绉婚櫎鐣岄潰
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            BackAction();
+            BackAction = null;
+            base.RemoveFromParent();
+        }
 
     }
 

--
Gitblit v1.8.0