From 6d73bf6e816570291865674bef8bce8972e4de3f Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 01 十二月 2021 16:32:57 +0800
Subject: [PATCH] 2021-12-01-01

---
 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs |   42 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
index c7da6e2..68ac66b 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
@@ -49,10 +49,9 @@
             new System.Threading.Thread(() => {
                 try
                 {
-                    var pm = new DAL.Server.HttpServerRequest();
-                    //var result = pm.Get3tyBindBrandList
+                    var pm = new HttpServerRequest();
                     var pack = pm.Get3TyBrandDeviceList(brand.productPlatform, brand.productBrand);
-                    if (pack.Code == DAL.Server.StateCode.SUCCESS)
+                    if (pack.Code == StateCode.SUCCESS)
                     {
                         var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString());
                         Application.RunOnMainThread(() =>
@@ -71,7 +70,14 @@
                 }
                 finally
                 {
-                    Application.RunOnMainThread(() => { waitPage.Hide(); });
+                    Application.RunOnMainThread(() =>
+                    {
+                        if (waitPage != null)
+                        {
+                            waitPage.RemoveFromParent();
+                            waitPage = null;
+                        }
+                    });
                 }
             })
             { IsBackground = true }.Start();
@@ -113,7 +119,7 @@
                     Width = Application.GetRealWidth(32),
                     Height = Application.GetRealWidth(32),
                     Radius = (uint)Application.GetRealWidth(4),
-                    UnSelectedImagePath = $"FunctionIcon/Icon/{device.spk.Replace(".","")}.png",
+                    UnSelectedImagePath =  $"FunctionIcon/Icon/{device.IconName}.png",
                 };
                 row.AddChidren(btnIcon);
                 Button btnRight = new Button()
@@ -147,6 +153,32 @@
                                 refreshView.BeginHeaderRefreshing();
                             }; 
                             break;
+                        case SPK.SenesorMegahealth:
+                        case SPK.SenesorMegahealth2:
+                            var form1 = new AddSenesorMegahealthDirection1Page();
+                            form1.AddForm(device);
+                            form1.AddDeviceEvent = (functionObj) => {
+                                refreshView.BeginHeaderRefreshing();
+                                this.RemoveFromParent();
+                            };
+                            break;
+                        case SPK.SensorEnvironment:
+                            var form2 = new AddSensorEnvironmentPage();
+                            form2.AddForm(device);
+                            form2.AddDeviceEvent = (functionObj) => {
+                                refreshView.BeginHeaderRefreshing();
+                                this.RemoveFromParent();
+                            };
+                            break;
+                        case SPK.SensorEnvironment2:
+                        case SPK.SensorEnvironment3:
+                            var form3 = new AddQingpingSensorEnvirTipPage();
+                            form3.AddForm(device);
+                            form3.AddDeviceEvent = (functionObj) => {
+                                refreshView.BeginHeaderRefreshing();
+                                this.RemoveFromParent();
+                            };
+                            break;
                     }
                 };
             }

--
Gitblit v1.8.0