18034727885
2026-08-07 bbc64160643c4ed818eb574831dc303b0a979089
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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()
                }
            }
        }
    }
}