| | |
| | | import com.hdl.photovoltaic.config.AppConfigManage; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.databinding.ActivityChangePasswordBinding; |
| | | import com.hdl.photovoltaic.enums.VerifyType; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlAccountLogic; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.utils.GPSManagerUtils; |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.photovoltaic.widget.ConfirmationTipDialog; |
| | | import com.sahooz.library.countrypicker.Country; |
| | |
| | | switchPhoneOrMailView(); |
| | | try { |
| | | Country.load(this); |
| | | Country country = null; |
| | | if (TextUtils.isEmpty(GPSManagerUtils.getInstance().getCountryCode(this))) { |
| | | //再根据系统语言 |
| | | country = Country.getCountryInfo(); |
| | | } else { |
| | | //先根据定位 |
| | | country = Country.getLocationCountryInfo(GPSManagerUtils.getInstance().getCountryCode(this)); |
| | | } |
| | | if (country != null) { |
| | | viewBinding.regionAccountTv.setText(country.translate); |
| | | viewBinding.regionAccountNumberTv.setText("+" + country.code); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | verification_code = viewBinding.changeMailVerificationEt.getText().toString(); |
| | | } |
| | | if (UserConfigManage.getInstance().isBAccount()) { |
| | | HdlAccountLogic.getInstance().changePassword_B(isPhoneType, account, psw, verification_code, new CloudCallBeak<Boolean>() { |
| | | HdlAccountLogic.getInstance().changePassword_B(isPhoneType, account, psw, verification_code, viewBinding.regionAccountNumberTv.getText().toString(), new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | |
| | | } |
| | | }); |
| | | } else { |
| | | HdlAccountLogic.getInstance().changePassword_C(isPhoneType, account, psw, verification_code, new CloudCallBeak<Boolean>() { |
| | | HdlAccountLogic.getInstance().changePassword_C(isPhoneType, account, psw, verification_code, viewBinding.regionAccountNumberTv.getText().toString(), new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | |
| | | //设置账号所在区域协议及地址 |
| | | AppConfigManage.setUserRegionUrl(obj.getRegionUrl()); |
| | | HDLLinkPMUser.getInstance().setUserRegionUrl(AppConfigManage.getUserRegionUrl()); |
| | | HdlAccountLogic.getInstance().sendVerifyCode(isPhoneType, account, viewBinding.regionAccountNumberTv.getText().toString(), 2, new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | if (isPhoneType) { |
| | | phoneCountDownTimer.start(); |
| | | } else { |
| | | mailCountDownTimer.start(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | HdlThreadLogic.toast(_mActivity, e); |
| | | } |
| | | }); |
| | | |
| | | if (UserConfigManage.getInstance().isBAccount()) { |
| | | //B端发送获取验证码 |
| | | HdlAccountLogic.getInstance().sendVerifyCode_B(isPhoneType, account, viewBinding.regionAccountNumberTv.getText().toString(), VerifyType.VerifyType_FIND_PASSWORD, new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | if (isPhoneType) { |
| | | phoneCountDownTimer.start(); |
| | | } else { |
| | | mailCountDownTimer.start(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | HdlThreadLogic.toast(_mActivity, e); |
| | | } |
| | | }); |
| | | } else { |
| | | //C端发送获取验证码 |
| | | HdlAccountLogic.getInstance().sendVerifyCode_C(isPhoneType, account, viewBinding.regionAccountNumberTv.getText().toString(), VerifyType.VerifyType_2, new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | if (isPhoneType) { |
| | | phoneCountDownTimer.start(); |
| | | } else { |
| | | mailCountDownTimer.start(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | HdlThreadLogic.toast(_mActivity, e); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | @Override |