hxb
2024-06-25 70a4c1baac1415ea65d9727284703a3d5585036d
调整回等待方式
6个文件已修改
61 ■■■■■ 已修改文件
app/src/main/assets/data/dcloud_error.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/CPowerStationActivity.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/uni/MySplashView.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
local.properties 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/assets/data/dcloud_error.html
@@ -19,7 +19,6 @@
                    },1000);
            };
    </script>
    </script>
    <style>
        *{
            -webkit-user-select: none;
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -534,12 +534,6 @@
        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);
    }
    /**
     * 原生【主动】向小程序发送通知事件
     * 注意:需要提前小程序在运行才可成功
app/src/main/java/com/hdl/photovoltaic/ui/CPowerStationActivity.java
@@ -208,11 +208,7 @@
        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++) {
@@ -224,11 +220,7 @@
            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);
        }
    }
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
@@ -256,16 +256,7 @@
        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 不能为空");
@@ -289,34 +280,6 @@
                    //第一次用要休眠
                    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);
app/src/main/java/com/hdl/photovoltaic/uni/MySplashView.java
@@ -2,6 +2,7 @@
import android.content.Context;
import android.graphics.Color;
import android.os.SystemClock;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
local.properties
@@ -5,4 +5,4 @@
# 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