mac
2024-06-12 12d6db5780d8a2121a3bef2d58bf897b24ff552a
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
@@ -265,7 +265,7 @@
     * @param jsonObject 附加数据
     * @param callBack   监听小程序OtherUniMPEvent事件
     */
    public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) {
    public void openUniMPDelay(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) {
        if (TextUtils.isEmpty(uniAppId)) {
            HdlThreadLogic.toast(mContext, "uni Id null");
            HdlLogLogic.print("小程序ID 不能为空");
@@ -300,6 +300,34 @@
        }
    }
    public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) {
        if (TextUtils.isEmpty(uniAppId)) {
            HdlThreadLogic.toast(mContext, "uni Id null");
            HdlLogLogic.print("小程序ID 不能为空");
            return;
        }
        try {
            setOnOtherUniMPEventCallBack(callBack);
            uniMP = null;
            if (TextUtils.isEmpty(path)) {
                uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId);
            } else {
                UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration();
                uniMPOpenConfiguration.path = path;
                uniMPOpenConfiguration.extraData = jsonObject;
                uniMPOpenConfiguration.splashClass=MySplashView.class;
                uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId, uniMPOpenConfiguration);
            }
            mCurrentAppId = uniAppId;//记录当前小程序
            mUniMPCaches.put(uniMP.getAppid(), uniMP);
        } catch (Exception e) {
            e.printStackTrace();
            HdlThreadLogic.toast(HDLApp.getInstance(), R.string.uni_open_error);
//            initDCUniMPSDK(HDLApp.getInstance());
            HdlLogLogic.print("打开失败===" + e.getMessage());
        }
    }
    /**
     * 初始化UniMPSDK 小程序SDK
     */