From 3cebdfad56d78ba04a214fccd1b942a010aeba77 Mon Sep 17 00:00:00 2001
From: tzy <274116637@qq.com>
Date: 星期五, 26 三月 2021 09:42:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/temp-wxr' into dev-tzy

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs |   47 ++++++++++++++++++++++++++---------------------
 1 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs
index 95a465b..74c6a9e 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs
@@ -10,10 +10,9 @@
     {
         public SetPir()
         {
-            Tag = "PirMain";
+            Tag = "PirView";
         }
-
-        public void Show(Action action)
+        public void Show()
         {
             #region 鐣岄潰甯冨眬
             this.BackgroundColor = CSS.CSS_Color.viewMiddle;
@@ -21,7 +20,6 @@
             this.AddChidren(topView.FLayoutView());
             topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
             {
-                action();
                 RemoveFromParent();
             };
             topView.topNameBtn.TextID = StringId.setlogic;
@@ -41,16 +39,22 @@
             editNameFLayout.btnNextIcon.Width = Application.GetRealWidth(28);
             editNameFLayout.btnNextIcon.UnSelectedImagePath = "LogicIcon/editname.png";
             viewLayout.AddChidren(editNameFLayout.FLayoutView());
-            ///鐗堟湰鍗囩骇
-            FrameLayout50 banbenshengjiFL = new FrameLayout50();
-            banbenshengjiFL.btnText.Text = Language.StringByID(StringId.banbenshengji);
-            banbenshengjiFL.frameLayout.Y = editNameFLayout.frameLayout.Bottom;
-            viewLayout.AddChidren(banbenshengjiFL.FLayoutView());
+            /////鐗堟湰鍗囩骇
+            //FrameLayout50 banbenshengjiFL = new FrameLayout50();
+            //banbenshengjiFL.btnText.Text = Language.StringByID(StringId.banbenshengji);
+            //banbenshengjiFL.frameLayout.Y = editNameFLayout.frameLayout.Bottom;
+            //viewLayout.AddChidren(banbenshengjiFL.FLayoutView());
+
+            var versions = Pir.currPir.versions.Find((c)=>c.module== "fw_version");
+            if (versions == null)
+            {
+                versions = new Entity.VersionInfo();
+            }
             ///鐗堟湰鍙�:v1.3.5
             FrameLayout50 banbenhaoFLayout = new FrameLayout50();
             banbenhaoFLayout.btnNextIcon.Visible = false;
-            banbenhaoFLayout.btnText.Text = Language.StringByID(StringId.banbenhao) + ":v1.3.5";
-            banbenhaoFLayout.frameLayout.Y = banbenshengjiFL.frameLayout.Bottom;
+            banbenhaoFLayout.btnText.Text = Language.StringByID(StringId.banbenhao) + ":"+ versions.version;
+            banbenhaoFLayout.frameLayout.Y = editNameFLayout.frameLayout.Bottom;// banbenshengjiFL.frameLayout.Bottom;
             viewLayout.AddChidren(banbenhaoFLayout.FLayoutView());
             //鍒犻櫎
             FrameLayout frameLayout = new FrameLayout
@@ -106,16 +110,8 @@
                             Pir.pirDeviceList.Remove(Pir.currPir);
                         }
                         dialog.Close();
-                        action();
                         this.RemoveFromParent();
-                        for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
-                        {
-                            var view = MainPage.BasePageView.GetChildren(i);
-                            if (view.GetType() == typeof(PirMain))
-                            {
-                                view.RemoveFromParent();
-                            }
-                        }
+                        Method.RemoveView("PirMain");
                     }, "鍒犻櫎", "dialog", null, dialog);
 
                 }, () =>
@@ -129,6 +125,15 @@
             #endregion
 
         }
-
+        /// <summary>
+        /// 绉婚櫎鐣岄潰
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            //鍒锋柊PirMain鐣岄潰
+            Method.RefreshView("PirMain");
+            base.RemoveFromParent();
+          
+        }
     }
 }

--
Gitblit v1.8.0