From a4d0a03f3f87fcb5e4485e98a1f7b1a119c26eab Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期三, 28 四月 2021 11:27:55 +0800 Subject: [PATCH] 121-04-28-2 --- HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs | 64 +++++++++++++++++++------------- 1 files changed, 38 insertions(+), 26 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs index 2967f1e..a7ced2e 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using System.Text; using HDL_ON.Entity; using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; using Shared; @@ -91,12 +92,7 @@ SetPir setPir = new SetPir(); MainPage.BasePageView.AddChidren(setPir); - setPir.Show(() => - { - //BackAction(); - ////鍒锋柊鐣岄潰 - UIView(vv); - }); + setPir.Show(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; ///娣诲姞閬ユ帶鍣ㄥ浘鏍囩偣鍑讳簨浠� @@ -152,8 +148,8 @@ #endregion ///鍒濆鍖栫晫闈� UIView(vv); - } + /// <summary> /// 鍔犺浇UI鐣岄潰 /// </summary> @@ -294,21 +290,28 @@ { //娓呯┖涔嬪墠鏁版嵁 DeviceTypeList.Clear(); - var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); - for (int a = 0; a < jArray.Count; a++) + try { - var jay = jArray[a]; - var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); - var objDeviceType = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceType>(str); - if (objDeviceType != null) + var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); + for (int a = 0; a < jArray.Count; a++) { - if (null == DeviceTypeList.Find((c) => c.id == objDeviceType.id)) + var jay = jArray[a]; + var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); + var objDeviceType = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceType>(str); + if (objDeviceType != null) { - DeviceTypeList.Add(objDeviceType); + if (null == DeviceTypeList.Find((c) => c.id == objDeviceType.id)) + { + DeviceTypeList.Add(objDeviceType); + } } } + action(); } - action(); + catch + { + + } } else { @@ -333,21 +336,31 @@ { //娓呯┖涔嬪墠鏁版嵁 brandList.Clear(); - var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); - for (int a = 0; a < jArray.Count; a++) + try { - var jay = jArray[a]; - var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); - var brand = Newtonsoft.Json.JsonConvert.DeserializeObject<Brand>(str); - if (brand != null) + var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); + for (int a = 0; a < jArray.Count; a++) { - if (null == brandList.Find((c) => c.id == brand.id)) + var jay = jArray[a]; + var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); + var brand = Newtonsoft.Json.JsonConvert.DeserializeObject<Brand>(str); + if (brand != null) { - brandList.Add(brand); + if (null == brandList.Find((c) => c.id == brand.id)) + { + brandList.Add(brand); + } } } } - actionBrand(brandList); + catch { } + finally + { + Application.RunOnMainThread(() => + { + actionBrand(brandList); + }); + } } else { @@ -362,7 +375,6 @@ public override void RemoveFromParent() { BackAction(); - BackAction = null; base.RemoveFromParent(); } -- Gitblit v1.8.0