From 969a251801a4553920b799ba9be0fcb9e69e47ed Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 14 三月 2024 13:44:40 +0800
Subject: [PATCH] 2024年03月14日13:44:32

---
 app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java |   54 ++++++++++++++++++------------------------------------
 1 files changed, 18 insertions(+), 36 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java b/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java
index ffc245f..6b4bfd0 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java
@@ -11,8 +11,7 @@
 import androidx.recyclerview.widget.RecyclerView;
 import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
+import com.google.gson.JsonObject;
 import com.hdl.linkpm.sdk.core.exception.HDLException;
 import com.hdl.photovoltaic.R;
 import com.hdl.photovoltaic.base.CustomBaseActivity;
@@ -26,9 +25,11 @@
 import com.hdl.photovoltaic.other.HdlLogLogic;
 import com.hdl.photovoltaic.other.HdlMessageLogic;
 import com.hdl.photovoltaic.other.HdlThreadLogic;
+import com.hdl.photovoltaic.other.HdlUniLogic;
 import com.hdl.photovoltaic.ui.bean.MessageBean;
 import com.hdl.photovoltaic.ui.message.MessageInfoActivity;
 import com.hdl.photovoltaic.ui.newC.adapter.MessageCenterListAdapter;
+import com.hdl.photovoltaic.uni.HDLUniMP;
 import com.hdl.photovoltaic.widget.TypeTitleListDialog;
 import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
 
@@ -71,6 +72,8 @@
 
     @Override
     public void onBindView(Bundle savedInstanceState) {
+        setNotificationBarBackgroundColor(CustomColor.white);
+        setStatusBarTextColor();
         //鍒濆鍖栨暟鎹�
         initData();
         //鍒濆鍖�
@@ -81,12 +84,25 @@
         loadNextPageMessageList(1, true, FilterType.all, FilterType.all);
     }
 
+    @Override
+    protected void onResume() {
+        super.onResume();
+        //杩涙潵璇诲彇涓�娆℃暟鎹�(涓轰簡鏇存柊currentPage锛宑urrentTotal杩欎釜鍊�)
+//        loadNextPageMessageList(1, true, mFilterKye, mFilterValue);
+    }
+
     private void initEvent() {
         //杩斿洖鎸夐挳
         viewBinding.toolbarTopMessageCenterListRl.topBackBtn.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 clearCacheData();
+                HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean();
+                uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_USERINFO);
+                JsonObject jsonObject = new JsonObject();
+                jsonObject.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
+                uniCallBackBaseBean.setData(jsonObject);
+                HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_REFRESH_UNREAD_NUMBER, uniCallBackBaseBean);
                 finish();
             }
         });
@@ -339,41 +355,7 @@
 
     }
 
-    /**
-     * 璇诲彇娑堟伅銆愭湭璇绘暟閲忋��
-     */
-    private void getUnreadCount() {
-        HdlMessageLogic.getInstance().getMessageUntreatedCount(new CloudCallBeak<String>() {
-            @Override
-            public void onSuccess(String data) {
 
-                HdlThreadLogic.runMainThread(new Runnable() {
-                    @Override
-                    public void run() {
-                        JSONObject jsonObject = JSON.parseObject(data);
-                        if (jsonObject.containsKey("untreatedCount")) {
-                            //鏈鐞嗘暟閲�
-                            String untreatedCount = jsonObject.getString("untreatedCount");
-                            refreshCount();
-                        }
-                        if (jsonObject.containsKey("unreadCount")) {
-                            //鏈鏁伴噺
-                            String unreadCount = jsonObject.getString("unreadCount");
-                        }
-                    }
-                });
-
-            }
-
-            @Override
-            public void onFailure(HDLException e) {
-                TextView textView = _mActivity.findViewById(R.id.my_message_bottom_il2).findViewById(R.id.red_count_tv);
-                if (textView != null) {
-                    textView.setVisibility(View.GONE);
-                }
-            }
-        });
-    }
 
 
     @Subscribe(threadMode = ThreadMode.MAIN, sticky = true)

--
Gitblit v1.8.0