bank账号验证 保存
This commit is contained in:
parent
65290af1ea
commit
5a1dc499a7
|
|
@ -4,5 +4,6 @@ object VididinEvents {
|
|||
const val Event_Sign_State_Changed = 600
|
||||
const val Event_Account_Gold_Changed = 601
|
||||
const val Event_Account_Cash_Changed = 602
|
||||
const val Event_Account_Bank_Info_Changed = 603
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.gamedog.vididin.features.withdraw
|
||||
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
|
|
@ -8,6 +9,7 @@ import androidx.core.view.isVisible
|
|||
import com.ama.core.architecture.util.setOnClickBatch
|
||||
import com.ama.core.architecture.widget.BindingDialog
|
||||
import com.gamedog.vididin.R
|
||||
import com.gamedog.vididin.core.login.login.AccountManager
|
||||
import com.gamedog.vididin.databinding.DialogWithdrawBindingBankBinding as ViewBinding
|
||||
import com.gamedog.vididin.router.Router
|
||||
|
||||
|
|
@ -28,9 +30,13 @@ class WithdrawBindBankDialog(context: Context) : BindingDialog<ViewBinding>(cont
|
|||
mBinding.run {
|
||||
setOnClickBatch(tvConfirm, ivClose) {
|
||||
when (this) {
|
||||
tvConfirm, ivClose -> {
|
||||
ivClose -> {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
tvConfirm -> {
|
||||
saveBankAccount(mBinding.tvCpfEdit.text.toString().trim())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,6 +71,10 @@ class WithdrawBindBankDialog(context: Context) : BindingDialog<ViewBinding>(cont
|
|||
checkBankAccountValidation("")
|
||||
}
|
||||
|
||||
private fun saveBankAccount(bankAccount: String) {
|
||||
AccountManager.saveBankAccount(bankAccount)
|
||||
}
|
||||
|
||||
private fun checkBankAccountValidation(bankAccount: String) {
|
||||
// TODO - forTesting- contain "B"
|
||||
if (BankUtil.isValidCpf(bankAccount) || bankAccount.contains("B")) {
|
||||
|
|
|
|||
|
|
@ -60,5 +60,12 @@ object AccountManager {
|
|||
return !backInfo?.bankName.isNullOrEmpty() && !backInfo.bankAccount.isNullOrEmpty()
|
||||
}
|
||||
|
||||
fun saveBankAccount(bankAccount: String) {
|
||||
mAccount?.bankInfo = BankInfo(bankAccount=bankAccount)
|
||||
saveAccountInfo()
|
||||
NotifyMan.instance().sendEvent(
|
||||
VididinEvents.Event_Account_Bank_Info_Changed, NotifyMan.NotifyData(bankAccount))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue