From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 14 十二月 2020 09:59:01 +0800
Subject: [PATCH] 请合并代码,完成晾衣架最终功能。

---
 ZigbeeApp/Shared/Phone/Device/Logic/OneTimePoint.cs |  106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/OneTimePoint.cs b/ZigbeeApp/Shared/Phone/Device/Logic/OneTimePoint.cs
new file mode 100755
index 0000000..7e6832e
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/OneTimePoint.cs
@@ -0,0 +1,106 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+using Shared.Common;
+using Shared.Phone;
+using Shared.Phone.Device.Logic.LogicView;
+using Shared.R;
+using ZigBee.Device;
+
+namespace Shared.Phone.Device.Logic
+{
+    public class OneTimePoint : FrameLayout
+    {
+        public OneTimePoint()
+        {
+            Tag = "Logic";
+        }
+        
+        public void Show(Action<string> action)
+        {
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.addtime;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => {
+                RemoveFromParent();
+                action("");
+            };
+            #endregion
+
+            var middle = new FrameLayout
+            {
+                Y = view.topRowLayout.Bottom,
+                Height = Application.GetRealHeight(Method.H - 184 - 260),
+                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+            };
+            this.AddChidren(middle);
+            #region   -----绫诲瀷 鏃跺埢 鑷畾涔夋椂闂�
+            TypeView typeView = new TypeView();
+            middle.AddChidren(typeView.Show());
+            typeView.textBtn.TextID = MyInternationalizationString.type;
+            typeView.titleBtn.Width = Application.GetRealWidth(630 + 70);
+            typeView.titleBtn.TextID = MyInternationalizationString.immediateexecution;
+            typeView.backBtn.Visible = false;
+
+            TypeView skView = new TypeView();
+            skView.frameLayout.Y = typeView.frameLayout.Bottom;
+            middle.AddChidren(skView.Show());
+            skView.textBtn.TextID = MyInternationalizationString.moment;
+            skView.backBtn.UnSelectedImagePath = "ZigeeLogic/dropdown.png";
+
+            #endregion
+
+            var rowTimeView = new FrameLayout
+            {
+                Y = skView.frameLayout.Bottom,
+                Height = Application.GetRealHeight(600),
+            };
+            middle.AddChidren(rowTimeView);
+
+            TimeView timeview = new TimeView
+            {
+
+                Height = Application.GetRealHeight(550),
+                BackgroundColor = 0x40ffffff,
+                Width = Application.GetRealWidth(1080),
+            };
+            rowTimeView.AddChidren(timeview);
+
+            //淇濆瓨
+            SaveView saveView = new SaveView();
+            saveView.frameLayout.Y = middle.Bottom;
+            this.AddChidren(saveView.Show());
+            saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                string h = timeview.Hour.ToString();
+                string m = timeview.Minute.ToString();
+                Dictionary<string, string> timeIfon = new Dictionary<string, string>();
+                timeIfon.Add("Type", "0");
+                timeIfon.Add("IsValid", "1");
+                timeIfon.Add("DateType", "0");
+                timeIfon.Add("RemindTime", "0");
+                timeIfon.Add("EnDelay", "0");
+                timeIfon.Add("DelayTime", "0");
+                timeIfon.Add("DoorLockOpenDelayTime", "0");
+                timeIfon.Add("StartHour", h);
+                timeIfon.Add("StartMin", m);
+                for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++)
+                {
+                    if (Common.Logic.CurrentLogic.Conditions[i]["Type"] == "0")
+                    {
+                        Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
+                        Common.Logic.CurrentLogic.Conditions.Insert(i, timeIfon);
+                        break;
+                    }
+                }
+                string s = h + ":" + (m.Length < 2 ? "0" + m : m);
+                this.RemoveFromParent();
+                action(s);
+            };
+
+        }
+
+    }
+}
+

--
Gitblit v1.8.0