From 479e8aad93756c9e0dd253971313faca4c3f96d2 Mon Sep 17 00:00:00 2001 From: renhaoting <370797079@qq.com> Date: Fri, 23 Jan 2026 18:12:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=9F=8B=E7=82=B9=E3=80=91Chest=5FCla?= =?UTF-8?q?im=5FClick=EF=BC=88=E5=AE=9D=E7=AE=B1=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6=EF=BC=89=E5=9C=A8=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E9=A2=86=E5=8F=96=E6=97=B6=E5=B0=B1=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E9=9C=80=E8=A6=81=E7=82=B9=E5=87=BB=E9=A2=86?= =?UTF-8?q?=E5=8F=96=E5=90=8E=E4=B8=8A=E6=8A=A5=E3=80=82=E4=B8=94=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=B8=ADtotal=5Famount=20=E5=B1=9E=E6=80=A7=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E8=AF=AF=EF=BC=8C=E9=A2=86=E5=8F=96=200.1=20?= =?UTF-8?q?=E5=A5=96=E5=8A=B1=E4=B8=8A=E6=8A=A5=E4=B8=BA=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vididin/manager/helpers/BoxTaskHelper.kt | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/gamedog/vididin/manager/helpers/BoxTaskHelper.kt b/app/src/main/java/com/gamedog/vididin/manager/helpers/BoxTaskHelper.kt index 7a97fd4..957824b 100644 --- a/app/src/main/java/com/gamedog/vididin/manager/helpers/BoxTaskHelper.kt +++ b/app/src/main/java/com/gamedog/vididin/manager/helpers/BoxTaskHelper.kt @@ -58,7 +58,6 @@ class BoxTaskHelper: BaseTaskHelper() { if (taskStateBeanInSp == null || taskStateBeanInSp.boxList.isNullOrEmpty() || isAllBoxExpiredOrFinished(taskStateBeanInSp)) { mStateBean = generateStateBeanFromConfig() saveState2Sp() - sendEnterNewSubBoxEvent(0) } else { mStateBean = taskStateBeanInSp calculateCurrentOngoingBox() @@ -112,8 +111,6 @@ class BoxTaskHelper: BaseTaskHelper() { mStateBean.boxList[index].boxStartMs = DateUtil.getCurTimeMs() saveState2Sp() notifyEvent() - - sendEnterNewSubBoxEvent(index) } return } @@ -121,14 +118,9 @@ class BoxTaskHelper: BaseTaskHelper() { } } - private fun sendEnterNewSubBoxEvent(index: Int) { - val subBox = getBoxState(index) - - subBox?.let { - val resetBoxCount = mStateBean.boxList.size - index - 1 - StatisticUtil.reportEvents(StatisticUtil.KEY_Chest_Claim_Click, - mapOf("total_amount" to it.reward_value, "chest_count" to resetBoxCount, "task_type" to "subBox", "task_progress" to "0")) - } + private fun sendClaimedEvent(claimBoxTotal: Int, couldClaimCashNum: Double) { + StatisticUtil.reportEvents(StatisticUtil.KEY_Chest_Claim_Click, + mapOf("total_amount" to couldClaimCashNum, "chest_count" to claimBoxTotal)) } private fun sendSubBoxSubTaskFinishEvent(index: Int, subTask: TaskStateBoxSub) { @@ -272,6 +264,16 @@ class BoxTaskHelper: BaseTaskHelper() { return waitClaimCashNum } + fun getCouldClaimBoxNum(): Int { + var subBoxNum = 0 + mStateBean.boxList.forEachIndexed { index, box -> + if (getBoxStateEnum(index) == STATE_FINISH) { + subBoxNum ++ + } + } + return subBoxNum + } + fun getSubTaskHintStrRes(boxIndex: Int, subTaskIndex: Int): Int { when (boxIndex) { 0-> { @@ -350,6 +352,7 @@ class BoxTaskHelper: BaseTaskHelper() { fun executeClaimCash(): Boolean { try { val couldClaimCashNum = getCouldClaimCashNum() + val subBoxNum = getCouldClaimBoxNum() if (couldClaimCashNum > 0F) { AccountManager.adjustCash(couldClaimCashNum, RecordCash(RECORD_CASH_PLUS_BOX_TASK, couldClaimCashNum.toDouble())) mStateBean.boxList.forEachIndexed { index, box -> @@ -357,6 +360,8 @@ class BoxTaskHelper: BaseTaskHelper() { box.hasClaimedReward = true } } + + sendClaimedEvent(subBoxNum, couldClaimCashNum) saveState2Sp() notifyEvent() return true