From 6a8e27a164158b31356b30c1e2947b95898275fe Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期日, 20 十二月 2020 19:34:04 +0800
Subject: [PATCH] Merge branch 'CJL' into NewFilePath

---
 HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs       |   26 ++++-
 HDL-ON_Android/.DS_Store                            |    0 
 HDL-ON_iOS/Resources/Language.ini                   |    1 
 HDL-ON_Android/Assets/Phone/.DS_Store               |    0 
 HDL-ON_Android/Assets/Language.ini                  |    1 
 HDL_ON/Common/HDLCommon.cs                          |   58 ++++++++++++++
 HDL_ON/DAL/Server/HttpUtil.cs                       |   16 ++--
 HDL_ON/Common/R.cs                                  |    5 +
 HDL_ON/DAL/Server/IMessageCommon.cs                 |   15 +++
 HDL_ON/UI/UI0-Public/Widget/ConfirmDialog.cs        |   35 ++++++++
 HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs |   63 ++++++++++++---
 11 files changed, 185 insertions(+), 35 deletions(-)

diff --git a/HDL-ON_Android/.DS_Store b/HDL-ON_Android/.DS_Store
index 134a072..e7c2ee1 100644
--- a/HDL-ON_Android/.DS_Store
+++ b/HDL-ON_Android/.DS_Store
Binary files differ
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index 55c49cb..18e2a8a 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -600,6 +600,7 @@
 9059=鏆傛棤鍒嗕韩
 9060=浣跨敤鏉冮檺
 9061=璇烽�氳繃蹇樿瀵嗙爜鎵惧洖瀵嗙爜鎴栨鏃�0鐐瑰悗鍐嶇櫥闄�.
+9062=鏌ョ湅
 
 10000=鏃犳晥鐧诲綍瀵嗛挜锛岃閲嶆柊鐧诲綍锛�
 10001=璇锋眰鏈嶅姟鍣ㄥけ璐ワ紝璇风◢鍚庡啀璇曪紒
diff --git a/HDL-ON_Android/Assets/Phone/.DS_Store b/HDL-ON_Android/Assets/Phone/.DS_Store
index ed770ff..770e268 100644
--- a/HDL-ON_Android/Assets/Phone/.DS_Store
+++ b/HDL-ON_Android/Assets/Phone/.DS_Store
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index 2b6affd..d87edf1 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -600,6 +600,7 @@
 9059=鏆傛棤鍒嗕韩
 9060=浣跨敤鏉冮檺
 9061=璇烽�氳繃蹇樿瀵嗙爜鎵惧洖瀵嗙爜鎴栨鏃�0鐐瑰悗鍐嶇櫥闄�.
+9062=鏌ョ湅
 
 10000=鏃犳晥鐧诲綍瀵嗛挜锛岃閲嶆柊鐧诲綍锛�
 10001=璇锋眰鏈嶅姟鍣ㄥけ璐ワ紝璇风◢鍚庡啀璇曪紒
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index ee56f54..6c1045e 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -270,12 +270,15 @@
                 {
                     Shared.Application.RunOnMainThread(() =>
                     {
+                        GetPushMessageAction?.Invoke();
                         //鎶ヨ鎺ㄩ�佹墠寮圭獥鎻愮ず锛坢essageType鍖呭惈Alarm鍏抽敭瀛楃殑锛�
                         if (jpushMessageInfo.messageType != null && jpushMessageInfo.messageType.Contains("Alarm"))
                         {
-                            new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show();
+                            //鎶ヨ鎺ㄩ�佸脊绐楁彁绀�
+                            ShowAlarmPushMessage(jpushMessageInfo);
+                            //new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show();
                         }
-                        GetPushMessageAction?.Invoke();
+                       
                     });
                     return;
                 }
@@ -340,6 +343,57 @@
                 }
             }).Start();
         }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        ConfirmDialog alarmPushConfirmDialog;
