From 83df0ebfbd306d0fb5a51a21a7ef2271c0c507ec Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 09 三月 2021 19:39:26 +0800
Subject: [PATCH] 2021-3-9-1

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
index 591e56c..1b58afe 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
@@ -11,7 +11,7 @@
         {
             Tag = "PirView";
         }
-        public void Show()
+        public void Show(Action action)
         {
             #region 鐣岄潰甯冨眬
             this.BackgroundColor = CSS.CSS_Color.viewMiddle;
@@ -19,7 +19,10 @@
             topView.topNameBtn.TextID = StringId.shebeigaunli;
             topView.topIconBtn.Visible = true;
             this.AddChidren(topView.FLayoutView());
-            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); };
+            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => {
+                action();
+                this.RemoveFromParent();
+            };
             VerticalRefreshLayout vv = new VerticalRefreshLayout();
             vv.Height = Application.GetRealHeight(667 - 64);
             vv.Y = Application.GetRealHeight(64);
@@ -147,6 +150,7 @@
                     Width = Application.GetRealWidth(8),
                     Height = Application.GetRealWidth(8),
                     UnSelectedImagePath = "PirIcon/online.png",
+                    SelectedImagePath = "PirIcon/offline.png",
                 };
                 devfLayout.AddChidren(stateIconBtn);
                 //绾㈠瀹濈姸鎬侊紙鍦ㄧ嚎-绂荤嚎锛�
@@ -160,9 +164,17 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextSize = TextSize.text12,
                     TextColor = 0xFF67D569,// CSS.CSS_Color.textColor,
+                    SelectedTextColor =CSS.CSS_Color.textRedColor,
                     IsBold = true,
                 };
                 devfLayout.AddChidren(stateTextBtn);
+                if (pirDevice.online) {
+                    stateIconBtn.IsSelected = true;
+                    stateTextBtn.IsSelected = true;
+                } else {
+                    stateIconBtn.IsSelected = false;
+                    stateTextBtn.IsSelected = false;
+                }
                 //绾�
                 Button lineBtn = new Button
                 {
@@ -302,7 +314,11 @@
                                     {
                                         if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                                         {
-                                            pirDevice.FunctioList.Remove(Function);
+                                            var function = pirDevice.FunctioList.Find((c)=>c.sid== Function.sid);
+                                            if (function != null)
+                                            {
+                                                pirDevice.FunctioList.Remove(Function);
+                                            }
                                             UIView(vv);
                                         }
 

--
Gitblit v1.8.0