| | |
| | | */ |
| | | 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(); |
| | | } |
| | | |
| | |
| | | //接收外部点击事件 |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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(); |