From d53e6af2c5f17838fa79659614b15a2a1f383399 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 31 三月 2023 10:04:58 +0800 Subject: [PATCH] 1 --- Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs index cf19b50..1aa6388 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs @@ -364,7 +364,7 @@ deviceRow.AddChidren (btnEdit); btnEdit.MouseUpEventHandler += (sd, ds) => { Dialog dialog = new Dialog (); - + //淇敼璁惧澶囨敞 var dialogView = new FrameLayout () { Gravity = Gravity.Center, Width = Application.GetRealWidth (500), @@ -442,6 +442,21 @@ return; } + //淇敼浜戠澶囨敞 + var cloudDataLoop = CommonConfig.Current.FunctionList.Find ((obj) => obj.bus.SubnetID == commonDevice.SubnetID + && obj.bus.DeviceID == commonDevice.DeviceID && obj.bus.LoopId == commonDevice.LoopID); + if (cloudDataLoop == null) { + new Alert (Language.StringByID (R.MyInternationalizationString.Tip), "Data is not synchronized to the cloud.", Language.StringByID (R.MyInternationalizationString.Close)).Show (); + } else { + new System.Threading.Thread (() => { + var http = new HttpServerRequest (); + var pack = http.EditDeviceName (cloudDataLoop.deviceId, UserConfig.Instance.CurrentRegion.Id, remakeStr); + if (pack.Code != "0") { + new Alert (Language.StringByID (R.MyInternationalizationString.Tip), $"Cloud data modification failed({pack.Code}).", Language.StringByID (R.MyInternationalizationString.Close)).Show (); + } + }) { IsBackground = true }.Start (); + } + MainPage.Loading.Start (); //byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (etDeviceName.Text.Trim ()); System.Threading.Tasks.Task.Run (() => { -- Gitblit v1.8.0