+        /// <summary>
+        /// 鎶ヨ鎺ㄩ�佸脊绐楁彁绀�,鐐瑰嚮鏌ョ湅璺宠浆淇℃伅涓績
+        /// </summary>
+        /// <param name="jpushMessageInfo"></param>
+        public void ShowAlarmPushMessage(JPushMessageInfo jpushMessageInfo)
+        {
+            //娌$櫥褰曚笉澶勭悊
+            if (UserInfo.Current == null || !UserInfo.Current.IsLogin || MainPage.BasePageView == null)
+            {
+                return;
+            }
+
+            //璺宠浆淇℃伅涓績椤甸潰
+            Action goAction = () =>
+            {
+                //Dialog
+                alarmPushConfirmDialog = null;
+                Action backAction = () => {
+                   
+                };
+                var skipPage = new MessageCenterPage();
+                MainPage.BasePageView.AddChidren(skipPage);
+                skipPage.LoadPage(backAction);
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+
+            //鍙栨秷浜嬩欢
+            Action cancelAction = () =>
+            {
+                alarmPushConfirmDialog = null;
+            };
+
+            //闃叉澶氭寮圭獥澶勭悊
+            if (alarmPushConfirmDialog == null)
+            {
+                alarmPushConfirmDialog = new ConfirmDialog();
+                alarmPushConfirmDialog.ShowDialog(Language.StringByID(StringId.Tip), jpushMessageInfo.Content, goAction, cancelAction, StringId.Cancel, StringId.LookOver);
+            }
+            else
+            {
+                alarmPushConfirmDialog.RefreshDialog(Language.StringByID(StringId.Tip), jpushMessageInfo.Content, goAction, cancelAction, StringId.Cancel, StringId.LookOver);
+
+            }
+
+        }
+
         #endregion
 
         #region 鈻� 甯哥敤鏂规硶_______________________
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index a77417b..7e241c0 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -785,7 +785,10 @@
         /// 浣跨敤鏉冮檺
         /// </summary>
         public const int PleaseTryToForgetPassword = 9061;
-
+        /// <summary>
+        /// 鏌ョ湅
+        /// </summary>
+        public const int LookOver = 9062;
 
         #region 缃戠粶璇锋眰鍝嶅簲閿欒鎻愮ず淇℃伅
         /// <summary>
diff --git a/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs b/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
index 58130ee..6c86100 100644
--- a/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
+++ b/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
@@ -4,8 +4,14 @@
 
 namespace HDL_ON
 {
+    /// <summary>
+    /// 鎴块棿妤煎眰閫夋嫨寮圭獥
+    /// </summary>
     public class FloorSelectPopupDialog
     {
+        /// <summary>
+        /// 
+        /// </summary>
         public FloorSelectPopupDialog()
         {
         }
@@ -18,30 +24,35 @@
         /// 浜岀骇鑱斿姩List
         /// </summary>
         List<List<RoomCellInfo>> mSecondList = new List<List<RoomCellInfo>>();
-     
+
         /// <summary>
-        /// 
+        /// 璇诲彇鏈湴妤煎眰鍜屾埧闂存暟鎹紝寮圭獥鏄剧ず
         /// </summary>
+        /// <param name="selectAction">鍥炶皟閫変腑浜嬩欢锛屽洖璋冮�変腑鐨剈id</param>
+        /// <param name="selectTag">璁剧疆閫変腑鐨則ga鏍囪</param>
         public void ShowView(Action<string> selectAction, string selectTag = DiySelectPopupDialog.ALLSELECT)
         {
-
+            //妤煎眰闆嗗悎鏁版嵁
             var floorList = SpatialInfo.CurrentSpatial.FloorList;
+            //鎴块棿闆嗗悎鏁版嵁
             var roomList = SpatialInfo.CurrentSpatial.RoomList;
-
+            //鏍规嵁妤煎眰鍜屾埧闂存暟鎹粨鎯呭喌鍔犺浇瀵逛簬鏁堟灉寮圭獥
             if (floorList == null || floorList.Count == 0)
             {
                 //娌℃湁妤煎眰鍙姞杞芥埧闂�
                 if (roomList == null)
                 {
-                    Utlis.WriteLine("roomList null");
-                    return;
+                    Utlis.WriteLine("floorList and roomList null");
+                    roomList = new List<Room>();
                 }
 
                 mFirstList.Clear();
+                //閬嶅巻鎵�鏈夋埧闂村垪琛�
                 foreach (var room in roomList)
                 {
                     mFirstList.Add(new RoomCellInfo() { Title = room.roomName, TagId = room.uid });
                 }
+                //寮圭獥涓�绾ц仈鍔ㄩ�夋嫨绐楀彛
                 var roomSelectPopupDialog = new DiySelectPopupDialog();
                 roomSelectPopupDialog.ShowView(mFirstList, null, selectAction, selectTag);
             }
@@ -52,6 +63,7 @@
                 //涓�绾ф暟缁勪负妤煎眰
                 foreach (var floor in floorList)
                 {
+                    //閬嶅巻鎵�鏈夋ゼ灞傚垪琛ㄤ互鍙婃ゼ灞傛墍鍏宠仈鎴块棿鐨勫垪琛�
                     mFirstList.Add(new RoomCellInfo() { Title = floor.roomName, TagId = floor.uid });
                     var mList = new List<RoomCellInfo>();
                     var allRoom = roomList.FindAll((room) => room.parentId == floor.uid);
@@ -66,7 +78,7 @@
                     }
                     mSecondList.Add(mList);
                 }
-
+                //寮圭獥浜岀骇鑱斿姩閫夋嫨绐楀彛
                 var roomSelectPopupDialog = new DiySelectPopupDialog();
                 roomSelectPopupDialog.ShowView(mFirstList, mSecondList, selectAction, selectTag);
 
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
old mode 100755
new mode 100644
index 512e33b..b6367ed
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -212,7 +212,7 @@
                         //*****涓�浜涘垽绌哄鐞�*****************
                         if (revertObj.Code == null)
                         {
-                            revertObj.Code = "DATA_EXCEPTION";
+                            revertObj.Code = StateCode.DATA_EXCEPTION;
                         }
 
                         if (revertObj.Data == null)
@@ -226,20 +226,20 @@
                     catch (Exception ex)
                     {
                         HDL_ON.Utlis.WriteLine(ex.Message);
-                        return new ResponsePackNew() { Code = "DATA_EXCEPTION" };
+                        return new ResponsePackNew() { Code = StateCode.DATA_EXCEPTION };
                     }
                 }
                 else
                 {
                     HDL_ON.Utlis.WriteLine(response.Content);
-                    return new ResponsePackNew() { Code = "NETWORK_ERROR" };
+                    return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
                 }
 
             }
             catch (Exception ex)
             {
                 HDL_ON.Utlis.WriteLine(ex.Message);
-                return new ResponsePackNew() { Code = "NETWORK_ERROR" };
+                return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
             }
 
             #endregion
@@ -453,7 +453,7 @@
                         revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content);
                         if (revertObj.Code == null)
                         {
-                            revertObj.Code = "DATA_EXCEPTION";
+                            revertObj.Code = StateCode.DATA_EXCEPTION;
                         }
                         ////缁熶竴杞垚澶у啓
                         //revertObj.StateCode = revertObj.StateCode.ToUpper ();
