From 4f9fab221268ca32efb1ebd59dd7dd2ced81f89b Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 30 七月 2024 16:14:52 +0800
Subject: [PATCH] 2024年07月30日16:14:51

---
 app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
index 6f5b2e7..61e066b 100644
--- a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
+++ b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
@@ -3,13 +3,16 @@
 import android.app.Application;
 import android.content.Context;
 import android.os.Environment;
+import android.os.SystemClock;
 import android.text.TextUtils;
 
 
 import com.google.gson.Gson;
+import com.hdl.linkpm.sdk.user.HDLLinkPMUser;
 import com.hdl.photovoltaic.HDLApp;
 import com.hdl.photovoltaic.R;
 import com.hdl.photovoltaic.config.AppConfigManage;
+import com.hdl.photovoltaic.enums.LowerTagType;
 import com.hdl.photovoltaic.other.HdlLogLogic;
 import com.hdl.photovoltaic.other.HdlThreadLogic;
 import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
@@ -118,7 +121,8 @@
 
                 //灏忕▼搴忚鍏抽棴浜嗛�氱煡缁欏師鐢�
                 BaseEventBus baseEventBus = new BaseEventBus();
-                baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE);
+                baseEventBus.setTopic(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE);
+                baseEventBus.setType(LowerTagType.power_station.toString());
                 EventBus.getDefault().post(baseEventBus);
 
             }
@@ -152,10 +156,13 @@
                     HdlLogLogic.print("uni_GetAppParams callback:" + params.toString());
                 } else {
                     //闄や簡缁熶竴澶勭悊锛屽墿浣欏叾瀹冪壒瀹氬満鏅殑浜嬩欢閫氱煡
-                    if (onOtherUniMPEventCallBack != null) {
+                    if (onOtherUniMPEventCallBack!= null) {
                         onOtherUniMPEventCallBack.onOtherUniMPEventReceive(appid, event, data, callback);
                     } else {
                         HdlLogLogic.print("鏀跺埌灏忕▼搴忛�氱煡,鍥炶皟浜嬩欢涓簄ull,鏃犳硶鍥炶皟浜嬩欢骞舵墽琛屼笟鍔¢�昏緫--->event=" + event + "\r\n" + "data=" + data, true);
+                        //鏈夊彲鑳芥槸绯荤粺鍥炴敹鎺塧ctivity瀵艰嚧鍥炶皟涓簄ull锛岃繖鏍锋儏鍐典笅寮哄埗杩斿洖鐧诲綍鐣岄潰锛�
+                        //todo 闀挎椂闂存病鍝嶅簲灏嗛��鍑虹櫥褰曠晫闈㈤噸鏂扮櫥褰�
+                        HDLLinkPMUser.getInstance().logout(0);
                     }
                 }
             }
@@ -255,15 +262,6 @@
         return true;
     }
 
-    /**
-     * 鎵撳紑灏忕▼搴�
-     *
-     * @param uniAppId   灏忕▼搴廔D
-     * @param path       鎸囧畾璺緞
-     *                   渚嬶細pages/component/scroll-view/scroll-view?a=1&b=2&c=3
-     * @param jsonObject 闄勫姞鏁版嵁
-     * @param callBack   鐩戝惉灏忕▼搴廜therUniMPEvent浜嬩欢
-     */
     public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) {
         if (TextUtils.isEmpty(uniAppId)) {
             HdlThreadLogic.toast(mContext, "uni Id null");
@@ -279,14 +277,22 @@
                 UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration();
                 uniMPOpenConfiguration.path = path;
                 uniMPOpenConfiguration.extraData = jsonObject;
+                uniMPOpenConfiguration.splashClass = MySplashView.class;
                 uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId, uniMPOpenConfiguration);
+            }
+            //android14鏈変簺璁惧鏈夐棶棰橈紝闇�瑕佺瓑寰�
+            if (android.os.Build.VERSION.SDK_INT >= 34) {
+                if (TextUtils.isEmpty(mCurrentAppId)) {
+                    //绗竴娆$敤瑕佷紤鐪�
+                    SystemClock.sleep(1000);
+                }
             }
             mCurrentAppId = uniAppId;//璁板綍褰撳墠灏忕▼搴�
             mUniMPCaches.put(uniMP.getAppid(), uniMP);
         } catch (Exception e) {
             e.printStackTrace();
             HdlThreadLogic.toast(HDLApp.getInstance(), R.string.uni_open_error);
-            initDCUniMPSDK(HDLApp.getInstance());
+//            initDCUniMPSDK(HDLApp.getInstance());
             HdlLogLogic.print("鎵撳紑澶辫触===" + e.getMessage());
         }
     }

--
Gitblit v1.8.0