| | |
| | | <title>Error</title>
|
| | | <script type="text/javascript">
|
| | | // H5 plus事件处理
|
| | | <script type="text/javascript">
|
| | | // H5 plus事件处理
|
| | | window.onload = function(){
|
| | | console.log("进入onload方法")
|
| | | //界面异常后,等1秒后尝试重新加载
|
| | |
| | | plus.runtime.restart()
|
| | | },1000);
|
| | | };
|
| | | </script>
|
| | | </script>
|
| | | <style>
|
| | | *{
|
| | |
| | | HdlLogLogic.print("uni---组装uni发送数据格式---" + json, false); |
| | | } |
| | | |
| | | public void openUniMPDelay(String path, JSONObject jsonObject) { |
| | | JSONObject json = this.createdJSONObject(jsonObject, true); |
| | | HDLUniMPSDKManager.getInstance().openUniMPDelay(HDLUniMP.UNI_APP_ID, path, json, HdlUniLogic.this); |
| | | HdlLogLogic.print("uni---组装uni发送数据格式---" + json, false); |
| | | } |
| | | |
| | | /** |
| | | * 原生【主动】向小程序发送通知事件 |
| | | * 注意:需要提前小程序在运行才可成功 |
| | |
| | | List<HouseIdBean> HouseIdList = HdlResidenceLogic.getInstance().getHouseIdList(); |
| | | if (HouseIdList.size() == 0) { |
| | | String path = HDLUniMP.UNI_EVENT_OPEN_HOME_Null_C; |
| | | if (delay) { |
| | | HdlUniLogic.getInstance().openUniMPDelay(path, null); |
| | | } else { |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } else { |
| | | int select_home = 0; |
| | | for (int i = 0; i < HouseIdList.size(); i++) { |
| | |
| | | HouseIdBean houseIdBean = HouseIdList.get(select_home); |
| | | HdlResidenceLogic.getInstance().switchHouse(houseIdBean); |
| | | String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS_C + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&powerStationStatus=" + houseIdBean.getPowerStationStatus(); |
| | | if (delay) { |
| | | HdlUniLogic.getInstance().openUniMPDelay(path, null); |
| | | } else { |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } |
| | | } |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 打开小程序 |
| | | * |
| | | * @param uniAppId 小程序ID |
| | | * @param path 指定路径 |
| | | * 例:pages/component/scroll-view/scroll-view?a=1&b=2&c=3 |
| | | * @param jsonObject 附加数据 |
| | | * @param callBack 监听小程序OtherUniMPEvent事件 |
| | | */ |
| | | public void openUniMPDelay(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) { |
| | | public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) { |
| | | if (TextUtils.isEmpty(uniAppId)) { |
| | | HdlThreadLogic.toast(mContext, "uni Id null"); |
| | | HdlLogLogic.print("小程序ID 不能为空"); |
| | |
| | | //第一次用要休眠 |
| | | 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()); |
| | | HdlLogLogic.print("打开失败===" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | 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); |
| | |
| | |
|
| | | import android.content.Context;
|
| | | import android.graphics.Color;
|
| | | import android.os.SystemClock;
|
| | | import android.util.Log;
|
| | | import android.view.Gravity;
|
| | | import android.view.LayoutInflater;
|
| | |
| | | # For customization when using a Version Control System, please read the |
| | | # header note. |
| | | #Fri Feb 23 16:45:51 CST 2024 |
| | | sdk.dir=/Users/user/Library/Android/sdk |
| | | sdk.dir=/Users/hdl/Library/Developer/Xamarin/android-sdk-macosx |