package com.fuban.driver.ui.card
|
|
import cn.sinata.xldutils.utils.setDrawableNull
|
import cn.sinata.xldutils.utils.setTextChange
|
import com.fuban.driver.R
|
import com.fuban.driver.base.MyBaseActivity
|
import com.fuban.driver.netUtls.Api
|
import com.fuban.driver.netUtls.callNet
|
import com.fuban.driver.netUtls.getMapByAny
|
import kotlinx.android.synthetic.main.verify_card_pwd.*
|
import org.jetbrains.anko.startActivity
|
import org.jetbrains.anko.toast
|
|
class VerifyCardPwdActivity : MyBaseActivity() {
|
override fun setContentView() {
|
setContentView(R.layout.verify_card_pwd)
|
}
|
|
override fun initView() {
|
setTitleText("")
|
setBottomShow(false)
|
tv_Left.text = "取消"
|
tv_Left.setDrawableNull()
|
}
|
|
override fun setOnclick() {
|
et_pwd.setTextChange {
|
var str = it.toCharArray()
|
for (position in str.indices) {
|
when (position) {
|
0 -> {
|
tv_one.text = str[position].toString()
|
}
|
1 -> {
|
tv_two.text = str[position].toString()
|
|
}
|
2 -> {
|
tv_three.text = str[position].toString()
|
|
}
|
3 -> {
|
tv_four.text = str[position].toString()
|
|
}
|
4 -> {
|
tv_fif.text = str[position].toString()
|
|
}
|
5 -> {
|
tv_six.text = str[position].toString()
|
|
}
|
|
}
|
}
|
if (str.size == 6) {
|
var map = getMapByAny()
|
map["withdrawPassword"] = it
|
callNet(Api.verificationWithdrawPassword, map,{
|
toast("验证成功")
|
startActivity<AddCardActivity>()
|
finish()
|
}) {
|
onBackPressed()
|
}
|
}
|
}
|
}
|
}
|