wjc
2023-06-28 975b91521a04e159f45fb34fc7b55afbf455f7f5
2023年06月28日16:53:33
1个文件已添加
15个文件已修改
495 ■■■■■ 已修改文件
app/build.gradle 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/AndroidManifest.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/base/BaseActivity.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/base/BaseFragment.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/base/CustomBaseActivity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/base/CustomBaseFragment.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/bean/BaseEventBus.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/config/ConstantManage.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java 184 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/HomeLoginActivity.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/MyPowerStationActivity.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseListFragment.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/build.gradle
@@ -70,6 +70,9 @@
//    implementation 'org.greenrobot:eventbus:3.0.0'
    implementation 'com.hdl.hdlhttp:hxhttp:1.0.4'
    //Eventbus事件发布与接收
    implementation 'org.greenrobot:eventbus:3.3.1'
    //********UniSDK必须添加的依赖 start********
    implementation "androidx.recyclerview:recyclerview:1.0.0"
app/src/main/AndroidManifest.xml
@@ -17,6 +17,8 @@
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
    <application
app/src/main/java/com/hdl/photovoltaic/base/BaseActivity.java
@@ -9,10 +9,15 @@
import androidx.appcompat.app.AppCompatActivity;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.bean.BaseEventBus;
import com.hdl.photovoltaic.listener.BaseView;
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.utils.AppManagerUtils;
import com.hdl.photovoltaic.widget.LoadingDialog;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
public abstract class BaseActivity extends AppCompatActivity implements BaseView {
@@ -35,6 +40,8 @@
            throw new RuntimeException("getContentView() should be a @LayoutRes or a View");
        }
        onBindView(savedInstanceState);
        //注册EventBus
        registerEventBus();
    }
@@ -87,9 +94,28 @@
        super.onDestroy();
        //隐藏Loading
        hideLoading();
        //注销EventBus
        unregisterEventBus();
    }
    protected void unregisterEventBus() {
        if (EventBus.getDefault().isRegistered(this)) {
            EventBus.getDefault().unregister(this);
        }
    }
    protected void registerEventBus() {
        if (!EventBus.getDefault().isRegistered(this)) {
            EventBus.getDefault().register(this);
        }
    }
    @Subscribe(threadMode = ThreadMode.POSTING)
    public void onEventMessage(BaseEventBus eventBus) {
    }
    /**
     * 显示View
     *
app/src/main/java/com/hdl/photovoltaic/base/BaseFragment.java
@@ -15,10 +15,15 @@
import androidx.lifecycle.Lifecycle;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.bean.BaseEventBus;
import com.hdl.photovoltaic.listener.BaseView;
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.widget.LoadingDialog;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.Locale;
@@ -88,7 +93,8 @@
    protected void onLazyInitView(Bundle savedInstanceState) {
        onBindView(savedInstanceState);
//        registerEventBus();
        //注册EventBus
        registerEventBus();
    }
@@ -99,26 +105,27 @@
        isFirst = true;
        //隐藏Loading
        hideLoading();
//        unregisterEventBus();
        //注销EventBus
        unregisterEventBus();
    }
    protected void unregisterEventBus() {
//        if (EventBus.getDefault().isRegistered(this)) {
//            EventBus.getDefault().unregister(this);
//        }
        if (EventBus.getDefault().isRegistered(this)) {
            EventBus.getDefault().unregister(this);
        }
    }
    protected void registerEventBus() {
//        if (!EventBus.getDefault().isRegistered(this)) {
//            EventBus.getDefault().register(this);
//        }
        if (!EventBus.getDefault().isRegistered(this)) {
            EventBus.getDefault().register(this);
        }
    }
//    @Subscribe(threadMode = ThreadMode.MAIN)
//    public void onEventMessage(BaseEvent event) {
//
//    }
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onEventMessage(BaseEventBus eventBus) {
    }
    /**
     * 显示View
app/src/main/java/com/hdl/photovoltaic/base/CustomBaseActivity.java
@@ -2,7 +2,7 @@
/**
 * 实现个性自定义方法
 * 自定义方法,用于实现个性化
 */
