| | |
| | | import com.hdl.photovoltaic.config.AppConfigManage; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | |
| | |
| | | if (appid.equals(mCurrentAppId)) { |
| | | mCurrentAppId = ""; |
| | | } |
| | | |
| | | //小程序被关闭了通知给原生 |
| | | BaseEventBus baseEventBus = new BaseEventBus(); |
| | | baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE); |
| | | EventBus.getDefault().post(baseEventBus); |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | //回传数据给小程序 |
| | | JSONObject params = getAppParams(); |
| | | callback.invoke(params); |
| | | HdlLogLogic.print( "uni_GetAppParams callback:" + params.toString()); |
| | | HdlLogLogic.print("uni_GetAppParams callback:" + params.toString()); |
| | | } else { |
| | | //除了统一处理,剩余其它特定场景的事件通知 |
| | | if (onOtherUniMPEventCallBack != null) { |
| | |
| | | } |
| | | }); |
| | | } else { |
| | | HdlLogLogic.print( "wgt包本地不存在"); |
| | | HdlLogLogic.print("wgt包本地不存在"); |
| | | } |
| | | } |
| | | |
| | |
| | | public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) { |
| | | if (TextUtils.isEmpty(uniAppId)) { |
| | | HdlThreadLogic.toast(mContext, "uni Id null"); |
| | | HdlLogLogic.print( "小程序ID 不能为空"); |
| | | HdlLogLogic.print("小程序ID 不能为空"); |
| | | return; |
| | | } |
| | | try { |
| | |
| | | mUniMPCaches.put(uniMP.getAppid(), uniMP); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | HdlLogLogic.print( "打开失败===" + e.getMessage()); |
| | | HdlLogLogic.print("打开失败===" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | HdlLogLogic.print("发送失败,小程序对象为空:" + uniAppId); |
| | | } |
| | | } else { |
| | | HdlLogLogic.print( "发送失败,找不到对应的小程序:" + uniAppId); |
| | | HdlLogLogic.print("发送失败,找不到对应的小程序:" + uniAppId); |
| | | } |
| | | |
| | | } |