committed by
GitHub
14
jd_cash.js
14
jd_cash.js
@@ -116,23 +116,23 @@ function index(info=false) {
|
|||||||
for(let task of data.data.result.taskInfos){
|
for(let task of data.data.result.taskInfos){
|
||||||
if (task.type === 4) {
|
if (task.type === 4) {
|
||||||
for (let i = task.doTimes; i < task.times; ++i) {
|
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 doTask(task.type, task.jump.params.skuId)
|
||||||
await $.wait(1000)
|
await $.wait(5000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (task.type === 2) {
|
else if (task.type === 2) {
|
||||||
for (let i = task.doTimes; i < task.times; ++i) {
|
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 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) {
|
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 doTask(task.type, task.jump.params.url)
|
||||||
await $.wait(1000)
|
await $.wait(5000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
70
jd_nh.js
70
jd_nh.js
@@ -33,7 +33,7 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
|||||||
//const WebSocket = $.isNode() ? require('websocket').w3cwebsocket: SockJS;
|
//const WebSocket = $.isNode() ? require('websocket').w3cwebsocket: SockJS;
|
||||||
//IOS等用户直接用NobyDa的jd cookie
|
//IOS等用户直接用NobyDa的jd cookie
|
||||||
let cookiesArr = [], cookie = '', message,helpInfo;
|
let cookiesArr = [], cookie = '', message,helpInfo;
|
||||||
const shareUuid = 'b3a52fbb01964aa3afb7ff0c57e6b37f'
|
let shareUuid = '83c6d4a80e3447b78572124e1fc3aa7c'
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
Object.keys(jdCookieNode).forEach((item) => {
|
Object.keys(jdCookieNode).forEach((item) => {
|
||||||
cookiesArr.push(jdCookieNode[item])
|
cookiesArr.push(jdCookieNode[item])
|
||||||
@@ -87,6 +87,7 @@ const ACT_ID = 'dzvm210168869301'
|
|||||||
})
|
})
|
||||||
async function jdNh() {
|
async function jdNh() {
|
||||||
$.score = 0
|
$.score = 0
|
||||||
|
await getShareCode()
|
||||||
await getIsvToken()
|
await getIsvToken()
|
||||||
await getIsvToken2()
|
await getIsvToken2()
|
||||||
await getActCk()
|
await getActCk()
|
||||||
@@ -94,8 +95,37 @@ async function jdNh() {
|
|||||||
await getMyPing()
|
await getMyPing()
|
||||||
await getUserInfo()
|
await getUserInfo()
|
||||||
await getActContent(false,shareUuid)
|
await getActContent(false,shareUuid)
|
||||||
|
await getActContent(true)
|
||||||
|
if($.userInfo.score>=5000){
|
||||||
|
console.log(`大于5000金币,去抽奖`)
|
||||||
|
await draw()
|
||||||
|
}
|
||||||
await showMsg();
|
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() {
|
function getIsvToken() {
|
||||||
let config = {
|
let config = {
|
||||||
url: 'https://api.m.jd.com/client.action?functionId=genToken',
|
url: 'https://api.m.jd.com/client.action?functionId=genToken',
|
||||||
@@ -284,8 +314,10 @@ function getActContent(info=false, shareUuid = '') {
|
|||||||
if (data.data) {
|
if (data.data) {
|
||||||
$.userInfo = data.data
|
$.userInfo = data.data
|
||||||
$.actorUuid = $.userInfo.actorUuid
|
$.actorUuid = $.userInfo.actorUuid
|
||||||
if(!info) console.log(`您的好友助力码为${$.actorUuid}`)
|
|
||||||
if (!info) {
|
if (!info) {
|
||||||
|
console.log(`您的好友助力码为${$.actorUuid}`)
|
||||||
|
console.log(`当前金币${$.userInfo.score}`)
|
||||||
for(let i of ['sign','mainActive','visitSku','allFollowShop','allAddSku','memberCard']){
|
for(let i of ['sign','mainActive','visitSku','allFollowShop','allAddSku','memberCard']){
|
||||||
let task = data.data[i]
|
let task = data.data[i]
|
||||||
if(task.taskName==='浏览会场' || task.taskName==='浏览商品'
|
if(task.taskName==='浏览会场' || task.taskName==='浏览商品'
|
||||||
@@ -298,7 +330,8 @@ function getActContent(info=false, shareUuid = '') {
|
|||||||
await $.wait(500)
|
await $.wait(500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(task.taskName ==='一键关注店铺' || task.taskName ==='一键加购' || task.taskName ==='一键开卡'){
|
} else if(task.taskName ==='一键关注店铺' || task.taskName ==='一键开卡' // || task.taskName ==='一键加购'
|
||||||
|
){
|
||||||
if (task.count < task.taskMax){
|
if (task.count < task.taskMax){
|
||||||
console.log(`去做${task.taskName}任务`)
|
console.log(`去做${task.taskName}任务`)
|
||||||
let res = await getTaskInfo(task.taskType)
|
let res = await getTaskInfo(task.taskType)
|
||||||
@@ -348,7 +381,7 @@ function getTaskInfo(taskType, value) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
// 做任务
|
// 完成任务
|
||||||
function doTask(taskType, value) {
|
function doTask(taskType, value) {
|
||||||
let body = `activityId=${ACT_ID}&pin=${encodeURIComponent($.pin)}&actorUuid=${$.actorUuid}&taskType=${taskType}&taskValue=${value}`
|
let body = `activityId=${ACT_ID}&pin=${encodeURIComponent($.pin)}&actorUuid=${$.actorUuid}&taskType=${taskType}&taskValue=${value}`
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
@@ -384,6 +417,35 @@ function showMsg() {
|
|||||||
resolve()
|
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) {
|
function taskUrl(function_id, body) {
|
||||||
return {
|
return {
|
||||||
url: `https://lzdz-isv.isvjcloud.com/${function_id}?${body}`,
|
url: `https://lzdz-isv.isvjcloud.com/${function_id}?${body}`,
|
||||||
|
Reference in New Issue
Block a user