From eed381ca472abb06e386281e604569ebf80bbfe3 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期四, 26 三月 2020 17:51:41 +0800 Subject: [PATCH] 2020-03-26 --- ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs | 98 ++++++++++++++++++------------------------------ 1 files changed, 37 insertions(+), 61 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs index 4d09e94..22f7e6d 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs @@ -23,6 +23,7 @@ { #region View甯冨眬浠g爜 + UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦 TopView view = new TopView(); this.AddChidren(view.TopRowView()); if (Common.Logic.CurrentLogic.LogicId != 0) @@ -35,6 +36,7 @@ } view.clickBtn.MouseDownEventHandler += (sender, e) => { + // UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦 action(); RemoveFromParent(); }; @@ -179,6 +181,9 @@ { SelectedDeviceView selecteddevice = new SelectedDeviceView(); selecteddevice.Show(middle); + selecteddevice.stateRow.AddRightView(selecteddevice.edit); + selecteddevice.stateRow.AddRightView(selecteddevice.del); + var Type = int.Parse(ListConditions[i]["Type"]); var conditions = ListConditions[i]; string name = ""; @@ -445,7 +450,7 @@ { if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"]) { - state = Common.Logic.CurrentLogic.Accounts[a]["Account"]; + state = Common.Logic.CurrentLogic.Accounts[a]["AccountName"]; break; } @@ -679,10 +684,7 @@ addactionview.clickBtn.MouseUpEventHandler+= (sender, e) => { Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim(); - var deviceTarget = new DeviceTarget(); - UserView.HomePage.Instance.AddChidren(deviceTarget); - UserView.HomePage.Instance.PageIndex += 1; - deviceTarget.Show(); + Method.View(IfString.Action_Logic,IfString.Action_LogicScene); }; List<Dictionary<string, object>> ListActions = new List<Dictionary<string, object>>(); @@ -701,10 +703,7 @@ addflview.clickBtn.MouseUpEventHandler += (sender, e) => { Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim(); - var deviceTarget = new DeviceTarget(); - UserView.HomePage.Instance.AddChidren(deviceTarget); - UserView.HomePage.Instance.PageIndex += 1; - deviceTarget.Show(); + Method.View(IfString.Action_Logic, IfString.Action_LogicScene); }; } else @@ -721,13 +720,13 @@ switch (linkType) { case 0: + case 8: { var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); name = deviceinof.DeviceEpointName; actiondevice.regionNameBtn.Visible = true; Method.RoomNmae(actiondevice.regionNameBtn, deviceinof); - switch (deviceinof.Type) { case DeviceType.OnOffOutput: @@ -968,16 +967,28 @@ } } break; - + case DeviceType.DoorLock: + { + //闂ㄩ攣鐗规畩 + icon = "ZigeeLogic/doorlock.png"; + if (actions["PassData"].ToString() == "055704010112") + { + state = Language.StringByID(MyInternationalizationString.logicopen); + } + else + { + state = Language.StringByID(MyInternationalizationString.logicclose); + } + } + break; } - } break; case 2: { - //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙; - var sceneinof = Common.Room.AllRoomSceneUIList.Find((obj) => { return obj.Id.ToString() == actions["DeviceAddr"].ToString(); }); + //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙; + var sceneinof = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString())); //鏈湴娌℃湁瀛樺湪; if (sceneinof == null) { @@ -1006,7 +1017,7 @@ actiondevice.regionNameBtn.Visible = true; /////閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О Common.Room room = new Common.Room(); - actiondevice.regionNameBtn.Text = room.GetRoomNameBySceneId(sceneinof.Id); + actiondevice.regionNameBtn.Text = UserCenter.HdlRoomLogic.Current.GetRoomNameBySceneId(sceneinof.Id); } break; @@ -1052,7 +1063,7 @@ var seconds = delaytimevalue % 60; icon = "ZigeeLogic/delay.png"; - + if (Minutes != 0) { if (seconds == 0) @@ -1073,6 +1084,13 @@ }; break; } + + if (linkType != 2) + { + actiondevice.stateRow.AddRightView(actiondevice.edit); + } + actiondevice.stateRow.AddRightView(actiondevice.del); + if (linkType == 6 || linkType == 7) { actiondevice.ordinaryBtn.Visible = true; @@ -1093,7 +1111,7 @@ { switch (linkType) { - + case 8: case 0: { var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); @@ -1119,6 +1137,7 @@ delayTime.Show(int.Parse(actiondevice.edit.Tag.ToString()), true); } break; + } }; ///鍒犻櫎鎺т欢 @@ -1305,50 +1324,7 @@ }; } - /// <summary> - /// 闂幇寮忔彁绀烘鐨勬柟娉� - /// </summary> - /// <param name="tipText">鎻愮ず鍐呭</param> - /// <param name="second">鍋滅暀鏃堕棿鍗曚綅涓簊</param> - public void TipView(string tipText, int second = 1) - { - - var frameLayout = new FrameLayout { BackgroundColor = 0x50000000 }; - this.AddChidren(frameLayout); - - var btn = new Button - { - Gravity = Gravity.Center, - Text = tipText, - BackgroundColor = 0xff1f1f1f, - Width = Application.GetRealWidth(500), - Height = Application.GetRealHeight(100), - Radius = (uint)Application.GetRealHeight(50), - }; - frameLayout.AddChidren(btn); - - var dateTime1 = DateTime.Now; - new System.Threading.Thread(() => - { - Application.RunOnMainThread(() => - { - while (true) - { - if ((DateTime.Now - dateTime1).TotalMilliseconds > second * 1000) - { - //榛樿涓�绉掑叧闂� - frameLayout.RemoveFromParent(); - break; - } - } - }); - }) - { IsBackground = true }.Start(); - - } - - - + } } -- Gitblit v1.8.0