From 0d092b8422bac97d3cf79f1174d0e09128653bb6 Mon Sep 17 00:00:00 2001 From: renhaoting <370797079@qq.com> Date: Mon, 5 Jan 2026 16:22:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E9=94=99=E8=AF=AF=E7=A0=81?= =?UTF-8?q?=20=E6=96=87=E6=A1=88=E7=BB=9F=E4=B8=80=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gamedog/vididin/VidiConst.kt | 2 +- .../features/withdraw/WithDrawActivity.kt | 43 +++---- .../features/withdraw/WithDrawSubActivity.kt | 6 +- .../vididin/manager/WithdrawManager.kt | 121 ++++++++++++++---- app/src/main/res/values/strings.xml | 11 ++ 5 files changed, 129 insertions(+), 54 deletions(-) diff --git a/app/src/main/java/com/gamedog/vididin/VidiConst.kt b/app/src/main/java/com/gamedog/vididin/VidiConst.kt index 0e90592..1ba66c0 100644 --- a/app/src/main/java/com/gamedog/vididin/VidiConst.kt +++ b/app/src/main/java/com/gamedog/vididin/VidiConst.kt @@ -66,7 +66,7 @@ object VidiConst { const val URL_ZERO_BUY: String = "https://jt.3idiotstudio.com" - const val URL_WITHDRAW: String = "https://zz.rsappinc.com/eonline4/" //"https://jpec.3idiotstudio.com" + const val URL_WITHDRAW: String = "https://zz.rsappinc.com" //"https://jpec.3idiotstudio.com" 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 4c98ba3..1c32907 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 @@ -223,26 +223,24 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity() { val reqInitBean = result.data.data reqInitBean?.let { - var errorHintRes = 0 + var failType = 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) { + if (withDrawItem.status == WithdrawManager.INIT_OK) { requestPayout(it.uuid!!, withDrawItem.id, withdrawNum) } else { - errorHintRes = R.string.withdraw_fail_reach_day_limit + failType = withDrawItem.status } } else { // 0成功,1失败,2签名验证失败,3客户端版本过低,4 ts长度错误 - when (it.error) { - 3-> errorHintRes = R.string.withdraw_fail_version_toolow - } + failType = it.error + 10 } - if (errorHintRes > 0) { - showFailDialog(errorHintRes) + if (failType > 0) { + showFailDialog(WithdrawManager.instance().getFailHintStrRes(failType)) } } @@ -267,30 +265,21 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity() { is Result.Loading -> { } is Result.Success -> { - var errHintRes = 0 + var failType: Int? = 0 - when (result.data?.data?.error) { + if (result.data?.data?.error == 0) { + saveNewRecord(result.data.data!!, payCashNum, currentTimeMs) + } else { /* 错误码, 0成功,1失败,2签名验证失败,3客户端版本过低,4uuid错误,5所在地国家或地区不在提现限制内,6提现金额不符对应的产品id,7提现产品id不对,8达到提现金额限制,9提现次数超过限制,10今日没有提现机会,11提现账号达到次数限制,12身份审核条件不满足,不能提现,13巴西提现参数 document_type 错误, 14巴西提现参数 document_id 错误,15 巴西提现参数 AccountType 错误,16 巴西提现参数 Name 错误,17巴西提现参数 Account 和 DocumentId 不同,18巴西提现参数account_type为CPF时 对应的 account 错误,19巴西提现参数account_type为CNPJ时 对应的 account 错误,20巴西提现参数 account_type 错误, 21巴西提现参数 document_type 错误,22巴西提现参数account_type为CPF时 对应的 document_id 错误,23巴西提现参数account_type为CNPJ时 对应的 document_id 错误,24 ts长度错误,25 没提0.1就提现其它的 */ - 0 -> { - saveNewRecord(result.data.data!!, payCashNum, currentTimeMs) + failType = result.data?.data?.error + if (failType != null && failType > 0) { + failType += 20 + showFailDialog(WithdrawManager.instance().getFailHintStrRes(failType)) } - 5-> { - errHintRes = R.string.withdraw_fail_region_restricit - } - 8-> { - errHintRes = R.string.withdraw_fail_amount_limit - } - 9-> { - errHintRes = R.string.withdraw_fail_amount_limit - } - } - - if (errHintRes > 0) { - showFailDialog(errHintRes) } } is Result.Error -> { @@ -338,7 +327,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity() { } TRANSACTION_STATE_FAIL -> { - showFailDialog(WithdrawManager.instance().getFailShowTextRes(record.failReason)) + showFailDialog(WithdrawManager.instance().getFailHintStrRes(record.failReason)) WithdrawManager.instance().saveRecordHasNotifyState(record.recordNo) } } @@ -400,8 +389,6 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity() { companion object { - const val INIT_ACTIVE = 1 - internal fun startActivity(activity: Activity) { activity.startActivity(Intent(activity.applicationContext, WithDrawActivity::class.java)) } diff --git a/app/src/main/java/com/gamedog/vididin/features/withdraw/WithDrawSubActivity.kt b/app/src/main/java/com/gamedog/vididin/features/withdraw/WithDrawSubActivity.kt index 40bf19e..47a8da3 100644 --- a/app/src/main/java/com/gamedog/vididin/features/withdraw/WithDrawSubActivity.kt +++ b/app/src/main/java/com/gamedog/vididin/features/withdraw/WithDrawSubActivity.kt @@ -21,13 +21,13 @@ import com.gamedog.vididin.beans.WatchAdNotifyBean import com.gamedog.vididin.beans.resp.PayoutReply import com.gamedog.vididin.beans.resp.WithdrawRecord import com.gamedog.vididin.core.login.login.AccountManager -import com.gamedog.vididin.features.withdraw.WithDrawActivity.Companion.INIT_ACTIVE import com.gamedog.vididin.features.withdraw.dialogs.WithdrawBindBankDialog import com.gamedog.vididin.features.withdraw.dialogs.WithdrawFailDialog import com.gamedog.vididin.features.withdraw.dialogs.WithdrawInfoConfirmDialog import com.gamedog.vididin.features.withdraw.dialogs.WithdrawSuccessDialog import com.gamedog.vididin.manager.WithdrawItemBean import com.gamedog.vididin.manager.WithdrawManager +import com.gamedog.vididin.manager.WithdrawManager.Companion.INIT_OK import com.gamedog.vididin.manager.WithdrawManager.Companion.TRANSACTION_STATE_FAIL import com.gamedog.vididin.manager.WithdrawManager.Companion.TRANSACTION_STATE_ONGOING import com.gamedog.vididin.manager.WithdrawManager.Companion.TRANSACTION_STATE_SUCCESS @@ -126,7 +126,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity() { 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) { + if (withDrawItem.status == INIT_OK) { requestPayout(it.uuid!!, withDrawItem.id, withdrawNum) } else { errorHintRes = R.string.withdraw_fail_reach_day_limit @@ -276,7 +276,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity() { } TRANSACTION_STATE_FAIL -> { - showFailDialog(WithdrawManager.instance().getFailShowTextRes(record.failReason)) + showFailDialog(WithdrawManager.instance().getFailHintStrRes(record.failReason)) WithdrawManager.instance().saveRecordHasNotifyState(record.recordNo) } } diff --git a/app/src/main/java/com/gamedog/vididin/manager/WithdrawManager.kt b/app/src/main/java/com/gamedog/vididin/manager/WithdrawManager.kt index 4ae5e1c..dcdac77 100644 --- a/app/src/main/java/com/gamedog/vididin/manager/WithdrawManager.kt +++ b/app/src/main/java/com/gamedog/vididin/manager/WithdrawManager.kt @@ -51,6 +51,38 @@ class WithdrawManager private constructor() { companion object { const val EACH_SUB_ITEM_CASH_NUM: Double = 1.0 + //----------------------- FROM pagsmile.proto ------------------------------ + // init接口 status + // 1可提现 2:条件未达成 3:已提现, 4:禁止提现, 5:提现中 + const val INIT_OK = 1 + const val ERROR_NOT_REACH_CONDITION = 2 + const val ERROR_ALREADY_WITHDRAWED = 3 + const val ERROR_FORBID = 4 + const val ERROR_WITHDRAWING = 5 + // init接口 服务器 error 字段 + // 0成功,1失败,2签名验证失败,3客户端版本过低,4 ts长度错误 + const val ERROR_FAILED_UNKNOW = 1 + 10 + const val ERROR_APP_VERSION_LOW = 3 + 10 + /* payout接口: 错误码, + 0成功,1失败,2签名验证失败,3客户端版本过低,4uuid错误,5所在地国家或地区不在提现限制内,6提现金额不符对应的产品id,7提现产品id不对,8达到提现金额限制,9提现次数超过限制,10今日没有提现机会,11提现账号达到次数限制,12身份审核条件不满足,不能提现,13巴西提现参数 document_type 错误, + 14巴西提现参数 document_id 错误,15 巴西提现参数 AccountType 错误,16 巴西提现参数 Name 错误,17巴西提现参数 Account 和 DocumentId 不同,18巴西提现参数account_type为CPF时 对应的 account 错误,19巴西提现参数account_type为CNPJ时 对应的 account 错误,20巴西提现参数 account_type 错误, + 21巴西提现参数 document_type 错误,22巴西提现参数account_type为CPF时 对应的 document_id 错误,23巴西提现参数account_type为CNPJ时 对应的 document_id 错误,24 ts长度错误,25 没提0.1就提现其它的 + */ + const val ERROR_PAYOUT_UNKNOW = 1 + 20 + const val ERROR_PAYOUT_APP_VERSION_LOW = 3 + 20 + const val ERROR_PAYOUT_COUNTRY_RESTRICTION = 5 + 20 + const val ERROR_PAYOUT_REACH_TOTAL_LIMIT = 8 + 20 + const val ERROR_PAYOUT_REACH_TIMES_LIMIT = 9 + 20 + const val ERROR_PAYOUT_TODAY_NO_CHANCE = 10 + 20 + const val ERROR_PAYOUT_ACCOUNT_REACH_TIMES_LIMIT = 11 + 20 + const val ERROR_PAYOUT_USER_IDENTITY_LIMIT = 12 + 20 + const val ERROR_PAYOUT_MUST_WITHDRAW01_FIRST = 25 + 20 + + + + + + // subBean 状态 const val STATE_NEED_WATCH_AD: Int = 0 @@ -65,10 +97,6 @@ class WithdrawManager private constructor() { const val TRANSACTION_STATE_FAIL : Int = 3 - // 提现失败分类(自定义) - const val FAIL_TYPE_UNKNOWN : Int = 1 - const val FAIL_TYPE_APP_VERSION_LOW : Int = 2 - @Volatile private var instance: WithdrawManager? = null @@ -376,7 +404,7 @@ class WithdrawManager private constructor() { is Result.Success -> { val checkResult = reqResult.data.data - var failedType = 0 + var failedType = ERROR_FAILED_UNKNOW when (checkResult?.error) { 0 -> { @@ -390,17 +418,17 @@ class WithdrawManager private constructor() { handleTransactionSuccess(recordNo) } 3 -> { - failedType = FAIL_TYPE_UNKNOWN + failedType = ERROR_FAILED_UNKNOW } } } 1 -> { - failedType = FAIL_TYPE_UNKNOWN + failedType = ERROR_FAILED_UNKNOW } - 2 -> { - failedType = FAIL_TYPE_APP_VERSION_LOW + 3 -> { + failedType = ERROR_APP_VERSION_LOW } } @@ -451,17 +479,75 @@ class WithdrawManager private constructor() { private fun sendWithdrawResultStatistic(cashNum: Double, isSuccess: Boolean, failType: Int) { StatisticUtil.reportEvents(StatisticUtil.KEY_Withdrawal_Reason, mapOf("Reason_Type" to (if (isSuccess) "Success" else "Fail"), - "Fail_Reason" to getFailHintStr(failType), + "Fail_Reason" to getFailHintStrRes(failType), "Withdrawal_Position" to cashNum, "Withdrawal_Day" to 1)) } - private fun getFailHintStr(failType: Int) : String { - var failReasonStr = "" + fun getFailHintStrRes(failType: Int) : Int { + var failTextRes = R.string.withdraw_normal_fail when (failType) { + ERROR_NOT_REACH_CONDITION -> { + failTextRes = R.string.withdraw_fail_not_reach_condition + } + ERROR_ALREADY_WITHDRAWED -> { + failTextRes = R.string.withdraw_fail_already_withdraw + } + + ERROR_FORBID -> { + failTextRes = R.string.withdraw_fail_forbidden + } + + ERROR_WITHDRAWING -> { + failTextRes = R.string.withdraw_fail_withdrawing + } + + ERROR_FAILED_UNKNOW -> { + failTextRes = R.string.withdraw_normal_fail + } + + ERROR_APP_VERSION_LOW -> { + failTextRes = R.string.withdraw_fail_version_toolow + } + + ERROR_PAYOUT_UNKNOW -> { + failTextRes = R.string.withdraw_normal_fail + } + + ERROR_PAYOUT_APP_VERSION_LOW -> { + failTextRes = R.string.withdraw_fail_version_toolow + } + + ERROR_PAYOUT_COUNTRY_RESTRICTION -> { + failTextRes = R.string.withdraw_fail_country_restriction + } + + ERROR_PAYOUT_REACH_TOTAL_LIMIT -> { + failTextRes = R.string.withdraw_fail_reach_amount_limit + } + + ERROR_PAYOUT_REACH_TIMES_LIMIT -> { + failTextRes = R.string.withdraw_fail_reach_times_limit + } + + ERROR_PAYOUT_TODAY_NO_CHANCE -> { + failTextRes = R.string.withdraw_fail_today_no_chance + } + + ERROR_PAYOUT_ACCOUNT_REACH_TIMES_LIMIT -> { + failTextRes = R.string.withdraw_account_times_limit + } + + ERROR_PAYOUT_USER_IDENTITY_LIMIT -> { + failTextRes = R.string.withdraw_fail_user_identity_limit + } + + ERROR_PAYOUT_MUST_WITHDRAW01_FIRST -> { + failTextRes = R.string.withdraw_fail_must_withdraw_01_first + } } - return failReasonStr + return failTextRes } private fun notifyWithdrawCheckResult(recordNo: String) { @@ -484,15 +570,6 @@ class WithdrawManager private constructor() { return dataBean } - fun getFailShowTextRes(failReason: Int): Int { - var failTextRes = R.string.withdraw_normal_fail - when (failReason) { - FAIL_TYPE_APP_VERSION_LOW -> { - failTextRes = R.string.withdraw_fail_version_toolow - } - } - return failTextRes - } private fun getStartedItemRestCashNum(itemIndex: Int): Double { if (itemIndex in 0..mItemList.size-1) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bb9703d..9c9993d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -219,6 +219,17 @@ This purchase reward claim is ongoing. You have claimed this reward. Game Center + Not reach withdraw condition + You\'ve already withdrawed + Withdraw_forbidden + Withdrawing + Country restriction + Reach amount limit + Reach times limit + Today chance is run out + Your account is reach times limit + Your account is not valid + You have to withdraw 0.1 firstly \ No newline at end of file