From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs | 64 +++++++++++++++++++------------- 1 files changed, 38 insertions(+), 26 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs old mode 100755 new mode 100644 index 33feefe..869ac68 --- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs @@ -26,6 +26,7 @@ { #region 鏈�涓婇潰鐨勫竷灞�浠g爜 + UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦 TopView view = new TopView(); this.AddChidren(view.TopRowView()); if (Common.Logic.CurrentLogic.LogicId != 0) @@ -38,7 +39,7 @@ } view.clickBtn.MouseDownEventHandler += (sender, e) => { - + //UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦 RemoveFromParent(); }; #endregion @@ -46,7 +47,7 @@ var middle = new VerticalScrolViewLayout { Y = view.topRowLayout.Bottom, - Height = Application.GetRealHeight(1920 - 184 - 180), + Height = Application.GetRealHeight(Method.H - 184 - 180), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; this.AddChidren(middle); @@ -60,7 +61,7 @@ var iconBtn = new Button { Width = Application.GetRealWidth(936), - Height = Application.GetRealHeight(436), + Height = Application.GetRealWidth(436), X = Application.GetRealWidth(72), Y = Application.GetRealHeight(30), UnSelectedImagePath = $"ZigeeLogic/logicbj{s}.png", @@ -202,6 +203,8 @@ { 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]; switch (Type) @@ -212,7 +215,7 @@ { var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]); selecteddevice.deviceNameBtn.Visible = true; - selecteddevice.deviceNameBtn.Text = deviceinof.DeviceEpointName; + selecteddevice.deviceNameBtn.Text = LocalDevice.Current.GetDeviceEpointName(deviceinof); selecteddevice.regionNameBtn.Visible = true; Method.RoomNmae(selecteddevice.regionNameBtn, deviceinof); selecteddevice.iconBtn.UnSelectedImagePath ="ZigeeLogic/sensor13.png"; @@ -226,11 +229,8 @@ { case 13: { - if (intvalue == "1") - { - selecteddevice.selecetddevicestateBtn.TextID = MyInternationalizationString.someone; - } - else + + if (conditions.ContainsKey("IgnoreTime")) { int minute = int.Parse(conditions["IgnoreTime"]) / 60; int second = int.Parse(conditions["IgnoreTime"]) % 60; @@ -254,6 +254,11 @@ } } + else + { + selecteddevice.selecetddevicestateBtn.TextID = MyInternationalizationString.someone; + } + } break; } @@ -265,31 +270,33 @@ } break; } - + ///缂栬緫 + selecteddevice.edit.Tag = i.ToString(); selecteddevice.edit.MouseUpEventHandler += (sender, e) => { var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]); var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; this.AddChidren(flMain); - CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "condition_mould"); + CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "condition_mould", int.Parse(selecteddevice.edit.Tag.ToString())); }; ///鍒犻櫎鎺т欢 selecteddevice.del.MouseUpEventHandler += (sender, e) => { - var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, + var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(MyInternationalizationString.doyouwanttodelete), Language.StringByID(MyInternationalizationString.confrim)); alert.Show(); alert.ConfirmClickEvent += () => { Common.Logic.CurrentLogic.Conditions.Remove(conditions); - var templatePage = new TemplatePage(); - UserView.HomePage.Instance.AddChidren(templatePage); - UserView.HomePage.Instance.PageIndex += 1; - templatePage.Show(); + selecteddevice.selecetdFrameLayout.RemoveFromParent(); + //var templatePage = new TemplatePage(); + //UserView.HomePage.Instance.AddChidren(templatePage); + //UserView.HomePage.Instance.PageIndex += 1; + //templatePage.Show(); }; }; } @@ -342,6 +349,8 @@ SelectedDeviceView actiondevice = new SelectedDeviceView(); actiondevice.Show(middle); + actiondevice.stateRow.AddRightView(actiondevice.edit); + actiondevice.stateRow.AddRightView(actiondevice.del); var linkType = int.Parse(ListActions[i]["LinkType"].ToString()); var actions = ListActions[i]; @@ -351,7 +360,7 @@ { var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); actiondevice.deviceNameBtn.Visible = true; - actiondevice.deviceNameBtn.Text = deviceinof.DeviceEpointName; + actiondevice.deviceNameBtn.Text = LocalDevice.Current.GetDeviceEpointName(deviceinof); actiondevice.regionNameBtn.Visible = true; Method.RoomNmae(actiondevice.regionNameBtn, deviceinof); switch (deviceinof.Type) @@ -395,28 +404,31 @@ break; } ///缂栬緫 + + actiondevice.edit.Tag = i; actiondevice.edit.MouseUpEventHandler += (sender, e) => { var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; this.AddChidren(flMain); var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); - CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_mould"); + CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_mould",int.Parse(actiondevice.edit.Tag.ToString())); }; ///鍒犻櫎鎺т欢 actiondevice.del.MouseUpEventHandler += (sender, e) => { - var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, + var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, Language.StringByID(MyInternationalizationString.doyouwanttodelete), Language.StringByID(MyInternationalizationString.confrim)); alert.Show(); alert.ConfirmClickEvent += () => { Common.Logic.CurrentLogic.Actions.Remove(actions); - var templatePage = new TemplatePage(); - UserView.HomePage.Instance.AddChidren(templatePage); - UserView.HomePage.Instance.PageIndex += 1; - templatePage.Show(); + actiondevice.selecetdFrameLayout.RemoveFromParent(); + //var templatePage = new TemplatePage(); + //UserView.HomePage.Instance.AddChidren(templatePage); + //UserView.HomePage.Instance.PageIndex += 1; + //templatePage.Show(); }; }; @@ -427,11 +439,11 @@ #region -----姣忓ぉ 璁剧疆鍛ㄦ湡----- - var fraline1 = new FrameLayout + var fraHeight = new FrameLayout { Height = Application.GetRealHeight(30), }; - middle.AddChidren(fraline1); + middle.AddChidren(fraHeight); LogicView.Addview weekview = new LogicView.Addview(); @@ -460,7 +472,7 @@ var cycle = new Cycle(() => { Method.UpdateWeek(weekBtn, Common.Logic.CurrentLogic); }); UserView.HomePage.Instance.AddChidren(cycle); UserView.HomePage.Instance.PageIndex += 1; - cycle.Show(); + cycle.Show(LogicView.IfString._Logic,false); //var cyclicCycle = new CyclicCycle(() => { UpdateWeek(btnweektext); }); //UserView.HomePage.Instance.AddChidren(cyclicCycle); -- Gitblit v1.8.0