From 6b9351baebc52982fc1bdf7b66e11e12f2d171e0 Mon Sep 17 00:00:00 2001 From: shylocks Date: Wed, 13 Jan 2021 09:58:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=9B=E4=B8=80?= =?UTF-8?q?=E9=80=9B=E4=BB=BB=E5=8A=A1=EF=BC=8C=E5=8A=A0=E5=A4=A7=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=BB=B6=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_cash.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jd_cash.js b/jd_cash.js index a738dfc..f094049 100644 --- a/jd_cash.js +++ b/jd_cash.js @@ -116,23 +116,23 @@ function index(info=false) { for(let task of data.data.result.taskInfos){ if (task.type === 4) { for (let i = task.doTimes; i < task.times; ++i) { - console.log(`去做${task.name}任务 ${i}/${task.times}`) + console.log(`去做${task.name}任务 ${i+1}/${task.times}`) await doTask(task.type, task.jump.params.skuId) - await $.wait(1000) + await $.wait(5000) } } else if (task.type === 2) { for (let i = task.doTimes; i < task.times; ++i) { - console.log(`去做${task.name}任务 ${i}/${task.times}`) + console.log(`去做${task.name}任务 ${i+1}/${task.times}`) await doTask(task.type, task.jump.params.shopId) - await $.wait(1000) + await $.wait(5000) } } - else if (task.type === 16 || task.type===3 || task.type===5) { + else if (task.type === 16 || task.type===3 || task.type===5 || task.type===17) { for (let i = task.doTimes; i < task.times; ++i) { - console.log(`去做${task.name}任务 ${i}/${task.times}`) + console.log(`去做${task.name}任务 ${i+1}/${task.times}`) await doTask(task.type, task.jump.params.url) - await $.wait(1000) + await $.wait(5000) } } } From 8083bf78f2a0efa7a7068a512250c41ea096337a Mon Sep 17 00:00:00 2001 From: shylocks Date: Wed, 13 Jan 2021 10:14:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B9=B4=E8=B4=A7=E8=8A=82=E4=B8=8D?= =?UTF-8?q?=E5=81=9A=E4=B8=80=E9=94=AE=E5=8A=A0=E5=85=A5=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_nh.js | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/jd_nh.js b/jd_nh.js index a02dda6..5d394a8 100644 --- a/jd_nh.js +++ b/jd_nh.js @@ -33,7 +33,7 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; //const WebSocket = $.isNode() ? require('websocket').w3cwebsocket: SockJS; //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = '', message,helpInfo; -const shareUuid = 'b3a52fbb01964aa3afb7ff0c57e6b37f' +let shareUuid = '83c6d4a80e3447b78572124e1fc3aa7c' if ($.isNode()) { Object.keys(jdCookieNode).forEach((item) => { cookiesArr.push(jdCookieNode[item]) @@ -87,6 +87,7 @@ const ACT_ID = 'dzvm210168869301' }) async function jdNh() { $.score = 0 + await getShareCode() await getIsvToken() await getIsvToken2() await getActCk() @@ -96,6 +97,30 @@ async function jdNh() { await getActContent(false,shareUuid) await showMsg(); } + +function getShareCode() { + return new Promise(resolve => { + $.get({url:'https://gitee.com/shylocks/updateTeam/raw/main/jd_nh.json',headers:{ + 'user-agent': 'JD4iPhone/167490 (iPhone; iOS 14.2; Scale/3.00)' + }},(err,resp,data)=>{ + try { + if (err) { + console.log(`${err}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + shareUuid = data['shareUuid'] + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} function getIsvToken() { let config = { url: 'https://api.m.jd.com/client.action?functionId=genToken', @@ -284,8 +309,10 @@ function getActContent(info=false, shareUuid = '') { if (data.data) { $.userInfo = data.data $.actorUuid = $.userInfo.actorUuid - if(!info) console.log(`您的好友助力码为${$.actorUuid}`) + if (!info) { + console.log(`您的好友助力码为${$.actorUuid}`) + console.log(`当前金币${$.userInfo.score}`) for(let i of ['sign','mainActive','visitSku','allFollowShop','allAddSku','memberCard']){ let task = data.data[i] if(task.taskName==='浏览会场' || task.taskName==='浏览商品' @@ -298,7 +325,8 @@ function getActContent(info=false, shareUuid = '') { await $.wait(500) } } - }else if(task.taskName ==='一键关注店铺' || task.taskName ==='一键加购' || task.taskName ==='一键开卡'){ + } else if(task.taskName ==='一键关注店铺' || task.taskName ==='一键开卡' // || task.taskName ==='一键加购' + ){ if (task.count < task.taskMax){ console.log(`去做${task.taskName}任务`) let res = await getTaskInfo(task.taskType) From ec17c50fc22270572128c868bcdf8b851f60cb23 Mon Sep 17 00:00:00 2001 From: shylocks Date: Wed, 13 Jan 2021 10:20:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=B9=B4=E8=B4=A7=E8=8A=82=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=8A=BD=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_nh.js | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/jd_nh.js b/jd_nh.js index 5d394a8..6e8859e 100644 --- a/jd_nh.js +++ b/jd_nh.js @@ -95,6 +95,11 @@ async function jdNh() { await getMyPing() await getUserInfo() await getActContent(false,shareUuid) + await getActContent(true) + if($.userInfo.score>=5000){ + console.log(`大于5000金币,去抽奖`) + await draw() + } await showMsg(); } @@ -376,7 +381,7 @@ function getTaskInfo(taskType, value) { }) } -// 做任务 +// 完成任务 function doTask(taskType, value) { let body = `activityId=${ACT_ID}&pin=${encodeURIComponent($.pin)}&actorUuid=${$.actorUuid}&taskType=${taskType}&taskValue=${value}` return new Promise(resolve => { @@ -412,6 +417,35 @@ function showMsg() { resolve() }) } +//抽奖 +function draw() { + let body = `activityId=${ACT_ID}&uuid=${$.actorUuid}&pin=${encodeURIComponent($.pin)}&drawValue=18` + return new Promise(resolve => { + $.post(taskPostUrl('dingzhi/vm/template/start', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${err}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.result && data.data) { + console.log(`抽奖成功,获得 ${data.data.drawInfo || '空气'}`) + message += `抽奖成功,获得 ${data.data.drawInfo || '空气'}` + } else { + console.log(`任务完成失败,错误信息:${data.errorMessage}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) + +} function taskUrl(function_id, body) { return { url: `https://lzdz-isv.isvjcloud.com/${function_id}?${body}`,