From cd8598204820d85f4f1b3714622e718579bc955d Mon Sep 17 00:00:00 2001 From: renhaoting <370797079@qq.com> Date: Mon, 29 Dec 2025 11:43:28 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9=20-=20=E4=B8=8D=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E6=8E=A5=E5=8F=97=20=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/withdraw/WithDrawActivity.kt | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/com/gamedog/vididin/features/withdraw/WithDrawActivity.kt b/app/src/main/java/com/gamedog/vididin/features/withdraw/WithDrawActivity.kt index c24dd73..288be16 100644 --- a/app/src/main/java/com/gamedog/vididin/features/withdraw/WithDrawActivity.kt +++ b/app/src/main/java/com/gamedog/vididin/features/withdraw/WithDrawActivity.kt @@ -209,43 +209,41 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity() { 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) } } }