From dbc23459fdf4e8b74a5f955fbb9fc631b4babc70 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 17 三月 2021 11:56:16 +0800
Subject: [PATCH] Merge branch 'temp-wxr' into WJC

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs |   37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
index d936aef..a992d58 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs
@@ -23,7 +23,9 @@
             {
                 action();
                 this.RemoveFromParent();
+
             };
+
             VerticalRefreshLayout vv = new VerticalRefreshLayout();
             vv.Height = Application.GetRealHeight(667 - 64);
             vv.Y = Application.GetRealHeight(64);
@@ -45,6 +47,21 @@
             };
             #endregion
             UIView(vv);
+            topView.topIconBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                var form = new AddMiniRemoteControlDirection1Page();
+                form.AddForm();
+                form.AddDeviceEvent += (device) =>
+                {
+                    Pir pir = new Pir();
+                    pir.name = device.name;
+                    pir.deviceId = device.deviceId;
+                    pir.sid = device.sid;
+                    Pir.pirDeviceList.Add(pir);
+                    UIView(vv);
+                };
+
+            };
 
         }
         /// <summary>
@@ -177,9 +194,9 @@
                 if (StringId.xiugaimingzi == intValue)
                 {
                     List<string> list = new List<string>();
-                    for (int b = 0; b < Pir.pirDeviceList.Count; b++)
+                    for (int b = 0; b < PirDevice.Pir.pirDeviceList.Count; b++)
                     {
-                        list.Add(Pir.pirDeviceList[b].name);
+                        list.Add(PirDevice.Pir.pirDeviceList[b].name);
                     }
                     Method methodView = new Method();
                     methodView.EditControlName(StringId.xiugaimingzi, list, pirclick.name, (name, view) =>
@@ -202,12 +219,16 @@
                     TipPopView tipPopView = new TipPopView();
                     tipPopView.TipBox(StringId.tip, text, (dialog) =>
                     {
-
                         Thread(dialog, (responsePackNew) =>
-                        {
-                            dialog.Close();
-                            UIView(vv);
-                        }, "鍒犻櫎", pirclick.deviceId, "");
+                                {
+                                    var pir = Pir.pirDeviceList.Find((c) => c.deviceId == pirclick.deviceId);
+                                    if (pir != null)
+                                    {
+                                        Pir.pirDeviceList.Remove(pirclick);
+                                    }
+                                    dialog.Close();
+                                    UIView(vv);
+                                }, "鍒犻櫎", pirclick.deviceId, "");
                     }, () =>
                     {
                         NewSwitchView(pirclick, vv);
@@ -258,7 +279,7 @@
                         else
                         {
                             Method method = new Method();
-                            method.ErrorShow(responsePackNew);
+                            method.ErrorShow(responsePackNew,"");
                         }
 
                     });

--
Gitblit v1.8.0