(tasks)
| 577 | } |
| 578 | |
| 579 | async doTasks(tasks) { |
| 580 | const pending = tasks.filter((task) => !isCompleted(task)); |
| 581 | if (!pending.length) { |
| 582 | $.log(`账号[${this.index}] 暂无未完成任务`); |
| 583 | return; |
| 584 | } |
| 585 | for (const task of pending) { |
| 586 | const code = task.code || ""; |
| 587 | if (code === "answer_survey") await this.doQuestionTask(); |
| 588 | else if (code === "garden_share") await this.doShareTask(); |
| 589 | else if (code === "view_organic_sorghum") await this.doRealityTask(); |
| 590 | else if (code === "complete_member_info") await this.doCompleteInfoTask(); |
| 591 | else if (/subscribe/i.test(code)) await this.doSubscribePrize(); |
| 592 | else $.log(`账号[${this.index}] 未适配任务: ${task.name || code || task.id}`); |
| 593 | await $.wait(500, 1200); |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | async run() { |
| 598 | $.log(`\n账号[${this.index}] ${mask(this.openid || this.cacheKey)}`); |
no test coverage detected