| | |
| | | myToast("请输入正确的手机号") |
| | | else{ |
| | | tv_code.isEnabled = false |
| | | HttpManager.getCode(phone,2).request(this@ChangePhoneActivity,success = { _, _-> |
| | | HttpManager.getCode(phone,5).request(this@ChangePhoneActivity,success = { _, _-> |
| | | timer.start() |
| | | }){_,_-> |
| | | tv_code.isEnabled = true |
| | |
| | | myToast("请输入6位验证码") |
| | | return@onClick |
| | | } |
| | | HttpManager.updatePhone(phone, code).request(this@ChangePhoneActivity){_,_-> |
| | | myToast("修改成功") |
| | | HttpManager.changePhone(code, phone).request(this@ChangePhoneActivity){_,_-> |
| | | SPUtils.instance().put(Const.User.USER_PHONE,"").put(Const.User.TOKEN,"").put(Const.User.USER_ID,"") |
| | | .put("isHint",false) |
| | | .apply() |
| | | (application as JkApplication).exit() |
| | | startActivity<LoginActivity>() |
| | | startActivity<ChangePhoneSucActivity>() |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | override fun onTick(millisUntilFinished: Long) { |
| | | tv_code.text = "${millisUntilFinished/1000}s" |
| | | tv_code.text = "${millisUntilFinished/1000}s后可重新获取" |
| | | } |
| | | } |
| | | } |