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 b8d531a..7a97fd4 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 @@ -90,8 +90,8 @@ class BoxTaskHelper: BaseTaskHelper() { if (taskType == subTask.task_type && !isBoxSubTaskFinished(currentBoxIndex, index)) { subTask.finishedNum++ - if (isBoxTasksFinished(currentBoxIndex)) { - sendSubBoxFinishEvent(currentBoxIndex) + if (subTask.required_count <= subTask.finishedNum) { + sendSubBoxSubTaskFinishEvent(index, subTask) } saveState2Sp() notifyEvent() @@ -131,14 +131,9 @@ class BoxTaskHelper: BaseTaskHelper() { } } - private fun sendSubBoxFinishEvent(index: Int) { - val subBox = getBoxState(index) - - subBox?.let { - val resetBoxCount = mStateBean.boxList.size - index - 1 - StatisticUtil.reportEvents(StatisticUtil.KEY_Welfare_Task_Click, - mapOf("total_amount" to it.reward_value, "chest_count" to resetBoxCount, "task_type" to "subBox", "task_progress" to "100")) - } + private fun sendSubBoxSubTaskFinishEvent(index: Int, subTask: TaskStateBoxSub) { + StatisticUtil.reportEvents(StatisticUtil.KEY_Welfare_Task_Click, + mapOf(/*"total_amount" to it.reward_value, "chest_count" to resetBoxCount, */"task_type" to subTask.task_type, "task_progress" to subTask.task_id)) } private fun notifyEvent() {