@@ -462,20 +462,20 @@
                     catch (Exception ex)
                     {
                         HDL_ON.Utlis.WriteLine(ex.Message);
-                        return new ResponsePackNew() { Code = "DATA_EXCEPTION" };
+                        return new ResponsePackNew() { Code = StateCode.DATA_EXCEPTION };
                     }
                 }
                 else
                 {
                     HDL_ON.Utlis.WriteLine(response.Content);
-                    return new ResponsePackNew() { Code = "NETWORK_ERROR" };
+                    return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
                 }
 
             }
             catch (Exception ex)
             {
                 HDL_ON.Utlis.WriteLine(ex.Message);
-                return new ResponsePackNew() { Code = "NETWORK_ERROR" };
+                return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
             }
 
             #endregion
diff --git a/HDL_ON/DAL/Server/IMessageCommon.cs b/HDL_ON/DAL/Server/IMessageCommon.cs
index 0f84085..fbfc0bf 100644
--- a/HDL_ON/DAL/Server/IMessageCommon.cs
+++ b/HDL_ON/DAL/Server/IMessageCommon.cs
@@ -64,7 +64,10 @@
             stateCodeDic["NETWORK_ERROR"] = StringId.FailedRequestServer;
             //鏁版嵁寮傚父
             stateCodeDic["DATA_EXCEPTION"] = StringId.DataExceptionPleaseTryAgain;
-
+            //涓庢湇鍔″櫒閫氳澶辫触
+            stateCodeDic[StateCode.NETWORK_ERROR] = StringId.FailedRequestServer;
+            //鏁版嵁寮傚父
+            stateCodeDic[StateCode.DATA_EXCEPTION] = StringId.DataExceptionPleaseTryAgain;
             #region 鍩虹鏈嶅姟 鏂伴敊璇爜 2020-12-07
             //绯荤粺绻佸繖~璇风◢鍚庡啀璇晘
             stateCodeDic["1"] = StringId.SystemIsBusy;
