From bbcd6c2017762f9a0e6cf0ac6466bbf78f593b14 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 19 四月 2021 09:36:40 +0800
Subject: [PATCH] Merge branch 'wxr4' into temp-wxr

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs |  112 +++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 90 insertions(+), 22 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
index 9e17a7a..757f209 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
@@ -111,26 +111,37 @@
             #region  鎵ц鎺ㄩ�� 鍙戦�侀�氱煡
             ///涓婁笅闂撮殧12鍍忕礌
             viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) });
-            /////鎵ц鎺ㄩ�乮ew
-            //LogicView.LogicTypeTitleView push = new LogicView.LogicTypeTitleView();
-            //push.frameLayout.Height = Application.GetRealHeight(50);
-            //push.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
-            //push.btnText.TextID = StringId.push;
-            //push.btnNextIcon.Width = Application.GetMinRealAverage(36);
-            //push.btnNextIcon.Height = Application.GetMinRealAverage(36);
-            //push.btnNextIcon.X = Application.GetRealWidth(305);
-            //push.btnNextIcon.UnSelectedImagePath = "LogicIcon/off.png";
-            //push.btnNextIcon.SelectedImagePath = "LogicIcon/on.png";
-            //viewLayout.AddChidren(push.FLayoutView());
-            /////鍙戦�侀�氱煡View        
-            //LogicView.LogicTypeTitleView notification = new LogicView.LogicTypeTitleView();
-            //notification.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
-            //notification.btnText.TextID = StringId.notification;
-            //viewLayout.AddChidren(notification.FLayoutView());
-            /////涓婁笅闂撮殧62鍍忕礌
-            //viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(62) });
+            ///鎵ц鎺ㄩ�乮ew
+            LogicView.LogicTypeTitleView push = new LogicView.LogicTypeTitleView();
+            push.frameLayout.Height = Application.GetRealHeight(50);
+            push.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            push.btnText.TextID = StringId.push;
+            push.btnNextIcon.Width = Application.GetRealWidth(36);
+            push.btnNextIcon.Height = Application.GetRealWidth(36);
+            push.btnNextIcon.X = Application.GetRealWidth(305);
+            push.btnNextIcon.UnSelectedImagePath = "LogicIcon/off.png";
+            push.btnNextIcon.SelectedImagePath = "LogicIcon/on.png";
+            push.btnClick.Width = Application.GetRealWidth(305);
+            viewLayout.AddChidren(push.FLayoutView());
+            ///鍙戦�侀�氱煡View        
+            LogicView.LogicTypeTitleView notification = new LogicView.LogicTypeTitleView();
+            notification.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
+            notification.btnText.TextID = StringId.notification;
+            notification.btnLine.BackgroundColor = CSS.CSS_Color.textWhiteColor;
+            viewLayout.AddChidren(notification.FLayoutView());
+           
+            if (Logic.currlogic.pushConfigs.Count > 0)
+            {
+                push.btnNextIcon.IsSelected = true;
+            }
+            else
+            {
+                push.btnNextIcon.IsSelected = false;
+            }
+            ///涓婁笅闂撮殧62鍍忕礌
+            viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(40) });
             #endregion
-
+           
             #region  淇濆瓨
             ///淇濆瓨View
             LogicView.SaveView saveView = new LogicView.SaveView();
@@ -176,6 +187,63 @@
             {
                 DateMethod(cyclicTitle.btnText);
             };
+            ///鏄惁瑕佹帹閫佺偣鍑讳簨浠�
+            //鍒濆鍖栧璞�
+            PushConfigs pushConfigs = new PushConfigs();
+            if (Logic.currlogic.pushConfigs.Count > 0)
+            {
+                pushConfigs = Logic.currlogic.pushConfigs[0];
+            }
+            else
+            {
+                if (!string.IsNullOrEmpty(UserInfo.Current.userMobileInfo))
+                {
+                    //榛樿鎺ㄩ�佸綋鍓嶈处鍙�
+                    pushConfigs.pushTarget.Add(UserInfo.Current.userMobileInfo);
+                }
+                else
+                {
+                    //榛樿鎺ㄩ�佸綋鍓嶈处鍙�
+                    pushConfigs.pushTarget.Add(UserInfo.Current.userEmailInfo);
+                }
+            }
+            push.btnNextIcon.MouseUpEventHandler += (sender, e) =>
+            {
+               push.btnNextIcon.IsSelected = !push.btnNextIcon.IsSelected;
+                if (push.btnNextIcon.IsSelected)
+                {
+                    if (Logic.currlogic.pushConfigs.Count > 0)
+                    {
+                        //娓呯┖涔嬪墠鏃ч厤缃暟鎹�
+                        Logic.currlogic.pushConfigs.Clear();
+                    }
+                    //澧炲姞閰嶇疆鏁版嵁
+                    Logic.currlogic.pushConfigs.Add(pushConfigs);
+                }
+                else
+                {
+                    if (Logic.currlogic.pushConfigs.Count > 0)
+                    {
+                        //榛樿鍙栫涓�涓祴鍊�
+                        pushConfigs = Logic.currlogic.pushConfigs[0];
+                        //娓呯┖閰嶇疆鏁版嵁
+                        Logic.currlogic.pushConfigs.Clear();
+                    }
+                }
+            };
+            ///杈撳叆鎺ㄩ�佹枃鏈�
+            notification.btnClick.MouseUpEventHandler += (sender, e) =>
+            {
+                InputPushText inputPushText = new InputPushText();
+                MainPage.BasePageView.AddChidren(inputPushText);
+                inputPushText.Show(pushConfigs);
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                inputPushText.action += (pushConfigsIfon) =>
+                {
+                    //璧嬪��
+                    pushConfigs = pushConfigsIfon;
+                };
+            };
             ///淇濆瓨鐐瑰嚮浜嬩欢
             saveView.btnClick.MouseUpEventHandler += (sender, e) =>
             {
@@ -204,7 +272,8 @@
                     {
                         list.Add(logic.name);
                     }
-                    new LogicView.TipPopView().InputBox(StringId.editName, InpOrOutLogicMethod.GetLogicName(Logic.currlogic), StringId.nameNull, StringId.NameAlreadyExists, list, (logicName) =>
+                    new LogicView.TipPopView().InputBox(StringId.editName, InpOrOutLogicMethod.GetLogicName(Logic.currlogic), StringId.nameNull, StringId.NameAlreadyExists, list, (logicName,view
+                        ) =>
                     {
                         Logic.currlogic.name = logicName;
                         Logic.currlogic.sid = LogicMethod.NewSid();
@@ -267,7 +336,7 @@
                         })
                         { IsBackground = true }.Start();
 
-                    });
+                    },()=> { });
 
                 }
                 else
@@ -459,7 +528,6 @@
         {
             //瀹氫箟涓�涓眬閮╳eekList鍒楄〃鐢ㄦ潵璁板綍閫変腑鏁版嵁;
             List<string> weekStateList = new List<string>();
-
             PublicInterface weekView = new PublicInterface();
             if (Logic.currlogic.cycle.type == "week")
             {

--
Gitblit v1.8.0