mac
2024-01-11 dbff6d6f9200417ea60e2fe507b79cbe2eb7ea32
app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java
@@ -1,6 +1,5 @@
package com.hdl.photovoltaic.ui.me;
import android.app.job.JobScheduler;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
@@ -29,6 +28,8 @@
import com.hdl.photovoltaic.ui.test.TestMainActivity;
import com.hdl.photovoltaic.utils.GlideUtils;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
import org.greenrobot.eventbus.EventBus;
/**
 * 我的-界面
@@ -62,11 +63,12 @@
     */
    private void initData() {
//        showLoading();
        if (UserConfigManage.getInstance().isBAccount()) {
            this.getBUserInfo();
        } else {
            this.getCMemberInfo();
        }
//        if (UserConfigManage.getInstance().isBAccount()) {
//            this.getBUserInfo();
//        } else {
//            this.getCMemberInfo();
//        }
        //因为uni那边需要,启动的时候就读取啦
        this.getResidenceTemperatureUnit();
    }
@@ -256,13 +258,24 @@
    @Override
    public void onEventMessage(BaseEventBus eventBus) {
        super.onEventMessage(eventBus);
        if (eventBus == null) {
            return;
        }
        //接收外部点击事件
        if (eventBus.getTopic().equals(ConstantManage.homepage_title_tab_switch)) {
            if (eventBus.getType().equals(HomepageTitleTabSwitch.me.toString())) {
                //
                HdlLogLogic.print("正在点击【我的】");
                //读取头像
                if (UserConfigManage.getInstance().isBAccount()) {
                    this.getBUserInfo();
                } else {
                    this.getCMemberInfo();
                }
                // 取消粘性事件
                EventBus.getDefault().removeStickyEvent(eventBus);
            }
        }
    }
    /**
@@ -279,10 +292,10 @@
                    JSONObject jsonObject = new Gson().fromJson(json, JSONObject.class);
                    if (jsonObject.containsKey("tempType")) {
                        String unit = jsonObject.getString("tempType");
                        if(unit.contains("C")){
                            unit="℃";
                        }else{
                            unit= "℉";
                        if (unit.contains("C")) {
                            unit = "℃";
                        } else {
                            unit = "℉";
                        }
                        UserConfigManage.getInstance().setTemperature_unit(unit);
                        UserConfigManage.getInstance().Save();
@@ -294,7 +307,7 @@
            @Override
            public void onFailure(HDLException e) {
                HdlLogLogic.print("获取用户自定义配置温度单位详情--->" + e.getMessage() + "(" + e.getCode() + ")", true);
                HdlLogLogic.print("获取用户自定义配置温度单位详情--->" + e.getMsg() + "(" + e.getCode() + ")", true);
//                HdlThreadLogic.toast(_mActivity, e);
            }
        });