From a0e8f81afc4fe2a21a5c504d53e569ea50d463d6 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期五, 15 三月 2024 11:51:23 +0800
Subject: [PATCH] 2024年03月15日11:51:17
---
app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java | 44 +++++++++++++++++++++++++++++++-------------
1 files changed, 31 insertions(+), 13 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..2e624aa 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
@@ -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閭h竟闇�瑕侊紝鍚姩鐨勬椂鍊欏氨璇诲彇鍟�
this.getResidenceTemperatureUnit();
}
@@ -158,6 +160,11 @@
viewBinding.fragmentMeIconParentCl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
+ if (UserConfigManage.getInstance().isBAccount()) {
+ //todo B绔笉鏀寔鏇存敼鏄电О
+ HdlThreadLogic.toast(_mActivity, R.string.loading_not_supported);
+ return;
+ }
Intent intent = new Intent();
intent.setClass(_mActivity, PersonalDataActivity.class);
if (mC_UserInfo == null) {
@@ -256,13 +263,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 +297,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 +312,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);
}
});
--
Gitblit v1.8.0