From 9c16d3614d9b88c637f967518a329f239fcd3aaf Mon Sep 17 00:00:00 2001 From: lss <316519258@qq.com> Date: 星期五, 12 六月 2020 09:22:04 +0800 Subject: [PATCH] 2020.06.12 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs | 61 +++++++++++++++++++----------- 1 files changed, 39 insertions(+), 22 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs index 381530e..77406ae 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs @@ -14,23 +14,28 @@ /// </summary> public MessageManagementControl() { - this.Height = Application.GetMinRealAverage(69); - this.Width = Application.GetMinRealAverage(69); + this.Height = this.GetPictrueRealSize(69); + this.Width = this.GetPictrueRealSize(69); this.UnSelectedImagePath = "Item/MessageManagement.png"; 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(); + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == false) + { + this.ButtonClickEvent += (sender, e) => + { + //鐐瑰嚮鍚�,娓呯┖鐘舵�� + this.IsSelected = false; + ControlCommonResourse.HadNewMessage = false; + + var form = new UserMain.MessageManagementForm(); + form.AddForm(); + }; + //娣诲姞缂撳瓨 + ControlCommonResourse.listMessageManaContr.Add(this); + //鍒锋柊鐘舵�� + this.RefreshStatu(); + } } /// <summary> @@ -38,6 +43,12 @@ /// </summary> public void RefreshStatu() { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } + if (ControlCommonResourse.HadNewMessage == true) { //濡傛灉宸茬粡鏈夋柊娑堟伅杩囨潵浜�,灏变笉鐢ㄨ浜� @@ -55,8 +66,11 @@ 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) + var pra = new MessageInfoPra(); + pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + + var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotSetAgain", "NotCheck" }); + if (string.IsNullOrEmpty(result) == true) { //鍑洪敊锛岄渶瑕侀噸鏂拌鍙� ControlCommonResourse.ReadMessageAgain = true; @@ -67,14 +81,17 @@ //妫�娴嬶細鍒囨崲浜嗕綇瀹咃紵锛� 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++) + var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result); + for (int i = 0; i < dataInfo.PageData.Count; i++) { - if (dataInfo[i].IsRead == 0) + if (dataInfo.PageData[i].IsReading == false) { + if (dataInfo.PageData[i].Topic == "/DoorLock/DoorLockOperatingEventNotificationCommand") + { + //鏆傛椂涓嶅鐞嗚繖涓富棰� + continue; + } + ControlCommonResourse.HadNewMessage = true; Application.RunOnMainThread(() => { //鏈夋柊娑堟伅 -- Gitblit v1.8.0