黄学彪
2020-07-06 f23ad1b3f9f6193f35f72104d690b21dc67d5c1f
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)
            {
                //如果已经有新消息过来了,就不用读了
@@ -52,13 +63,13 @@
            }
            ControlCommonResourse.ReadMessageAgain = false;
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                string nowHomeId = Common.Config.Instance.Home.Id;
                var pra = new MessageInfoPra();
                pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotSetAgain", "NotCheck" });
                var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotCheck" });
                if (string.IsNullOrEmpty(result) == true)
                {
                    //出错,需要重新读取