@@ -320,6 +323,16 @@
     public class StateCode
     {
         /// <summary>
+        /// 缃戠粶璇锋眰寮傚父
+        /// APP鑷畾涔夐敊璇爜
+        /// </summary>
+        public const string NETWORK_ERROR = "-1";
+        /// <summary>
+        /// 鏁版嵁瑙f瀽閿欒
+        /// APP鑷畾涔夐敊璇爜
+        /// </summary>
+        public const string DATA_EXCEPTION = "-2";
+        /// <summary>
         /// 璇锋眰鎴愬姛鐨勭姸鎬佺爜
         /// </summary>
         public const string SUCCESS = "0";
diff --git a/HDL_ON/UI/UI0-Public/Widget/ConfirmDialog.cs b/HDL_ON/UI/UI0-Public/Widget/ConfirmDialog.cs
old mode 100755
new mode 100644
index 3d45a4a..3961438
--- a/HDL_ON/UI/UI0-Public/Widget/ConfirmDialog.cs
+++ b/HDL_ON/UI/UI0-Public/Widget/ConfirmDialog.cs
@@ -11,6 +11,10 @@
     /// </summary>
     public class ConfirmDialog : Dialog
     {
+        /// bodyView
+        /// </summary>
+        FrameLayout bodyView;
+
         /// <summary>
         /// 
         /// </summary>
@@ -32,6 +36,14 @@
         {
             this.BackgroundColor = CSS_Color.DialogTransparentColor1;
 
+            if (bodyView != null && bodyView.Parent != null)
+            {
+                bodyView.RemoveFromParent();
+            }
+
+            bodyView = new FrameLayout();
+            this.AddChidren(bodyView);
+
             FrameLayout contentView = new FrameLayout()
             {
                 Gravity = Gravity.Center,
@@ -42,7 +54,7 @@
                 BorderWidth = 0,
                 Radius = (uint)Application.GetMinRealAverage(10),
             };
-            this.AddChidren(contentView);
+            bodyView.AddChidren(contentView);
 
             Button btnTitle = new Button()
             {
@@ -122,7 +134,7 @@
                 okAction?.Invoke();
             };
 
-            this.Show();
+            //this.Show();
         }
 
         /// <summary>
@@ -134,6 +146,7 @@
         public void ShowDialog(int titleId, int msgId, Action okAction, Action cancelAction = null)
         {
             this.ShowDialogBase(Language.StringByID(titleId), Language.StringByID(msgId), okAction, cancelAction);
+            this.Show();
         }
 
         /// <summary>
@@ -149,6 +162,7 @@
         public void ShowDialog(int titleId, int msgId, Action okAction, Action cancelAction, int cancelID, int confirmID)
         {
             this.ShowDialogBase(Language.StringByID(titleId), Language.StringByID(msgId), okAction, cancelAction, cancelID, confirmID);
+            this.Show();
         }
 
         /// <summary>
@@ -160,6 +174,7 @@
         public void ShowDialog(string titleStr, string msgStr, Action okAction, Action cancelAction = null)
         {
             this.ShowDialogBase(titleStr, msgStr, okAction, cancelAction);
+            this.Show();
         }
 
         /// <summary>
@@ -175,7 +190,23 @@
         public void ShowDialog(string titleStr, string msgStr, Action okAction, Action cancelAction, int cancelID, int confirmID)
         {
             this.ShowDialogBase(titleStr, msgStr, okAction, cancelAction, cancelID, confirmID);
+            this.Show();
         }
 
+        /// <summary>
+        /// RefreshDialog 鍦―ialog娌″叧闂儏鍐典笅璋冪敤
+        /// 鍙互鑷畾涔夋寜閽枃瀛�
+        /// </summary>
+        /// <param name="titleStr"></param>
+        /// <param name="msgStr"></param>
+        /// <param name="okAction"></param>
+        /// <param name="cancelAction"></param>
+        /// <param name="cancelID"></param>
+        /// <param name="confirmID"></param>
+        public void RefreshDialog(string titleStr, string msgStr, Action okAction, Action cancelAction, int cancelID, int confirmID)
+        {
+            this.ShowDialogBase(titleStr, msgStr, okAction, cancelAction, cancelID, confirmID);
+            //this.Show();涓嶉渶瑕乻how
+        }
     }
 }
