| | |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.photovoltaic.widget.ConfirmationTipDialog; |
| | | import com.sahooz.library.countrypicker.Country; |
| | | import com.sahooz.library.countrypicker.CountryPickerFragment; |
| | | import com.sahooz.library.countrypicker.PickCountryCallback; |
| | | |
| | | /** |
| | | * 忘记密码界面 |
| | |
| | | */ |
| | | private void initView() { |
| | | switchPhoneOrMailView(); |
| | | try { |
| | | Country.load(this); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | HdlCommonLogic.getInstance().setSpan(viewBinding.changePhoneVerificationTv, viewBinding.changePhoneVerificationTv.getText().toString(), true,null); |
| | | HdlCommonLogic.getInstance().setSpan(viewBinding.changeMailVerificationTv, viewBinding.changeMailVerificationTv.getText().toString(), true,null); |
| | | } |
| | |
| | | |
| | | } |
| | | }); |
| | | //选择手机区号的 |
| | | viewBinding.regionAccountRl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | selectArea(); |
| | | } |
| | | }); |
| | | |
| | | //输入手机号或者邮箱 |
| | | viewBinding.changeAccountEt.addTextChangedListener(accountTextWatcher); |
| | | //手机号获取验证码 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 国家手机号区号弹窗 |
| | | */ |
| | | private void selectArea() { |
| | | CountryPickerFragment dialog = new CountryPickerFragment(this, new PickCountryCallback() { |
| | | @Override |
| | | public void onPick(Country country) { |
| | | if (country.flag != 0) viewBinding.regionAccountTv.setText(country.name); |
| | | viewBinding.regionAccountNumberTv.setText("+" + country.code); |
| | | } |
| | | }); |
| | | dialog.show(); |
| | | dialog.setDialogSize(); |
| | | } |
| | | |
| | | /** |
| | | * 发送验证码指令 |
| | | */ |
| | | private void sendVerification() { |
| | |
| | | //设置账号所在区域协议及地址 |
| | | AppConfigManage.setUserRegionUrl(obj.getRegionUrl()); |
| | | HDLLinkPMUser.getInstance().setUserRegionUrl(AppConfigManage.getUserRegionUrl()); |
| | | HdlAccountLogic.getInstance().sendVerifyCode(isPhoneType, account, "86", 2, new CloudCallBeak<Boolean>() { |
| | | HdlAccountLogic.getInstance().sendVerifyCode(isPhoneType, account, viewBinding.regionAccountNumberTv.getText().toString(), 2, new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | if (isPhoneType) { |
| | |
| | | viewBinding.changeMailRl.accountTitleTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); |
| | | viewBinding.changeMailRl.lineV.setVisibility(View.GONE); |
| | | |
| | | |
| | | viewBinding.regionAccountRl.setVisibility(View.VISIBLE); |
| | | //输入手机号 |
| | | viewBinding.changeAccountEt.setInputType(InputType.TYPE_CLASS_NUMBER); |
| | | viewBinding.changeAccountEt.setHint(R.string.home_login_input_phone); |
| | |
| | | viewBinding.changeMailRl.accountTitleTv.setTextSize(18); |
| | | viewBinding.changeMailRl.accountTitleTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF)); |
| | | viewBinding.changeMailRl.lineV.setVisibility(View.VISIBLE); |
| | | |
| | | viewBinding.regionAccountRl.setVisibility(View.GONE); |
| | | //输入邮箱 |
| | | viewBinding.changeAccountEt.setInputType(InputType.TYPE_CLASS_TEXT); |
| | | viewBinding.changeAccountEt.setHint(R.string.home_login_input_mail); |