check 参数
This commit is contained in:
parent
3dfeaf54bf
commit
5e86192b93
|
|
@ -28,4 +28,4 @@ data class PayoutReq(
|
||||||
var dataShuShu: PbReportDataShuShu = PbReportDataShuShu(),
|
var dataShuShu: PbReportDataShuShu = PbReportDataShuShu(),
|
||||||
) : PayInitReq()
|
) : PayInitReq()
|
||||||
|
|
||||||
data class PayoutCheckReq(var record_no: String? = null) : PayInitReq()
|
data class PayoutCheckReq(var record_no: String = "") : PayInitReq()
|
||||||
|
|
@ -86,6 +86,6 @@ data class PayoutReply (
|
||||||
data class PayoutCheckData(var data: PayoutCheck? = null) : BaseReply()
|
data class PayoutCheckData(var data: PayoutCheck? = null) : BaseReply()
|
||||||
|
|
||||||
data class PayoutCheck(
|
data class PayoutCheck(
|
||||||
var status: Int = 0,
|
var status: Int = 0, // 提现状态 1:提现中,2:提现成功,3:提现失败
|
||||||
var error: Int = 0,
|
var error: Int = 0, // 错误码,0成功,1失败,2签名验证失败,3客户端版本过低,4 ts长度错误
|
||||||
)
|
)
|
||||||
|
|
@ -18,6 +18,7 @@ import com.gamedog.vididin.beans.resp.PayoutReply
|
||||||
import com.gamedog.vididin.core.login.login.AccountManager
|
import com.gamedog.vididin.core.login.login.AccountManager
|
||||||
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawBindBankDialog
|
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawBindBankDialog
|
||||||
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawInfoConfirmDialog
|
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawInfoConfirmDialog
|
||||||
|
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawSuccessDialog
|
||||||
import com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
|
import com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
|
||||||
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
|
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
|
||||||
import com.gamedog.vididin.netbase.Result
|
import com.gamedog.vididin.netbase.Result
|
||||||
|
|
@ -154,9 +155,8 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>(), OnTabSty
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun tryWithdraw(withdrawNum: Float) {
|
private fun tryWithdraw(withdrawNum: Float) {
|
||||||
withdrawInit(withdrawNum)
|
// withdrawInit(withdrawNum)
|
||||||
/*withdrawPayout()
|
withdrawCheck("PGS53c1b0079fad5bf5dc71d4d6b5dfc22e")
|
||||||
withdrawCheck()*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun withdrawInit(withdrawNum: Float) {
|
private fun withdrawInit(withdrawNum: Float) {
|
||||||
|
|
@ -244,7 +244,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>(), OnTabSty
|
||||||
viewModel.withdrawPayout(initUUID, payItemId, payCashNum)
|
viewModel.withdrawPayout(initUUID, payItemId, payCashNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun withdrawCheck() {
|
private fun withdrawCheck(recordNo: String) {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
repeatOnLifecycle(Lifecycle.State.STARTED) {
|
repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||||
viewModel.CheckResult.collect { result ->
|
viewModel.CheckResult.collect { result ->
|
||||||
|
|
@ -253,7 +253,37 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>(), OnTabSty
|
||||||
|
|
||||||
}
|
}
|
||||||
is Result.Success -> {
|
is Result.Success -> {
|
||||||
|
val checkResult = result.data?.data
|
||||||
|
var errHintRes = 0
|
||||||
|
|
||||||
|
when (checkResult?.error) {
|
||||||
|
0 -> {
|
||||||
|
when (checkResult.status) {
|
||||||
|
// 提现状态 1:提现中,2:提现成功,3:提现失败
|
||||||
|
1 -> {
|
||||||
|
// try again
|
||||||
|
}
|
||||||
|
2 -> {
|
||||||
|
showSuccessDialog()
|
||||||
|
}
|
||||||
|
3 -> {
|
||||||
|
errHintRes = R.string.withdraw_normal_fail
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1 -> {
|
||||||
|
errHintRes = R.string.withdraw_normal_fail
|
||||||
|
}
|
||||||
|
|
||||||
|
2 -> {
|
||||||
|
errHintRes = R.string.withdraw_fail_version_toolow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errHintRes > 0) {
|
||||||
|
AndroidUtil.showToast(errHintRes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
is Result.Error -> {
|
is Result.Error -> {
|
||||||
}
|
}
|
||||||
|
|
@ -262,7 +292,11 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>(), OnTabSty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.withdrawCheck()
|
viewModel.withdrawCheck(recordNo)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showSuccessDialog() {
|
||||||
|
WithdrawSuccessDialog(this).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun saveTransactionData(data: PayoutReply) {
|
private fun saveTransactionData(data: PayoutReply) {
|
||||||
|
|
@ -286,7 +320,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>(), OnTabSty
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startTimerForCheckPayoutResult(data: PayoutReply) {
|
private fun startTimerForCheckPayoutResult(data: PayoutReply) {
|
||||||
withdrawCheck()
|
withdrawCheck(data.record_no!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
||||||
|
|
@ -93,10 +93,10 @@ class WithdrawViewModel : ViewModel() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun withdrawCheck() {
|
fun withdrawCheck(recordNo: String) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
val requestParam = PayoutCheckReq().applyInitFields().apply {
|
val requestParam = PayoutCheckReq().applyInitFields().apply {
|
||||||
// TODO -
|
record_no = recordNo
|
||||||
}
|
}
|
||||||
|
|
||||||
_CheckResult.value = Result.Loading
|
_CheckResult.value = Result.Loading
|
||||||
|
|
|
||||||
|
|
@ -134,5 +134,6 @@
|
||||||
<string name="withdraw_fail_status_is_unavailable">Your account withdraw status is unavailable.</string>
|
<string name="withdraw_fail_status_is_unavailable">Your account withdraw status is unavailable.</string>
|
||||||
<string name="withdraw_fail_region_restricit">Regision restriction</string>
|
<string name="withdraw_fail_region_restricit">Regision restriction</string>
|
||||||
<string name="withdraw_fail_amount_limit">Amount limit</string>
|
<string name="withdraw_fail_amount_limit">Amount limit</string>
|
||||||
|
<string name="withdraw_normal_fail">0utros Erro</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue