| | |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlResidenceLogic; |
| | | import com.hdl.photovoltaic.ui.bean.HouseInfoBean; |
| | | import com.hdl.photovoltaic.utils.LocalManageUtil; |
| | | import com.hdl.photovoltaic.utils.SharedPreUtils; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | return sUserConfigManage; |
| | | } |
| | | |
| | | |
| | | //uni一级界面的安全距离背景颜色(0=电站详情界面,1=添加电站界面,2=设备调测界面) |
| | | private int uniBottomSafeDistanceBackgroundColor; |
| | | //当前账号:刷新Token用的token(不用记录什么有效期,如果刷新失败,就踢人即可) |
| | | private String refreshToken; |
| | | //账户登录成功时的时间 |
| | |
| | | private String userId; |
| | | //当前的住宅ID |
| | | private String homeId; |
| | | |
| | | |
| | | private String homeName; |
| | | //是否登录状态 |
| | | private boolean isLogin; |
| | | //本地通讯秘钥 |
| | |
| | | //远程连接的Mqtt的客户端ID |
| | | public String connEmqClientId; |
| | | //当前登录的账号是不是之前的账号 |
| | | public boolean theSameLoginAccount; |
| | | private boolean theSameLoginAccount; |
| | | |
| | | //绑定手机号 |
| | | private String bingPhone; |
| | | //绑定邮箱 |
| | | private String bingEmail; |
| | | |
| | | //温度单位(C摄氏度;F=华氏度) |
| | | private String temperature_unit = "℃"; |
| | | |
| | | //app当前的语言 |
| | | private String currentAppLanguage; |
| | | |
| | | |
| | | //用户头像 |
| | | private String userImageUrl = "/static/image/user-default-head.png"; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 注册极光ID |
| | | /// </summary> |
| | | public String registrationID; |
| | | /// <summary> |
| | | /// 添加极光ID到云端成功时返回的 |
| | | /// </summary> |
| | | public String pushId; |
| | | |
| | | public String getUserImageUrl() { |
| | | return userImageUrl == null ? "/static/image/user-default-head.png" : userImageUrl; |
| | | } |
| | | |
| | | public void setUserImageUrl(String userImageUrl) { |
| | | this.userImageUrl = userImageUrl; |
| | | } |
| | | |
| | | public String getRegistrationID() { |
| | | return registrationID == null ? "" : registrationID; |
| | | } |
| | | |
| | | public void setRegistrationID(String registrationID) { |
| | | this.registrationID = registrationID; |
| | | } |
| | | |
| | | public String getPushId() { |
| | | return pushId == null ? "" : pushId; |
| | | } |
| | | |
| | | public void setPushId(String pushId) { |
| | | this.pushId = pushId; |
| | | } |
| | | |
| | | public String getCurrentAppLanguage() { |
| | | return currentAppLanguage; |
| | | } |
| | | |
| | | public void setCurrentAppLanguage(String currentAppLanguage) { |
| | | this.currentAppLanguage = currentAppLanguage; |
| | | } |
| | | |
| | | public String getTemperature_unit() { |
| | | return temperature_unit; |
| | | } |
| | | |
| | | public void setTemperature_unit(String temperature_unit) { |
| | | this.temperature_unit = temperature_unit; |
| | | } |
| | | |
| | | public String getBingPhone() { |
| | | return bingPhone == null ? "" : bingPhone; |
| | | } |
| | | |
| | | public void setBingPhone(String bingPhone) { |
| | | this.bingPhone = bingPhone; |
| | | } |
| | | |
| | | |
| | | public String getBingEmail() { |
| | | return bingEmail == null ? "" : bingEmail; |
| | | } |
| | | |
| | | public void setBingEmail(String bingEmail) { |
| | | this.bingEmail = bingEmail; |
| | | } |
| | | |
| | | /** |
| | | * 用户名称 |
| | |
| | | this.homeId = homeId; |
| | | } |
| | | |
| | | public String getHomeName() { |
| | | return homeName == null ? "" : homeName; |
| | | } |
| | | |
| | | public void setHomeName(String homeName) { |
| | | this.homeName = homeName; |
| | | } |
| | | |
| | | public boolean isAcceiptPolicy() { |
| | | return acceiptPolicy; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * uni一级界面的安全距离背景颜色(0=电站详情界面,1=添加电站界面,2=设备调测界面) |
| | | * |
| | | * @return 值 |
| | | */ |
| | | public int getUniBottomSafeDistanceBackgroundColor() { |
| | | return uniBottomSafeDistanceBackgroundColor; |
| | | } |
| | | |
| | | public void setUniBottomSafeDistanceBackgroundColor(int uniBottomSafeDistanceBackgroundColor) { |
| | | this.uniBottomSafeDistanceBackgroundColor = uniBottomSafeDistanceBackgroundColor; |
| | | } |
| | | |
| | | /** |
| | | * 当前住宅 |
| | | */ |
| | | private HouseInfoBean m_Home = null; |
| | |
| | | * 刷新 |
| | | */ |
| | | private void reFresh() { |
| | | String str = HdlFileLogic.getInstance().readFile(FILENAME); |
| | | String str = HdlFileLogic.getInstance().readFile(HdlFileLogic.getInstance().getUserFilePath()); |
| | | // String str =SharedPreUtils.getSharedPreferencesKey("UserConfigManage.json",HDLApp.getInstance()); |
| | | if (!TextUtils.isEmpty(str) && str.length() > 0) { |
| | | //读取保存的数据 |
| | |
| | | */ |
| | | public void Save() { |
| | | if (sUserConfigManage == null) { |
| | | HdlLogLogic.print("UserConfigManage", "保存用户信息文件失败"); |
| | | HdlLogLogic.print("UserConfigManage保存用户信息文件失败", false); |
| | | return; |
| | | } |
| | | Gson gson = new Gson(); |
| | | String json = gson.toJson(sUserConfigManage); |
| | | HdlFileLogic.getInstance().writeFile(FILENAME, json); |
| | | HdlFileLogic.getInstance().writeFile(HdlFileLogic.getInstance().getUserFilePath(), json); |
| | | // SharedPreUtils.saveMyDataInfo("UserConfigManage.json", json, HDLApp.getInstance()); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// Config文件名 |
| | | /// </summary> |
| | | private static final String FILENAME = HdlFileLogic.getInstance().getAPPInternalStoreFilesPath() + "/UserConfigManage.json"; |
| | | /** |
| | | * true表示是中文 |
| | | * |
| | | * @return true表示是中文 |
| | | */ |
| | | public boolean isZh() { |
| | | return currentAppLanguage.equals(LocalManageUtil.zh); |
| | | } |
| | | |
| | | |
| | | } |