From 7286553a34ce9b9cc45c3f6786eff7cd5c086146 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 28 一月 2021 19:11:54 +0800 Subject: [PATCH] 2021-01-28 1.增加设备列表获取方法。2.增加oid和sid上传方法。 --- Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs | 77 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 77 insertions(+), 0 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs index 1d1ef14..0f26cac 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs @@ -1,6 +1,7 @@ 锘縰sing System; using System.Collections.Generic; using Shared.SimpleControl.Phone.Music; +using SmartHome; namespace Shared.SimpleControl.Phone { @@ -139,6 +140,13 @@ }; msgView.AddChidren (btnMail2); + btnMail2.MouseUpEventHandler += (e, e2) => { +#if DEBUG + GetDeviceList (); +#endif + + }; + var btnFAQ = new Button () { Height = Application.GetRealHeight(100), Y = msgView.Bottom + Application.GetRealHeight(20), @@ -150,6 +158,15 @@ }; AddChidren (btnFAQ); + btnFAQ.MouseUpEventHandler += (e,e2) =>{ +#if DEBUG + + + upload (); + +#endif + + }; var btnLine = new Button () { @@ -160,5 +177,65 @@ AddChidren (btnLine); } + + /// <summary> + /// + /// </summary> + void upload () + { + + MainPage.Loading.Start (Language.StringByID (R.MyInternationalizationString.load)); + System.Threading.Tasks.Task.Run (() => { + try { + var RES = HDLLinkUtlis.Current.UploadOidAndSidList (); + Application.RunOnMainThread (() => { + if (RES) { + Utlis.ShowTip ("涓婁紶鎴愬姛"); + } else { + Utlis.ShowTip ("涓婁紶澶辫触"); + } + }); + } catch { + MainPage.FailureToServer (); + } finally { + Application.RunOnMainThread (() => { + MainPage.Loading.Hide (); + }); + } + }); + } + + + /// <summary> + /// + /// </summary> + void GetDeviceList () + { + MainPage.Loading.Start (Language.StringByID (R.MyInternationalizationString.load)); + System.Threading.Tasks.Task.Run (() => { + try { + var deviceResult = HttpServerRequest.Current.GetDeviceList (); + + if (deviceResult.Code == StateCode.SUCCESS) { + var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieFunctionRes> (deviceResult.Data.ToString ()); + + Utlis.WriteLine ("deviceList Count" + deviceList.list.Count); + } else { + Utlis.ShowTip ("璁惧鍒楄〃"); + } + + //Application.RunOnMainThread (() => { + + //}); + } catch { + MainPage.FailureToServer (); + } finally { + Application.RunOnMainThread (() => { + MainPage.Loading.Hide (); + }); + } + }); + } + } } -- Gitblit v1.8.0