From 9d426e3e1500822e4a17eeeb2c3a84f745610fc8 Mon Sep 17 00:00:00 2001 From: KingRan Date: Tue, 15 Feb 2022 14:03:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_EsportsManager.js | 71 ++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/jd_EsportsManager.js b/jd_EsportsManager.js index dc25eec..4acc05d 100644 --- a/jd_EsportsManager.js +++ b/jd_EsportsManager.js @@ -58,44 +58,45 @@ let tasks = [], shareCodes = [], first = true; })() async function main() { - tasks = await detail(); - console.log('tasks:++++++++++'+tasks); - for (let i = 0; i < tasks.length; i++) { - let product_info_vos = [] - let task_vos = tasks[i] - switch (task_vos.task_name) { - case '连签得金币': - if (task_vos.status === '1') - await do_task(task_vos.simple_record_info_vo.task_token, task_vos.task_id, task_vos.task_type) - continue - case '邀请好友助力': - await getShareCode(task_vos.assist_task_detail_vo.task_token) - await $.wait(2000) + tasks = await detail(); + for (let i = 0; i < tasks.length; i++) { + let product_info_vos = [] + let task_vos = tasks[i] + switch (task_vos.task_name) { + case '连签得金币': + if (task_vos.status === '1') + await do_task(task_vos.simple_record_info_vo.task_token, task_vos.task_id, task_vos.task_type) + continue + case '邀请好友助力': + await getShareCode(task_vos.assist_task_detail_vo.task_token) + await $.wait(2000) - await getAssist() - await $.wait(2000) + await getAssist() + await $.wait(2000) - console.log(`第${$.index}个账号${$.UserName}去助力第${Math.floor(($.index - 1) / 6) + 1}个账号。`) - await doAssist() - continue - case '去浏览精彩会场': case '去关注特色频道' : - product_info_vos = task_vos['shopping_activity_vos'] - break - case '去关注优质好店': - product_info_vos = task_vos['follow_shop_vo'] - break - default: - "" - } - let taskId = task_vos.task_id, taskType = task_vos.task_type; - for (let t of product_info_vos) { - if (t.status === '1') { - console.log(`开始任务:${task_vos.task_name}`) - let res = await do_task(t.task_token, taskId, taskType) - await $.wait(2000) - } - } + console.log(`第${$.index}个账号${$.UserName}去助力第${Math.floor(($.index - 1) / 6) + 1}个账号。`) + await doAssist() + continue + case '去浏览精彩会场': case '去关注特色频道' : + product_info_vos = task_vos['shopping_activity_vos'] + break + case '去关注优质好店': + product_info_vos = task_vos['follow_shop_vo'] + break + default: + "" } + let taskId = task_vos.task_id, taskType = task_vos.task_type; + if(product_info_vos != ){ + for (let t of product_info_vos) { + if (t.status === '1') { + console.log(`开始任务:${task_vos.task_name}`) + let res = await do_task(t.task_token, taskId, taskType) + await $.wait(1000) + } + } + } + } } function getShareCode(token) {