加入宝箱任务,并读取配置

This commit is contained in:
renhaoting 2025-12-03 11:20:03 +08:00
parent ca1f3662b0
commit 483fa7e930
3 changed files with 204 additions and 24 deletions

View File

@ -4,7 +4,10 @@
"module_name": "任务中心",
"page_path": "底部第二个页签",
"layout_style": "上下滑动长页面",
"currency_display": ["金币账户", "巴西雷亚尔现金账户"]
"currency_display": [
"金币账户",
"巴西雷亚尔现金账户"
]
},
"task_categories": [
{
@ -50,13 +53,34 @@
"target_action": "用户每日完成签到操作(支持广告补签)",
"reward_type": "金币",
"reward_details": [
{"day": 1, "value": 100},
{"day": 2, "value": 300},
{"day": 3, "value": 300},
{"day": 4, "value": 500},
{"day": 5, "value": 300},
{"day": 6, "value": 300},
{"day": 7, "value": 800}
{
"day": 1,
"value": 100
},
{
"day": 2,
"value": 300
},
{
"day": 3,
"value": 300
},
{
"day": 4,
"value": 500
},
{
"day": 5,
"value": 300
},
{
"day": 6,
"value": 300
},
{
"day": 7,
"value": 800
}
],
"support_makeup": true,
"makeup_method": "观看15-30秒激励视频",
@ -78,13 +102,34 @@
"target_action": "用户当日完成签到操作",
"reward_type": "金币",
"reward_details": [
{"day": 1, "value": 100},
{"day": 2, "value": 300},
{"day": 3, "value": 300},
{"day": 4, "value": 500},
{"day": 5, "value": 300},
{"day": 6, "value": 300},
{"day": 7, "value": 500}
{
"day": 1,
"value": 100
},
{
"day": 2,
"value": 300
},
{
"day": 3,
"value": 300
},
{
"day": 4,
"value": 500
},
{
"day": 5,
"value": 300
},
{
"day": 6,
"value": 300
},
{
"day": 7,
"value": 500
}
],
"double_reward_method": "观看15-30秒激励视频",
"support_makeup": true,
@ -99,9 +144,18 @@
"target_action": "用户累计观看短视频",
"reward_type": "金币",
"reward_details": [
{"target_count": 2, "value": 100},
{"target_count": 3, "value": 150},
{"target_count": 4, "value": 200}
{
"target_count": 10,
"value": 100
},
{
"target_count": 20,
"value": 150
},
{
"target_count": 30,
"value": 200
}
],
"reward_stackable": true,
"is_one_time": false,
@ -114,9 +168,18 @@
"target_action": "用户累计观看激励视频",
"reward_type": "金币",
"reward_details": [
{"target_count": 1, "value": 100},
{"target_count": 3, "value": 150},
{"target_count": 5, "value": 200}
{
"target_count": 1,
"value": 100
},
{
"target_count": 5,
"value": 150
},
{
"target_count": 10,
"value": 200
}
],
"daily_limit": 10,
"reward_stackable": true,
@ -125,6 +188,95 @@
}
]
}
],
"box_task": {
"category_id": "bonuses_task",
"category_name": "福利宝箱Prémios únicos",
"valid_period": "每个宝箱持续3天完成对应任务即可领取现金奖励。",
"display_priority": 3,
"chests": [
{
"chest_id": "1",
"chest_name": "福利宝箱1",
"chest_desc": "完成福利宝箱1的全部任务后获得R$0.1现金奖励",
"duration_days": 3,
"reward_type": "货币",
"reward_value": "R$0.1",
"is_one_time": true,
"status": "active",
"tasks": [
{
"task_id": "chest1_task1",
"task_name": "观看1个广告",
"required_count": 1
},
{
"task_id": "chest1_task2",
"task_name": "观看3个视频",
"required_count": 2
},
{
"task_id": "chest1_task3",
"task_name": "完成1次签到",
"required_count": 1
}
]
},
{
"chest_id": "2",
"chest_name": "福利宝箱2",
"chest_desc": "完成福利宝箱2的全部任务后获得R$1现金奖励",
"duration_days": 3,
"reward_type": "货币",
"reward_value": "R$1",
"is_one_time": true,
"status": "locked",
"tasks": [
{
"task_id": "chest2_task1",
"task_name": "观看15个广告",
"required_count": 15
},
{
"task_id": "chest2_task2",
"task_name": "观看30个视频",
"required_count": 30
},
{
"task_id": "chest2_task3",
"task_name": "参与1次0元购",
"required_count": 1
}
]
},
{
"chest_id": "3",
"chest_name": "福利宝箱3",
"chest_desc": "完成福利宝箱3的全部任务后获得R$2现金奖励",
"duration_days": 3,
"reward_type": "货币",
"reward_value": "R$2",
"is_one_time": true,
"status": "locked",
"tasks": [
{
"task_id": "chest3_task1",
"task_name": "观看30个广告",
"required_count": 30
},
{
"task_id": "chest3_task2",
"task_name": "观看50个视频",
"required_count": 50
},
{
"task_id": "chest3_task3",
"task_name": "参与10次0元购",
"required_count": 10
}
]
}
]
}
}
}

View File

@ -6,7 +6,8 @@ data class TaskBean(
data class TaskModuleConfig(
val basic_info: BasicInfo,
val task_categories: List<TaskCategory>
val task_categories: List<TaskCategory>,
val box_task: BoxTaskRoot
) {
fun getTaskCategoryById(categoryId: String): TaskCategory? {
return task_categories.find { it.category_id == categoryId }
@ -54,3 +55,31 @@ data class RewardDetail(
val target_count: Int,
val value: Int
)
//----------------------------- 宝箱任务配置 -----------------------------
data class BoxSubTask(
val task_id: String,
val task_name: String,
val required_count: Int,
)
data class BoxTask(
val chest_id: String,
val chest_name: String,
val duration_days: Int,
val reward_type: String,
val reward_value: String,
val is_one_time: Boolean,
val status: String,
val tasks: List<BoxSubTask>,
)
data class BoxTaskRoot(
val category_id: String,
val category_name: String,
val valid_period: String,
val display_priority: String,
val chests: List<BoxTask>,
)

View File

@ -8,7 +8,6 @@ import com.gamedog.vididin.VididinEvents
import com.gamedog.vididin.core.login.login.AccountManager
import com.gamedog.vididin.main.fragments.task.Task
import com.gamedog.vididin.main.fragments.task.TaskBean
import com.gamedog.vididin.manager.helpers.BaseTaskHelper
import com.gamedog.vididin.manager.helpers.DailyBoxHelper
import com.gamedog.vididin.manager.helpers.DailySignTaskHelper
import com.gamedog.vididin.manager.helpers.DailyWatchAdTaskHelper