bug修改 - 不多次接受 结果
This commit is contained in:
parent
b3fb4f0327
commit
cd85982048
|
|
@ -209,43 +209,41 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
|
|||
|
||||
private fun requestInit(withdrawNum: Float) {
|
||||
lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
viewModel.InitData.collect { result ->
|
||||
when (result) {
|
||||
is Result.Loading -> {
|
||||
viewModel.InitData.collect { result ->
|
||||
when (result) {
|
||||
is Result.Loading -> {
|
||||
|
||||
}
|
||||
is Result.Success -> {
|
||||
val reqInitBean = result.data.data
|
||||
}
|
||||
is Result.Success -> {
|
||||
val reqInitBean = result.data.data
|
||||
|
||||
reqInitBean?.let {
|
||||
var errorHintRes = 0
|
||||
|
||||
if (it.error == 0 && !it.uuid.isNullOrEmpty() && !it.items.isNullOrEmpty()) {
|
||||
val itemId = if (withdrawNum <= VidiConst.WITHDRAW_SMALL_NUM) 0 else 1
|
||||
val withDrawItem = it.items?.get(itemId)!!
|
||||
if (withDrawItem.status == INIT_ACTIVE) {
|
||||
requestPayout(it.uuid!!, withDrawItem.id, withdrawNum)
|
||||
} else {
|
||||
errorHintRes = R.string.withdraw_fail_reach_day_limit
|
||||
}
|
||||
reqInitBean?.let {
|
||||
var errorHintRes = 0
|
||||
|
||||
if (it.error == 0 && !it.uuid.isNullOrEmpty() && !it.items.isNullOrEmpty()) {
|
||||
val itemId = if (withdrawNum <= VidiConst.WITHDRAW_SMALL_NUM) 0 else 1
|
||||
val withDrawItem = it.items?.get(itemId)!!
|
||||
if (withDrawItem.status == INIT_ACTIVE) {
|
||||
requestPayout(it.uuid!!, withDrawItem.id, withdrawNum)
|
||||
} else {
|
||||
// 0成功,1失败,2签名验证失败,3客户端版本过低,4 ts长度错误
|
||||
when (it.error) {
|
||||
3-> errorHintRes = R.string.withdraw_fail_version_toolow
|
||||
}
|
||||
errorHintRes = R.string.withdraw_fail_reach_day_limit
|
||||
}
|
||||
|
||||
if (errorHintRes > 0) {
|
||||
showFailDialog(errorHintRes)
|
||||
} else {
|
||||
// 0成功,1失败,2签名验证失败,3客户端版本过低,4 ts长度错误
|
||||
when (it.error) {
|
||||
3-> errorHintRes = R.string.withdraw_fail_version_toolow
|
||||
}
|
||||
}
|
||||
|
||||
if (errorHintRes > 0) {
|
||||
showFailDialog(errorHintRes)
|
||||
}
|
||||
}
|
||||
is Result.Error -> {
|
||||
showFailDialog(R.string.withdraw_fail_unkown_error)
|
||||
}
|
||||
|
||||
}
|
||||
is Result.Error -> {
|
||||
showFailDialog(R.string.withdraw_fail_unkown_error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue