package com.driver.igotrip.ui.card
|
|
import android.widget.EditText
|
import android.widget.TextView
|
import cn.sinata.rxnetty.LogHelper
|
import cn.sinata.xldutils.utils.setDrawableNull
|
import cn.sinata.xldutils.utils.setTextChange
|
import com.driver.igotrip.R
|
import com.driver.igotrip.base.MyBaseActivity
|
import com.driver.igotrip.netUtls.Api
|
import com.driver.igotrip.netUtls.callNet
|
import com.driver.igotrip.netUtls.getMapByAny
|
import com.driver.igotrip.ui.mine.money_bag.ApplyMoneyActivity
|
import org.jetbrains.anko.find
|
import org.jetbrains.anko.startActivity
|
import org.jetbrains.anko.toast
|
|
class VerifyCardPwdActivity : MyBaseActivity() {
|
override fun setContentView() {
|
setContentView(R.layout.verify_card_pwd)
|
}
|
|
private val et_pwd by lazy { find<EditText>(R.id.et_pwd) }
|
private val tv_one by lazy { find<TextView>(R.id.tv_one) }
|
private val tv_two by lazy { find<TextView>(R.id.tv_two) }
|
private val tv_three by lazy { find<TextView>(R.id.tv_three) }
|
private val tv_four by lazy { find<TextView>(R.id.tv_four) }
|
private val tv_fif by lazy { find<TextView>(R.id.tv_fif) }
|
private val tv_six by lazy { find<TextView>(R.id.tv_six) }
|
|
|
override fun initView() {
|
setTitleText(getString(R.string.申请提现))
|
setBottomShow(false)
|
tv_Left.text = getString(R.string.取消)
|
tv_Left.setDrawableNull()
|
}
|
|
override fun setOnclick() {
|
et_pwd.setTextChange {
|
tv_one.text = ""
|
tv_two.text = ""
|
tv_three.text = ""
|
tv_four.text = ""
|
tv_fif.text = ""
|
tv_six.text = ""
|
val str = it.toCharArray()
|
for (position in str.indices) {
|
when (position) {
|
0 -> {
|
tv_one.text = "*"
|
}
|
|
1 -> {
|
tv_two.text = "*"
|
|
}
|
|
2 -> {
|
tv_three.text = "*"
|
|
}
|
|
3 -> {
|
tv_four.text = "*"
|
|
}
|
|
4 -> {
|
tv_fif.text = "*"
|
|
}
|
|
5 -> {
|
tv_six.text = "*"
|
}
|
|
}
|
}
|
if (str.size == 6) {
|
val map = getMapByAny()
|
map["withdrawPassword"] = it
|
callNet(Api.verificationWithdrawPassword, map, {
|
LogHelper.logRecord("申请提现提现密码验证成功type:${intent.getStringExtra("type")}")
|
toast(getString(R.string.验证成功))
|
startActivity<ApplyMoneyActivity>("type" to intent.getStringExtra("type"))
|
finish()
|
}) { code, msg ->
|
LogHelper.logRecord("申请提现提现密码验证失败type:${intent.getStringExtra("type")} code:${code} msg:${msg}")
|
onBackPressed()
|
}
|
}
|
}
|
}
|
}
|