SubWithdraw 提现中 pending 显示

This commit is contained in:
renhaoting 2026-01-19 16:10:37 +08:00
parent 096138fc89
commit 4f624189c8
3 changed files with 13 additions and 9 deletions

View File

@ -192,7 +192,7 @@ class WatchAdActivity : AppViewsEmptyViewModelActivity<ViewBinding>(), OnTabStyl
if (!mIsLoadSuccess) { if (!mIsLoadSuccess) {
handleLoadFailed() handleLoadFailed()
} }
}, 30000) }, 3000)
try { try {

View File

@ -145,6 +145,10 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
updateUI() updateUI()
} }
VididinEvents.EVENT_WITHDRAW_ITEM_LIST_CHANGED -> {
updateUI()
}
VididinEvents.EVENT_WITHDRAW_RESULT_UPDATED -> { VididinEvents.EVENT_WITHDRAW_RESULT_UPDATED -> {
try { try {
val record = data.mData as RecordCash val record = data.mData as RecordCash
@ -159,7 +163,8 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
}, VididinEvents.EVENT_AD_WATCHED_FOR_WITHDRAW_BIG, }, VididinEvents.EVENT_AD_WATCHED_FOR_WITHDRAW_BIG,
VididinEvents.EVENT_WITHDRAW_SUB_ITEM_PROGRESS_UPDATED, VididinEvents.EVENT_WITHDRAW_SUB_ITEM_PROGRESS_UPDATED,
VididinEvents.EVENT_WITHDRAW_SELECTED_SUB_ITEM_CHANGED, VididinEvents.EVENT_WITHDRAW_SELECTED_SUB_ITEM_CHANGED,
VididinEvents.EVENT_WITHDRAW_RESULT_UPDATED ) VididinEvents.EVENT_WITHDRAW_RESULT_UPDATED,
VididinEvents.EVENT_WITHDRAW_ITEM_LIST_CHANGED)
mCurItem = WithdrawManager.instance().getItem(mType) mCurItem = WithdrawManager.instance().getItem(mType)
@ -224,7 +229,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
} else { } else {
var actionText = R.string.withdraw_cash_out var actionText = R.string.withdraw_cash_out
when(subBean.withdrawState) { when(subBean.withdrawState) {
WithdrawManager.STATE_COULD_WITHDRAW -> { WithdrawManager.STATE_COULD_WITHDRAW -> {
actionText = R.string.withdraw_cash_out actionText = R.string.withdraw_cash_out
flAction.isClickable = true flAction.isClickable = true
flAction.alpha = 1F flAction.alpha = 1F
@ -236,7 +241,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
flAction.alpha = 0.6F flAction.alpha = 0.6F
} }
WithdrawManager.STATE_HAS_WITHDRAWED -> { WithdrawManager.STATE_WITHDRAW_SUCCESS -> {
actionText = R.string.withdraw_success actionText = R.string.withdraw_success
flAction.isClickable = false flAction.isClickable = false
flAction.alpha = 0.6F flAction.alpha = 0.6F

View File

@ -86,8 +86,7 @@ class WithdrawManager private constructor() {
const val STATE_NEED_WATCH_AD: Int = 0 const val STATE_NEED_WATCH_AD: Int = 0
const val STATE_COULD_WITHDRAW: Int = 1 const val STATE_COULD_WITHDRAW: Int = 1
const val STATE_WITHDRAWING: Int = 2 const val STATE_WITHDRAWING: Int = 2
const val STATE_HAS_WITHDRAWED: Int = 3 const val STATE_WITHDRAW_SUCCESS: Int = 3
const val STATE_WITHDRAW_SUCCESS: Int = 4
// 提现交易状态 提现状态 0: 未启动 1:提现中,2:提现成功,3:提现失败 // 提现交易状态 提现状态 0: 未启动 1:提现中,2:提现成功,3:提现失败
const val TRANSACTION_STATE_UNSTART : Int = 0 const val TRANSACTION_STATE_UNSTART : Int = 0
@ -235,7 +234,7 @@ class WithdrawManager private constructor() {
} else { } else {
var allSubItemFinish = true var allSubItemFinish = true
mWithdrawItemList[itemIndex].subItemList.forEach { mWithdrawItemList[itemIndex].subItemList.forEach {
if (it.withdrawState != STATE_HAS_WITHDRAWED) { if (it.withdrawState != STATE_WITHDRAW_SUCCESS) {
allSubItemFinish = false allSubItemFinish = false
return@forEach return@forEach
} }
@ -675,7 +674,7 @@ class WithdrawManager private constructor() {
withdrawRecord.hasShowResultDialog = false withdrawRecord.hasShowResultDialog = false
RecordsManager.instance().updateCashRecord(withdrawRecord) RecordsManager.instance().updateCashRecord(withdrawRecord)
updateItemState(withdrawRecord.withdrawItemIndex, withdrawRecord.withdrawItemSubIndex, STATE_WITHDRAW_SUCCESS) updateItemState(withdrawRecord.withdrawItemIndex, withdrawRecord.withdrawItemSubIndex, STATE_COULD_WITHDRAW)
// 2. 事件通知以便更新UI // 2. 事件通知以便更新UI
notifyWithdrawResult(withdrawRecord) notifyWithdrawResult(withdrawRecord)
@ -697,7 +696,7 @@ class WithdrawManager private constructor() {
// 1. 更新record 并保存 // 1. 更新record 并保存
withdrawRecord.withdrawState = TRANSACTION_STATE_SUCCESS withdrawRecord.withdrawState = TRANSACTION_STATE_SUCCESS
RecordsManager.instance().updateCashRecord(withdrawRecord) RecordsManager.instance().updateCashRecord(withdrawRecord)
updateItemState(withdrawRecord.withdrawItemIndex, withdrawRecord.withdrawItemSubIndex, STATE_HAS_WITHDRAWED) updateItemState(withdrawRecord.withdrawItemIndex, withdrawRecord.withdrawItemSubIndex, STATE_WITHDRAW_SUCCESS)
// 2. 更新取现 条目状态 // 2. 更新取现 条目状态
if (withdrawRecord.withdrawItemIndex >= 0) { if (withdrawRecord.withdrawItemIndex >= 0) {