From 160785587667cc0d927f85e44c139ec9dde13a9e Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 25 十一月 2019 14:30:13 +0800
Subject: [PATCH] 原来的 IOS 工程舍弃(注:没有合并其他组员的代码)

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs |   62 ++++++++++++++++++++++++++++++-
 1 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
index aa41b6f..381530e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
@@ -20,11 +20,15 @@
             this.SelectedImagePath = "Item/MessageManagementSelected.png";
             this.ButtonClickEvent += (sender, e) =>
             {
+                //鐐瑰嚮鍚�,娓呯┖鐘舵��
                 this.IsSelected = false;
+                ControlCommonResourse.HadNewMessage = false;
 
                 var form = new UserMain.MessageManagementForm();
                 form.AddForm();
             };
+            //娣诲姞缂撳瓨
+            ControlCommonResourse.listMessageManaContr.Add(this);
             //鍒锋柊鐘舵��
             this.RefreshStatu();
         }
@@ -34,8 +38,62 @@
         /// </summary>
         public void RefreshStatu()
         {
-            //鏆傛椂娴嬭瘯
-            this.IsSelected = true;
+            if (ControlCommonResourse.HadNewMessage == true)
+            {
+                //濡傛灉宸茬粡鏈夋柊娑堟伅杩囨潵浜�,灏变笉鐢ㄨ浜�
+                ControlCommonResourse.ReadMessageAgain = false;
+                this.IsSelected = true;
+                return;
+            }
+            if (ControlCommonResourse.ReadMessageAgain == false)
+            {
+                //鏃犻渶鍐嶆璇诲彇
+                return;
+            }
+            ControlCommonResourse.ReadMessageAgain = false;
+
+            HdlThreadLogic.Current.RunThread(async () =>
+            {
+                string nowHomeId = Common.Config.Instance.Home.Id;
+                var result = await UserCenterLogic.GetByteResponseDataByRequestHttps("ZigbeeUsers/GetPushMessageRecord", false, "", new List<string>() { "NotSetAgain" });
+                if (result == null)
+                {
+                    //鍑洪敊锛岄渶瑕侀噸鏂拌鍙�
+                    ControlCommonResourse.ReadMessageAgain = true;
+                    return;
+                }
+                if (nowHomeId != Common.Config.Instance.Home.Id)
+                {
+                    //妫�娴嬶細鍒囨崲浜嗕綇瀹咃紵锛�
+                    return;
+                }
+                var strdata = System.Text.Encoding.UTF8.GetString(result);
+                var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResponsePack>(strdata);
+                var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MessageRecordInfo>>(revertObj.ResponseData.ToString());
+               
+                for (int i = 0; i < dataInfo.Count; i++)
+                {
+                    if (dataInfo[i].IsRead == 0)
+                    {
+                        Application.RunOnMainThread(() =>
+                        {
+                            //鏈夋柊娑堟伅
+                            this.IsSelected = true;
+                        });
+                        break;
+                    }
+                }
+            });
+        }
+
+        /// <summary>
+        /// 鎺т欢绉婚櫎
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            ControlCommonResourse.listMessageManaContr.Remove(this);
+
+            base.RemoveFromParent();
         }
     }
 }

--
Gitblit v1.8.0