From fe2b566c8d9c097d2568ad211088fa5bc6f8c229 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期二, 23 三月 2021 13:48:25 +0800 Subject: [PATCH] 2.增加住宅绑定网关判断,没有绑定网关的住宅,ON+不再显示 --- HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs | 79 ++++++++++++++++----------------------- 1 files changed, 32 insertions(+), 47 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs index 82105bf..2b35cc8 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs @@ -90,13 +90,13 @@ this.AddChidren(namePatchView.FLayoutView()); namePatchView.btnText1.TextID = StringId.yaokongqimingcheng; namePatchView.btnText2.Text = control.name; - + //鎵�灞炲尯鍩� View.PatchView quyuPatchView = new View.PatchView(); quyuPatchView.frameLayout.Y = namePatchView.frameLayout.Bottom; this.AddChidren(quyuPatchView.FLayoutView()); quyuPatchView.btnText1.TextID = StringId.suoshuquyu; - quyuPatchView.btnText2.Text=Intelligence.Automation.LogicMethod.GetGetRoomName(function); + quyuPatchView.btnText2.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(function); //缁х画娣诲姞 Button addBtn = new Button @@ -118,53 +118,24 @@ #endregion #region 鐣岄潰鐐瑰嚮浜嬩欢 //閬ユ帶鍣ㄥ悕绉扮偣鍑讳簨浠� - namePatchView.btnClick.MouseUpEventHandler += (sender, e) => { + namePatchView.btnClick.MouseUpEventHandler += (sender, e) => + { List<string> list = new List<string>(); - - for (int i = 0; i < PirDevice.Pir.currPir.FunctioList.Count; i++) + for (int i = 0; i < Pir.currPir.FunctioList.Count; i++) { - list.Add(PirDevice.Pir.currPir.FunctioList[i].name); + list.Add(Pir.currPir.FunctioList[i].name); } Method method = new Method(); - method.EditControlName(StringId.editName, list, control.name, (name, view) => + method.EditControlName(StringId.editName, list, control.name, (name, dialog) => { - //鍔犺浇log - Loading loading = new Loading(); - view.AddChidren(loading); - HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; - loading.Start(); - new System.Threading.Thread(() => + Method.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => { - try - { - responsePackNew = PirSend.DeviceRename(control.deviceId, control.name); - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - loading.Hide(); - if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") - { - view.Close(); - namePatchView.btnText2.Text = name; - function.name = name; - } - else - { - Method methodError = new Method(); - methodError.ErrorShow(responsePackNew, ""); - } + dialog.Close(); + namePatchView.btnText2.Text = name; + function.name = name; - }); - } - - }) - { IsBackground = true }.Start(); - - + }, "淇敼鍚嶇О", "dialog", null, dialog); }, () => { }); }; //鎵�灞炲尯鍩熺偣鍑讳簨浠� @@ -183,11 +154,13 @@ if (bool_library) { this.RemoveFromParent(); + RefreshView(); } else { Method method = new Method(); - method.AddControl(this, (controlDevice) => { + method.AddControl(this, (controlDevice) => + { AddButton addButton = new AddButton(); MainPage.BasePageView.AddChidren(addButton); addButton.Show(controlDevice); @@ -198,14 +171,26 @@ //瀹屾垚鐐瑰嚮浜嬩欢 saveView.btnClick.MouseUpEventHandler += (sender, e) => { - //鍓嶉潰鐣岄潰 - // this.RemoveFromParent(); + //绉婚櫎鎵�鏈夌晫闈� MainPage.BasePageView.RemoveViewByTag("PirView"); - //涓荤晫闈� - //MainPage.BasePageView.RemoveViewByTag("PirMain"); - + RefreshView(); + }; #endregion } + /// <summary> + /// 鍒锋柊绾㈠瀹濅富鐣岄潰 + /// </summary> + void RefreshView() + { + + //绉婚櫎绾㈠瀹濇牴鐣岄潰 + MainPage.BasePageView.RemoveViewByTag("PirMain"); + //閲嶆柊鍔犺浇鐣岄潰 + var page = new PirMain(); + MainPage.BasePageView.AddChidren(page); + page.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } } } -- Gitblit v1.8.0