diff --git a/HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs b/HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs
index 2d885b4..a66af36 100644
--- a/HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs
+++ b/HDL_ON/UI/UI0-Public/Widget/DiySelectPopupDialog.cs
@@ -11,7 +11,7 @@
     public class DiySelectPopupDialog : Dialog
     {
         /// <summary>
-        /// ALLSELECT
+        /// ALLSELECT锛屾爣璇�
         /// </summary>
         public const string ALLSELECT = "ALLSELECT";
 
@@ -24,7 +24,7 @@
         /// </summary>
         public FrameLayout BackView;
         /// <summary>
-        /// 
+        /// 鍏ㄩ儴鎸夐挳
         /// </summary>
         Button leftAllButton;
         /// <summary>
@@ -53,13 +53,12 @@
         List<RoomCellInfo> mSecondAllList = new List<RoomCellInfo>();
 
         /// <summary>
-        /// RoomSelectPopupDialog
+        /// DiySelectPopupDialog
         /// </summary>
-        /// <param name="SelectAction"></param>
         public DiySelectPopupDialog()
         {
             bodyView = new FrameLayout();
-           
+
         }
 
         /// <summary>
@@ -67,8 +66,10 @@
         /// mFirstList銆乵SecondList涓嶅悎娉曢兘涓嶄細鏄剧ずView
         /// mSecondList 涓嶄紶涓洪粯璁や竴绾�
         /// </summary>
-        /// <param name="mFirstList"></param>
-        /// <param name="mSecondList"></param>
+        /// <param name="mFirstList">涓�绾ф暟鎹泦鍚�</param>
+        /// <param name="mSecondList">浜岀骇鏁版嵁闆嗗悎</param>
+        /// <param name="SelectAction">閫夋嫨鍥炶皟浜嬩欢</param>
+        /// <param name="selectTagId"></param>
         public void ShowView(List<RoomCellInfo> mFirstList, List<List<RoomCellInfo>> mSecondList, Action<string> SelectAction, string selectTagId = ALLSELECT)
         {
             if (mFirstList == null)
@@ -99,19 +100,19 @@
                 this.mFirstList = mFirstList;
                 this.mSecondList = mSecondList;
                 this.mSecondAllList.Clear();
-                foreach(var list in mSecondList)
+                foreach (var list in mSecondList)
                 {
                     foreach (var data in list)
                     {
                         this.mSecondAllList.Add(data);
                     }
                 }
-                
+
                 //View鏄剧ず
                 ShowDoubleBaseView();
                 //鏁版嵁鍐呭濉厖
                 RefreshDoubleBaseView();
-                //
+                //閫変腑鏁堟灉
                 SetSelectTagId(selectTagId);
 
             }
@@ -120,7 +121,7 @@
 
 
         /// <summary>
-        /// 
+        /// 鍒锋柊UI锛岄�夋嫨鍏ㄩ儴
         /// </summary>
         void SelectAll()
         {
@@ -138,13 +139,13 @@
         /// </summary>
         void SetSelectTagId(string tagId)
         {
-            if (string.IsNullOrEmpty(tagId) || tagId == ALLSELECT)
+            if (string.IsNullOrEmpty(tagId) || tagId == ALLSELECT || mFirstList == null)
             {
                 SelectAll();
             }
             else
             {
-                
+                //涓�绾фゼ灞傚尮閰嶆垚鍔�
                 var tagInfo = mFirstList.Find((m) => m.TagId == tagId);
                 if (tagInfo != null)
                 {
@@ -162,7 +163,41 @@
                 }
                 else
                 {
-                    SelectAll();
+                    //SelectAll();
+                    //涓�绾х殑妤煎眰鍖归厤澶辫触锛屽皾璇曞尮閰嶄簩绾�
+                    if (mSecondList == null || mFirstList.Count != mSecondList.Count)
+                    {
+                        SelectAll();
+                    }
+                    else
+                    {
+                        //鏄惁鍖归厤鍒版埧闂�
+                        bool isFind = false;
+                        //1.閬嶅巻浜岀骇鎴块棿鏁版嵁
+                        for(var i = 0; i < mSecondList.Count; i++)
+                        {
+                            foreach (var room in mSecondList[i])
+                            {
+                                if(tagId == room.TagId)
+                                {
+                                    //鍖归厤鎴块棿鎴愬姛锛岄�変腑瀵逛簬鐨勬ゼ灞�
+                                    var tagFirstInfo = mFirstList[i];
+                                    isFind = true;
+                                    RefreshSelectButton(leftScrolView, tagFirstInfo.TagId);
+                                    LoadRightScrolView(tagFirstInfo, mSecondList[i]);
+                                    break;
+                                }
+                            }
+                        }
+
+                        //娌℃湁鍖归厤鍒版埧闂�
+                        if (!isFind)
+                        {
+                            SelectAll();
+                        }
+                    }
+
+
                 }
             }
         }

--
Gitblit v1.8.0