From d1ebb94e1a17b7c25d4fcf73d85345d92cc86b5c Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 02 一月 2024 18:41:34 +0800
Subject: [PATCH] 2024年01月02日18:41:32
---
app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java | 36 +++++++++++++++++++++++++-----------
1 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java
index 7971280..b7edec6 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java
@@ -30,6 +30,8 @@
import com.hdl.photovoltaic.utils.GlideUtils;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
+import org.greenrobot.eventbus.EventBus;
+
/**
* 鎴戠殑-鐣岄潰
*/
@@ -62,11 +64,12 @@
*/
private void initData() {
// showLoading();
- if (UserConfigManage.getInstance().isBAccount()) {
- this.getBUserInfo();
- } else {
- this.getCMemberInfo();
- }
+// if (UserConfigManage.getInstance().isBAccount()) {
+// this.getBUserInfo();
+// } else {
+// this.getCMemberInfo();
+// }
+ //鍥犱负uni閭h竟闇�瑕侊紝鍚姩鐨勬椂鍊欏氨璇诲彇鍟�
this.getResidenceTemperatureUnit();
}
@@ -256,13 +259,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("姝e湪鐐瑰嚮銆愭垜鐨勩��");
+ //璇诲彇澶村儚
+ if (UserConfigManage.getInstance().isBAccount()) {
+ this.getBUserInfo();
+ } else {
+ this.getCMemberInfo();
+ }
+ // 鍙栨秷绮樻�т簨浠�
+ EventBus.getDefault().removeStickyEvent(eventBus);
}
+
}
+
}
/**
@@ -279,10 +293,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();
--
Gitblit v1.8.0