| | |
| | | import android.text.InputFilter |
| | | import android.text.Spanned |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.utils.StringUtils |
| | | import cn.sinata.xldutils.utils.clickDelay |
| | | import cn.sinata.xldutils.utils.getContent |
| | | import com.zhaoyang.driver.R |
| | |
| | | |
| | | override fun setOnclick() { |
| | | tv_get_money.clickDelay { |
| | | // if (et_money.getContent().isEmpty()){ |
| | | // toast("请输入提现金额") |
| | | // return@clickDelay |
| | | // } |
| | | // if (et_money.getContent().toDouble() > maxMoney){ |
| | | // toast("提现金额不能超过最大余额") |
| | | // return@clickDelay |
| | | // } |
| | | if (et_money.getContent().isEmpty()){ |
| | | toast("请输入提现金额") |
| | | return@clickDelay |
| | | } |
| | | if (et_money.getContent().toDouble() > maxMoney){ |
| | | toast("提现金额不能超过最大余额") |
| | | return@clickDelay |
| | | } |
| | | if (bankBean == null){ |
| | | toast("请选择银行卡") |
| | | toast("请选择到账支付宝") |
| | | return@clickDelay |
| | | } |
| | | if (maxMoney <= 0){ |
| | | toast("没有余额") |
| | | return@clickDelay |
| | | } |
| | | DialogUtil.getDelAndSureDialog(this,"您将提取金额为"+maxMoney.toString()+"元!",{}){ |
| | | DialogUtil.getDelAndSureDialog(this,"您将提取金额为%.2f元!".format(et_money.text.toString().toDouble()),{}){ |
| | | var map = getMapByAny() |
| | | map["code"] = bankBean!!.code |
| | | map["money"] = maxMoney |
| | | map["name"] = bankBean!!.name |
| | | map["id"] = bankBean!!.id |
| | | map["money"] = et_money.text.toString().toDouble() |
| | | map["type"] = type |
| | | map["bankName"] = bankBean!!.bankName |
| | | callNet(Api.withdrawal,map){ |
| | | DialogUtil.getOnlySureDialog(this, "提交成功!我们将尽快为您处理!") { |
| | | onBackPressed() |
| | |
| | | adapter.notifyDataSetChanged() |
| | | if (adapter.data.isNullOrEmpty()){ |
| | | pop.dismiss() |
| | | toast("暂未绑定银行卡,请前往绑定银行卡") |
| | | toast("暂未查询到支付宝账号,请前往设置") |
| | | } |
| | | adapter.setOnItemClickListener { view, position -> |
| | | bankBean = adapter.data[position] |
| | | tv_select_card.text = adapter.data[position].bank |
| | | tv_select_card.text ="${bankBean!!.userName.substring(0,1)}${if (bankBean!!.userName.length == 2) "*" else "**"} ${StringUtils.hidePhoneNumber(bankBean!!.account)}" |
| | | pop.dismiss() |
| | | } |
| | | }){ |