From cc48110a814477bc0d01615f9844aea6ff2b609f Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 28 四月 2021 14:51:38 +0800
Subject: [PATCH] Merge branch 'WJC' into wxr4

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/InputPushText.cs |  107 ++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 81 insertions(+), 26 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InputPushText.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InputPushText.cs
index e183494..b05e5c7 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InputPushText.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InputPushText.cs
@@ -11,8 +11,7 @@
         {
             Tag = "Logic";
         }
-        public  Action<PushConfigs> action;
-        public void Show(PushConfigs pushConfigs)
+        public void Show()
         {
 
             this.BackgroundColor = CSS.CSS_Color.viewMiddle;
@@ -41,7 +40,7 @@
                 Height = Application.GetRealHeight(152),
                 TextAlignment = TextAlignment.TopLeft,
                 Radius=(uint)Application.GetRealHeight(12),
-                Text= pushConfigs.pushContent,
+                Text= Logic.currlogic.noticeConfig.noticeContent,
                 TextSize = LogicView.TextSize.text14,
                 TextColor= CSS.CSS_Color.textColor,
                 PlaceholderText =Language.StringByID(StringId.xianzhichangdu),//"(100瀛椾互鍐�)",
@@ -61,7 +60,6 @@
 #endif
 
                 }
-                pushConfigs.pushContent = textBox.Text.Trim();
 
             };
             #endregion
@@ -72,10 +70,11 @@
             appPush.btnText.TextID = StringId.apptuisong;
             appPush.btnText.X = Application.GetRealWidth(12);
             viewLayout.AddChidren(appPush.FLayoutView());
+            //瀹氫箟涓�涓眬閮ㄨ处鍙峰垪琛ㄧ敤鏉ヨ褰曢�変腑鏁版嵁;
+            List<string> selectedAccountList = new List<string>();
             appPush.btnClick.MouseUpEventHandler += (sender, e) =>
             {
-                //瀹氫箟涓�涓眬閮ㄨ处鍙峰垪琛ㄧ敤鏉ヨ褰曢�変腑鏁版嵁;
-                List<string> accountList = new List<string>();
+                var userList = new List<HDL_ON.Entity.ResidenceMemberInfo>();
                 Loading loading = new Loading();
                 this.AddChidren(loading);
                 loading.Start();
@@ -83,12 +82,8 @@
                 {
                     try
                     {
-                        var userList = Send.GetResidenceMemberAccount();
-                        for (int i = 0; i < userList.Count; i++)
-                        {
-                            var user = userList[i];
-                            accountList.Add(user.Account);
-                        }
+                         userList = Send.GetResidenceMemberAccount();
+                     
                     }
                     catch { }
                     finally
@@ -96,21 +91,49 @@
                         Application.RunOnMainThread(() =>
                         {
                             loading.Hide();
-                            if (!string.IsNullOrEmpty(UserInfo.Current.userMobileInfo))
+                            userList.Add(new Entity.ResidenceMemberInfo { childAccountId = UserInfo.Current.ID, childAccountPhone = UserInfo.Current.userMobileInfo, childAccountEmail = UserInfo.Current.userEmailInfo });
+                            //浣忓畢瀛愯处鍙峰垪琛�
+                            List<string> accountList = new List<string>();
+                            //涔嬪墠鐘舵�佸垪琛�
+                            List<string> stateList = new List<string>();
+                            for (int i = 0; i < userList.Count; i++)
                             {
-                                //榛樿鎺ㄩ�佸綋鍓嶈处鍙�
-                                accountList.Insert(0, UserInfo.Current.userMobileInfo);
+                                var user = userList[i];
+                                accountList.Add(user.Account);
                             }
-                            else
+
+                            if (Logic.currlogic.pushConfigs.Count > 0)
                             {
-                                //榛樿鎺ㄩ�佸綋鍓嶈处鍙�
-                                accountList.Insert(0, UserInfo.Current.userEmailInfo);
+                                var list = Logic.currlogic.pushConfigs[0].pushTarget;
+                                for (int i = 0;i< userList.Count; i++)
+                                {
+
+                                    var user = userList[i];
+                                    if (list.Contains(user.childAccountId))
+                                    {
+                                        stateList.Add(user.Account);
+                                    }
+
+                                }
+
+
                             }
+
                             PublicInterface view = new PublicInterface();
-                            view.FrameOrVvList(this, accountList, pushConfigs.pushTarget, StringId.zhanghaoxuanze
+                            view.FrameOrVvList(this, accountList, stateList, StringId.zhanghaoxuanze
                                , (list) =>
                                {
-                                   pushConfigs.pushTarget = list;
+                                   //娓呯┖鏃ф暟鎹垪琛�
+                                   selectedAccountList.Clear();
+                                   for (int i = 0;i<userList.Count; i++)
+                                   {
+                                       var user = userList[i];
+                                       if (list.Contains(user.Account))
+                                       {
+                                           selectedAccountList.Add(user.childAccountId);
+                                       }
+                                   }
+
                                });
                         });
                     }
@@ -127,18 +150,50 @@
 
             topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
             {
-
-                action(pushConfigs);
-                RemoveFromParent();
+              this.RemoveFromParent();
             };
             saveView.btnClick.MouseUpEventHandler += (e, sen) =>
             {
-                action(pushConfigs);
-                RemoveFromParent();
+                Logic.currlogic.noticeConfig.noticeContent = textBox.Text.Trim();
+                if (selectedAccountList.Count > 0)
+                {
+                    Logic.currlogic.pushConfigs.Clear();//娓呯┖鏃ф暟鎹垪琛�
+                    Logic.currlogic.pushConfigs.Add(new PushConfigs { pushTarget = selectedAccountList });
+                }
+                //璐﹀彿鍒楄〃涓虹┖榛樿鎺ㄩ�佸綋鍓嶈处鍙�
+                if (Logic.currlogic.pushConfigs.Count == 0)
+                {
+                    //鍒濆鍖栧璞�
+                    PushConfigs pushConfigs = new PushConfigs();
+                    //榛樿娣诲姞鎺ㄩ�佸綋鍓嶈处鍙�
+                    pushConfigs.pushTarget.Add(UserInfo.Current.ID);
+                    Logic.currlogic.pushConfigs.Add(pushConfigs);
+                }
+                this.RemoveFromParent();
             };
             #endregion
 
         }
-       
+
+        /// <summary>
+        /// 鎵嬫満璐﹀彿涓哄厛锛屾墜鏈鸿处鍙蜂负绌猴紝鍏舵鍒伴偖绠辫处鍙�
+        /// </summary>
+        private string Account
+        {
+            get
+            {
+                ///鎵嬫満璐﹀彿涓哄厛锛屾墜鏈鸿处鍙蜂负绌猴紝鍏舵鍒伴偖绠辫处鍙�;
+                if (!string.IsNullOrEmpty(UserInfo.Current.userMobileInfo))
+                {
+                    //榛樿鎺ㄩ�佸綋鍓嶆墜鏈鸿处鍙�
+                    return UserInfo.Current.userMobileInfo;
+                }
+                else
+                {
+                    //榛樿鎺ㄩ�佸綋鍓嶉偖绠辫处鍙�
+                    return UserInfo.Current.userEmailInfo;
+                }
+            }
+        }
     }
 }

--
Gitblit v1.8.0