public abstract class CustomBaseActivity extends BaseActivity {
app/src/main/java/com/hdl/photovoltaic/base/CustomBaseFragment.java
@@ -1,7 +1,7 @@
package com.hdl.photovoltaic.base;
/**
 * 实现个性自定义方法
 * 自定义方法,用于实现个性化
 */
public abstract class CustomBaseFragment extends BaseFragment {
}
app/src/main/java/com/hdl/photovoltaic/bean/BaseEventBus.java
New file
@@ -0,0 +1,35 @@
package com.hdl.photovoltaic.bean;
/**
 * 事件分发专用对象
 */
public class BaseEventBus {
    private String topic;
    private String type;
    private Object data;
    public String getTopic() {
        return topic == null ? "" : topic;
    }
    public void setTopic(String topic) {
        this.topic = topic;
    }
    public String getType() {
        return type == null ? "" : type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
}
app/src/main/java/com/hdl/photovoltaic/config/ConstantManage.java
@@ -2,13 +2,18 @@
public class ConstantManage {
    public static final String ACCOUNT = "account";
    public static final String PASSWORD = "password";
    public static final String USERID = "userId";
    private static final String LOGIN_STATE = "login_state";
    public static final String LOGIN_TOKEN = "login_token";
    public static final String HOME_NAME = "homeName";
    public static final String REFRESH_TOKEN = "refresh_token";
    public static final String HOME_ID = "homeId";
    /******住宅数据存储的常量*********/
    public static final String SAVE_HOME_ACCOUNT = "account";
    public static final String SAVE_HOME_PASSWORD = "password";
    public static final String SAVE_HOME_USERID = "userId";
    private static final String SAVE_HOME_LOGIN_STATE = "login_state";
    public static final String SAVE_HOME_LOGIN_TOKEN = "login_token";
    public static final String SAVE_HOME_HOME_NAME = "homeName";
    public static final String SAVE_HOME_REFRESH_TOKEN = "refresh_token";
    public static final String SAVE_HOME_HOME_ID = "homeId";
    /******EventBus发布事件的常量*********/
    public static final String EVENTBUS_POST_HOME_CREATED = "home_created";//住宅创建发布
}
app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java
@@ -13,7 +13,7 @@
import java.util.List;
/**
 * 个人信息类
 * 用户信息类
 */
public class UserConfigManage {
app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java
@@ -2,7 +2,7 @@
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.text.TextUtils;
import android.os.Environment;
import android.util.Log;
import com.hdl.photovoltaic.HDLApp;
@@ -13,7 +13,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
/**
 * 文件操作的逻辑
@@ -48,56 +47,58 @@
    private String getHomeId() {
        return UserConfigManage.getInstance().getHomeId();
    }
    //region    ---------root路径-----------
    /**
     * 获取手机内部存储文件路径
     */
    private String getAPPInternalStoreFilesPath() {
        return HDLApp.getInstance().getFilesDir().getAbsolutePath();
        return HDLApp.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath();
    }
    /**
     * 获取存放文件【用户】根路径
     */
    public String getUserFilesPath() {
        return HDLApp.getInstance().getFilesDir().getAbsolutePath() + getUserId();
    public String getCurrentUserRootPath() {
        return getAPPInternalStoreFilesPath() + "/" + getUserId();
    }
    /**
     * 获取存放文件【住宅】根路径
     */
    public String getHomeFilesPath() {
        return HDLApp.getInstance().getFilesDir().getAbsolutePath() + getUserId() + "/home";
    public String getCurrentHomeRootPath() {
        return getAPPInternalStoreFilesPath() + "/" + getUserId() + "/home";
    }
    /**
     * 住宅名称
     * 住宅文件名称
     *
     * @return -
     */
    public String getHomeFileName() {
        return getHomeId() + ".json";
    public String getCurrentHomeFileName() {
        return "/" + getHomeId() + ".json";
    }
    /**
     * 创建文件
     *
     * @param fullPath 全路径
     * @return -
     * 获取当前住宅文件全路径
     */
    public boolean createFile(String fullPath) {
        try {
            File file = new File(fullPath);
            if (!file.exists()) {
                boolean succeed = file.createNewFile();
                HdlLogLogic.print("创建文件==" + succeed);
                return succeed;
            }
            return true;
        } catch (Exception e) {
            HdlLogLogic.print("创建文件失败==" + e.getMessage());
            return false;
        }
    public String getCurrentHomeFilesFullPath() {
        return getCurrentHomeRootPath() + getCurrentHomeFileName();
    }
    //endregion
    //region    ---------【文件夹】操作-----------
    /**
     * 预创建文件夹
     */
    public void createDirectory() {
        //存放用户信息
        this.createFileDir(this.getCurrentUserRootPath());
        //存放住宅信息
        this.createFileDir(this.getCurrentHomeRootPath());
    }
    /**
@@ -116,11 +117,75 @@
            }
            return true;
        } catch (Exception e) {
            HdlLogLogic.print("创建文件夹失败==" + e.getMessage());
            HdlLogLogic.print("创建文件夹有异常==" + e.getMessage());
            return false;
        }
    }
    /**
     * 删除文件夹
     *
     * @param fullPath 全路径
     */
    public void deleteDirectory(String fullPath) {
        try {
            File file = new File(fullPath);
            if (file.isDirectory()) {
                boolean succeed = file.delete();
                HdlLogLogic.print("删除文件夹==" + succeed);
            }
        } catch (Exception e) {
            HdlLogLogic.print("删除文件夹有异常==" + e.getMessage());
        }
    }
    //endregion
    //region    ---------【文件】操作-----------
    /**
     * 创建文件
     *
     * @param fullPath 全路径
     * @return -
     */
    public boolean createFile(String fullPath) {
        try {
            File file = new File(fullPath);
            if (!file.exists()) {
                boolean succeed = file.createNewFile();
                HdlLogLogic.print("创建文件==" + succeed);
                return succeed;
            }
            return true;
        } catch (Exception e) {
            HdlLogLogic.print("创建文件有异常==" + e.getMessage());
            return false;
        }
    }
    /**
     * 删除文件
     *
     * @param fullPath 全路径
     * @return -
     */
    public boolean deleteFile(String fullPath) {
        try {
            File file = new File(fullPath);
            if (file.exists()) {
                boolean succeed = file.delete();
                HdlLogLogic.print("删除文件==" + succeed);
                return succeed;
            }
            return true;
        } catch (Exception e) {
            HdlLogLogic.print("删除文件有异常==" + e.getMessage());
            return false;
        }
    }
    /**
     * 写入文件
@@ -141,8 +206,9 @@
            d.write(data.getBytes());
            d.flush();
            d.close();
        } catch (IOException e) {
            e.printStackTrace();
            HdlLogLogic.print("写入文件成功==" + fullPath);
        } catch (Exception e) {
            HdlLogLogic.print("写入文件有异常==" + e.getMessage());
        }
    }
@@ -169,15 +235,16 @@
            byte[] bytes = new byte[fis.available()];
            fis.read(bytes);
            fis.close();
            HdlLogLogic.print("读取文件成功==" + filepath);
            fileContent = new String(bytes);
            return fileContent;
        } catch (Exception e1) {
            e1.printStackTrace();
            Log.d(TAG, "Error: Input File not find!");
            HdlLogLogic.print("读取文件有异常==" + e1.getMessage());
            return "";
        }
    }
    //endregion
    /**
     * 把位图数据保存到指定路径的图片文件
@@ -197,6 +264,7 @@
        } catch (Exception e) {
        }
    }
    //</editor-fold>
    /**
     * 从指定路径的图片文件中读取位图数据
@@ -215,57 +283,5 @@
        return null;
    }
    /**
     * 预创建文件夹
     */
    public void createDirectory() {
        //用户信息
        this.createFileDir(this.getUserFilesPath());
        //住宅信息
        this.createFileDir(this.getHomeFilesPath());
    }
    /**
     * 删除文件
     *
     * @param fullPath 全路径
     * @return -
     */
    public boolean deleteFile(String fullPath) {
        try {
            File file = new File(fullPath);
            if (file.exists() || file.isDirectory()) {
                boolean succeed = file.delete();
                HdlLogLogic.print("删除文件==" + succeed);
                return succeed;
            }
            return true;
        } catch (Exception e) {
            HdlLogLogic.print("删除文件有异常==" + e.getMessage());
            return false;
        }
    }
    /**
     * 删除文件夹
     *
     * @param fullPath 全路径
     * @return -
     */
    public boolean deleteDirectory(String fullPath) {
        try {
            File file = new File(fullPath);
            if (file.isDirectory()) {
                boolean succeed = file.delete();
                HdlLogLogic.print("删除文件夹==" + succeed);
                return succeed;
            }
            return true;
        } catch (Exception e) {
            HdlLogLogic.print("删除文件夹有异常==" + e.getMessage());
            return false;
        }
    }
}
app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
@@ -406,6 +406,37 @@
    }
    /**
     * 获取住宅图片
     */
    public void getResidenceImage(String imageUrl, CloudCallBeak<List<HouseIdBean>> cloudCallBeak) {
        String requestUrl = imageUrl;
        JsonObject json = new JsonObject();
        List<HouseIdBean> list = new ArrayList<>();
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (httpResponsePack != null && httpResponsePack.getData() != null) {
                    Gson gson = new Gson();
                    String jsonStr = gson.toJson(httpResponsePack.getData());
                    HouseBeanClass houseInfoBeanClass = gson.fromJson(jsonStr, HouseBeanClass.class);
                } else {
                    if (cloudCallBeak != null) {
                        cloudCallBeak.onSuccess(list);
                    }
                }
            }
            @Override
            public void onFailure(Exception exception) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
    /**
     * 添加【住宅详情】到本地缓存
@@ -475,9 +506,10 @@
     */
    public Boolean switchHouse(String homeId) {
        String oidHomeId = UserConfigManage.getInstance().getHomeId();
        HdlFileLogic.getInstance().deleteDirectory(HdlFileLogic.getInstance().getCurrentHomeRootPath());
        UserConfigManage.getInstance().setHomeId(homeId);
        HdlFileLogic.getInstance().createDirectory();
        HdlThreadLogic.runThread(new Runnable() {
            @Override
            public void run() {
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -5,17 +5,16 @@
import com.google.gson.Gson;
import com.hdl.photovoltaic.HDLApp;
import com.hdl.photovoltaic.bean.BaseEventBus;
import com.hdl.photovoltaic.config.ConstantManage;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.ui.bean.HouseIdBean;
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
import com.hdl.photovoltaic.utils.WifiUtils;
import org.greenrobot.eventbus.EventBus;
import org.json.JSONObject;
import java.util.List;
import io.dcloud.feature.unimp.DCUniMPJSCallback;
@@ -67,17 +66,10 @@
                switch (type_value) {
                    case HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION: {
                        //创建
                        HdlResidenceLogic.getInstance().getResidenceIdList("", "", new CloudCallBeak<List<HouseIdBean>>() {
                            @Override
                            public void onSuccess(List<HouseIdBean> list) {
                                HdlResidenceLogic.getInstance().setHouseIdList(list);
                            }
                            @Override
                            public void onFailure(Exception exception) {
                            }
                        });
                        //eventbus通知
                        BaseEventBus baseEventBus = new BaseEventBus();
                        baseEventBus.setType(ConstantManage.EVENTBUS_POST_HOME_CREATED);
                        EventBus.getDefault().post(baseEventBus);
                    }
                    break;
@@ -139,7 +131,7 @@
    /**
     * 原生打开uni指定页面
     *
     * @param path       打开路径
     * @param path       打开全路径
     * @param jsonObject 附件数据(没有数据填null)
     */
    public void openUniMP(String path, JSONObject jsonObject) {
@@ -153,15 +145,16 @@
     * 原生【主动】向小程序发送通知事件
     * 注意:需要提前小程序在运行才可成功
     *
     * @param topic 主题
     * @param topic 主题大类
     * @param type  功能类
     * @param body  附件数据(没有数据填null)
     */
    public void sendUni(String topic, String body) {
    public void sendUni(String topic, String type, String body) {
        try {
            HDLUniMP.UniCallBackBaseBean callBackBaseBean = new HDLUniMP.UniCallBackBaseBean();
            callBackBaseBean.setTopic(topic);
            callBackBaseBean.setType(type);
            callBackBaseBean.setData(body);
            HDLUniMPSDKManager.getInstance().sendUniMPEvent(HDLUniMP.UNI_APP_ID, HDLUniMP.UNI_APP_ID, getJSONObject(callBackBaseBean));
            HDLUniMPSDKManager.getInstance().sendUniMPEvent(HDLUniMP.UNI_APP_ID, topic, getJSONObject(callBackBaseBean));
        } catch (Exception e) {
            HdlLogLogic.print("uni===原生主动向小程序发送通知事件", e.getMessage());
        }
@@ -223,22 +216,6 @@
        }
    }
    /**
     * 获取uni发送对象
     *
     * @param obj  附加数据
     * @param code 状态码
     * @param msg  结果描述的信息
     */
    private HDLUniMP.UniCallBackBaseBean getUniCallBackBaseBean(Object obj, String code, String msg) {
        HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean();
        uniCallBackBaseBean.setCode(code);
        uniCallBackBaseBean.setMes(msg);
        uniCallBackBaseBean.setData(obj);
        return uniCallBackBaseBean;
    }
    /**
app/src/main/java/com/hdl/photovoltaic/ui/HomeLoginActivity.java
@@ -27,6 +27,7 @@
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.base.CustomBaseActivity;
import com.hdl.photovoltaic.enums.ShowErrorMode;
import com.hdl.photovoltaic.other.HdlFileLogic;
import com.hdl.photovoltaic.other.HdlResidenceLogic;
import com.hdl.photovoltaic.ui.bean.HouseIdBean;
import com.hdl.photovoltaic.ui.bean.LoginUserBean;
@@ -248,6 +249,7 @@
            public void onClick(View v) {
//                requestPermissions();
//                startActivity(MyPowerStationActivity.class);
                HdlFileLogic.getInstance().deleteDirectory(HdlFileLogic.getInstance().getCurrentHomeRootPath());
            }
        });
app/src/main/java/com/hdl/photovoltaic/ui/MyPowerStationActivity.java
@@ -11,11 +11,11 @@
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.base.CustomBaseActivity;
import com.hdl.photovoltaic.databinding.ActivityMyPowerStationBinding;
import com.hdl.photovoltaic.other.HdlUniLogic;
import com.hdl.photovoltaic.utils.PermissionUtils;
public class MyPowerStationActivity extends CustomBaseActivity {
    private ActivityMyPowerStationBinding viewBinding;
@@ -55,6 +55,11 @@
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        HdlUniLogic.getInstance().checkRemoveOtherUniMPEventCallBack();
    }
    private void initView() {
        viewBinding.myPowerStationBottomIl1.titleTv.setText(R.string.my_power_station_电站);
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseListFragment.java
@@ -13,9 +13,13 @@
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.bean.BaseEventBus;
import com.hdl.photovoltaic.config.ConstantManage;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.databinding.FragmentHouseListBinding;
import com.hdl.photovoltaic.base.CustomBaseFragment;
import com.hdl.photovoltaic.enums.ShowErrorMode;
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.other.HdlLogLogic;
import com.hdl.photovoltaic.other.HdlResidenceLogic;
import com.hdl.photovoltaic.other.HdlThreadLogic;
@@ -91,8 +95,7 @@
        viewBinding.fragmentHouseSrl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
                viewBinding.fragmentHouseSrl.setRefreshing(false);
                updateUIData(true);
                Log.d("HouseListFragment", "下拉刷新");
            }
        });
@@ -128,19 +131,74 @@
//            this.houseListBeanList.add(houseListBean);
//        }
        this.houseListBeanIDList.addAll(HdlResidenceLogic.getInstance().getHouseIdList());
    }
    @Override
    public void onEventMessage(BaseEventBus eventBus) {
        super.onEventMessage(eventBus);
        //收到EventBUs通知
        if (ConstantManage.EVENTBUS_POST_HOME_CREATED.equals(eventBus.getType())) {
            updateUIData(false);
        }
    }
    /**
     * 刷新UI
     *
     * @param isRefreshing 表示是下拉刷新的
     */
    private void updateUIData(boolean isRefreshing) {
        //获取住宅(电站)ID列表
        HdlResidenceLogic.getInstance().getResidenceIdList("", "", new CloudCallBeak<List<HouseIdBean>>() {
            @Override
            public void onSuccess(List<HouseIdBean> list) {
                HdlThreadLogic.runMainThread(new Runnable() {
                    @Override
                    public void run() {
                        if (isRefreshing) {
                            //关闭下拉刷新的圈圈
                            viewBinding.fragmentHouseSrl.setRefreshing(false);
                        }
                        if (list != null && list.size() > 0) {
                            //更新缓存
                            HdlResidenceLogic.getInstance().setHouseIdList(list);
                            if (houseInfoAdapter != null) {
                                //更新UI
                                houseInfoAdapter.setList(list);
                                houseInfoAdapter.notifyDataSetChanged();
                            }
                        }
                    }
                }, _mActivity, ShowErrorMode.YES);
            }
            @Override
            public void onFailure(Exception exception) {
                HdlThreadLogic.runMainThread(new Runnable() {
                    @Override
                    public void run() {
                        if (isRefreshing) {
                            //关闭下拉刷新的圈圈
                            viewBinding.fragmentHouseSrl.setRefreshing(false);
                        }
                    }
                }, _mActivity, ShowErrorMode.YES);
            }
        });
    }
    /**
     * 申请权限
     */
    private void requestPermissions(PermissionsResultCallback permissionsResultCallback) {
        mPermissionsResultCallback = permissionsResultCallback;
        //Manifest.permission.CAMERA,
        String[] s = new String[]{
                Manifest.permission.ACCESS_FINE_LOCATION
                Manifest.permission.ACCESS_FINE_LOCATION,
        };
        String[] ary = PermissionUtils.checkPermission(_mActivity, s);
        if (ary.length > 0) {
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java
@@ -18,7 +18,7 @@
    public final static String UNI_EVENT_uniMPOnClose = "uni_MPOnClose";//自定义小程序关闭事件
    public final static String UNI_EVENT_GetAppParams = "uni_GetAppParams";//获取APP应用信息
    //注意:【小程序】发送到【原生】 加前缀:uni_
    //region --------【小程序】发送到【原生】(加前缀:uni_)--------
    /*********住宅【电站】模块*********/
    public final static String UNI_EVENT_REPLY_HOME_MODEL = "uni_home_model";//住宅模块
    public final static String UNI_EVENT_REPLY_HOME_LIST = "list";//获取住宅【电站】列表
@@ -39,11 +39,18 @@
    public final static String UNI_EVENT_REPLY_WIFI_LIST = "list";//获取wifi列表
    public final static String UNI_EVENT_REPLY_WIFI_INFO = "info";//获取当前wifi信息
    public final static String UNI_EVENT_REPLY_WIFI_CONNECT = "connect";//连接wifi
    //endregion
    //注意:【原生】主动发送到【小程序】 加前缀:app_
    //region --------【原生】主动发送到【小程序】--------
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_MODEL = "uni_notification_model";//通知模块
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_LIST = "list";//逆变器设备列表
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_CHILD_LIST = "child_list";//逆变器【下挂】设备列表
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_ADD = "add";//设备添加
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_DEL = "del";//设备删除
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_OID = "oid";//设备【包括下挂设备】oid列表
    //endregion
    //注意:【原生】打开【小程序】页面路径(UNI_EVENT_OPEN_HOME_CREATION+?key=value&key=参数一)
    //region --------【原生】打开【小程序】页面路径(UNI_EVENT_OPEN_HOME_CREATION+?key=value&key=参数一)--------
    /*********住宅模块*********/
    public final static String UNI_EVENT_OPEN_HOME_CREATION = "pages/powerStation/powerStationCreate";//住宅【电站】创建
    public final static String UNI_EVENT_OPEN_HOME_EDIT = "pages/powerStation/powerStationEdit";//住宅【电站】编辑
@@ -51,11 +58,12 @@
    public final static String UNI_EVENT_OPEN_HOME_DEl = "del";//住宅【电站】删除
    /*********设备模块*********/
    //设备模块打开页面全路径
    //endregion
    /**
     * 小程序与原生通讯数据格式
     * 自定义格式
     * 自定义数据格式
     */
    public static class UniCallBackBaseBean implements Serializable {
@@ -63,7 +71,6 @@
        private String path;//打开小程序路径(暂时用不上)
        private String code;//状态码
        private String mes;//信息描述
        private String topic;//暂时用不上
        private String type;//功能类型
        private Object data;//附加json数据
@@ -86,7 +93,6 @@
            this.code = code;
        }
        public String getMes() {
            return mes == null ? "" : mes;
        }
@@ -103,13 +109,6 @@
            this.data = data;
        }
        public String getTopic() {
            return topic;
        }
        public void setTopic(String topic) {
            this.topic = topic;
        }
        public String getType() {
            return type == null ? "" : type;