| | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.graphics.Bitmap; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | |
| | | import com.driver.igotrip.R; |
| | |
| | | * @param s 提示文字 |
| | | */ |
| | | protected void showToast(String s) { |
| | | if(TextUtils.isEmpty(s)){ |
| | | return; |
| | | } |
| | | Toast.create(context).show(s); |
| | | } |
| | | |
| | |
| | | |
| | | class ChangPhoneActivity : MyBaseActivity() { |
| | | |
| | | private lateinit var recaptcha: RecaptchaVisual |
| | | // private lateinit var recaptcha: RecaptchaVisual |
| | | |
| | | private val areaCode by lazy { find<TextView>(R.id.areaCode) } |
| | | val et_login_code_send by lazy { find<TextView>(R.id.et_login_code_send) } |
| | |
| | | } |
| | | |
| | | override fun initView() { |
| | | recaptcha = RecaptchaVisual(supportFragmentManager, WEB_SITE_KEY, BASE_URL) |
| | | // recaptcha = RecaptchaVisual(supportFragmentManager, WEB_SITE_KEY, BASE_URL) |
| | | val lang = SPUtils.getString(Const.language) |
| | | if (lang == "fr") { |
| | | et_login_code_send.setTextSize(TypedValue.COMPLEX_UNIT_SP, 11f) |
| | |
| | | private fun sendSms() { |
| | | lifecycleScope.launch { |
| | | try { |
| | | val token = recaptcha.runCaptcha().await() |
| | | // val token = recaptcha.runCaptcha().await() |
| | | |
| | | val map = getMapByAny() |
| | | map["phone"] = areaCode.getAreaCode() + et_login_phone.getContent().trim() |
| | | map["kaptcha"] = "kaptcha" |
| | | map["type"] = 1 |
| | | map["token"] = token |
| | | // map["token"] = token |
| | | callNet(Api.queryCaptcha, map) { |
| | | refreshTime(et_login_code_send) |
| | | } |
| | |
| | | private val tv_phone by lazy { find<TextView>(R.id.tv_phone) } |
| | | private val tv_next by lazy { find<TextView>(R.id.tv_next) } |
| | | |
| | | private lateinit var recaptcha: RecaptchaVisual |
| | | // private lateinit var recaptcha: RecaptchaVisual |
| | | |
| | | override fun tvInit(tv_code: TextView) { |
| | | et_login_code_send.text = getString(R.string.获取验证码) |
| | |
| | | et_login_pwd.setTextSize(TypedValue.COMPLEX_UNIT_SP,12f) |
| | | et_login_code_send.setTextSize(TypedValue.COMPLEX_UNIT_SP,12f) |
| | | } |
| | | recaptcha = RecaptchaVisual(supportFragmentManager, WEB_SITE_KEY, BASE_URL) |
| | | // recaptcha = RecaptchaVisual(supportFragmentManager, WEB_SITE_KEY, BASE_URL) |
| | | } |
| | | |
| | | override fun onResume() { |
| | |
| | | private fun sendSms() { |
| | | lifecycleScope.launch { |
| | | try { |
| | | val token = recaptcha.runCaptcha().await() |
| | | // val token = recaptcha.runCaptcha().await() |
| | | |
| | | var map = getMapByAny() |
| | | map["phone"] = CacheKey.getUserInfo().phone |
| | | map["kaptcha"] = "kaptcha" |
| | | map["type"] = 4 |
| | | map["token"] = token |
| | | // map["token"] = token |
| | | callNet(Api.queryCaptcha, map) { |
| | | refreshTime(et_login_code_send) |
| | | } |
| | |
| | | var selectPhone = 0 //1 身份证 2:头像 3:驾驶证 4:网约车资格证 5 身份证背面 |
| | | |
| | | var array = arrayListOf<String>() |
| | | private lateinit var recaptcha: RecaptchaVisual |
| | | // private lateinit var recaptcha: RecaptchaVisual |
| | | |
| | | private val areaCode by lazy { find<TextView>(R.id.areaCode) } |
| | | private val et_collection_code by lazy { find<TextView>(R.id.et_collection_code) } |
| | |
| | | array.add(getString(R.string.包裹_简单)) |
| | | tv_Right.text = "" |
| | | tv_Right.gone() |
| | | recaptcha = RecaptchaVisual(supportFragmentManager, WEB_SITE_KEY, BASE_URL) |
| | | // recaptcha = RecaptchaVisual(supportFragmentManager, WEB_SITE_KEY, BASE_URL) |
| | | } |
| | | |
| | | private var chooseid = -1 |
| | |
| | | private fun sendSms() { |
| | | lifecycleScope.launch { |
| | | try { |
| | | val token = recaptcha.runCaptcha().await() |
| | | // val token = recaptcha.runCaptcha().await() |
| | | |
| | | logRecord("okhttp","token = $token") |
| | | // logRecord("okhttp","token = $token") |
| | | var map = getMapByAny() |
| | | map["kaptcha"] = "kaptcha" |
| | | map["token"] = token |
| | | // map["token"] = token |
| | | |
| | | map["phone"] = areaCode.getAreaCode() + et_login_phone.getString() |
| | | map["type"] = 3 |