Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
KingRan888 committed Apr 3, 2022
1 parent 81e4c73 commit d560231
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 35 deletions.
18 changes: 17 additions & 1 deletion jd_dpqd.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,23 @@ const token = [
"A16F88A9390FEEBE284BC13EC4BAC6E9",
"E20BD5091D8F70B4649D529A09183F04",
"48AF67C570FF4986535BF6559042E29D",
"B19EB262C4A4AD705862A6D6EFA8E474"
"B19EB262C4A4AD705862A6D6EFA8E474",
"88ECFB91288FD2DE93DDBDDAA9409D8E",
"1B2F8250713AD30F335B092B70A4DBF5",
"6B00C48608C4FAFA8D73FE58BC2B6099",
"ECB1A135E3760C78C2AB74B747A537FB",
"032C7983152472648378B72028B62C40",
"2593927DBC99178C9E835A607D67482C",
"C521378DAAEA4D57BE44C0D5212060F3",
"8E3E6081738C9C30446C20F347516649",
"FAB1E61380C630230CEDBD9DEB9B66C1",
"BAF9032D06CA9D81F746BA7F95E27966",
"A795246AE4063905815D7748001C0A58",
"57B5F1912B8A5F7C3913EEB0CFA9130B",
"BA61728677870801781CD5DA61719904",
"C5F5FF51E040B2415A435D5BFDA15348",
"664227400540BC20B0160DE112BE806C",
"B5BD9A190DD6AD49A6E3646CB2700863"
]

if ($.isNode()) {
Expand Down
68 changes: 40 additions & 28 deletions jd_plantBean.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ let roundList = [];
let awardState = '';//上期活动的京豆是否收取
let randomCount = $.isNode() ? 20 : 5;
let num;
let llerror=false;
$.newShareCode = [];
let NowHour = new Date().getHours();
let lnrun = 0;
Expand Down Expand Up @@ -93,33 +94,8 @@ async function jdPlantBean() {
try {
console.log(`获取任务及基本信息`)
await plantBeanIndex();
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
return
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息出错,10秒后重试\n`)
await $.wait(10000);
await plantBeanIndex();
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
return
}
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息出错,30秒后重试\n`)
await $.wait(30000);
await plantBeanIndex();
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
return
}
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息失败,活动异常,换个时间再试试吧....`)
console.log("错误代码;"+$.plantBeanIndexResult.errorCode)
return
}
if(llerror)
return;
for (let i = 0; i < $.plantBeanIndexResult.data.roundList.length; i++) {
if ($.plantBeanIndexResult.data.roundList[i].roundState === "2") {
num = i
Expand Down Expand Up @@ -199,6 +175,8 @@ async function doGetReward() {
}
async function doCultureBean() {
await plantBeanIndex();
if(llerror)
return;
if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0') {
const plantBeanRound = $.plantBeanIndexResult.data.roundList[num]
if (plantBeanRound.roundState === '2') {
Expand Down Expand Up @@ -429,6 +407,8 @@ async function doTask() {
function showTaskProcess() {
return new Promise(async resolve => {
await plantBeanIndex();
if(llerror)
return;
$.taskList = $.plantBeanIndexResult.data.taskList;
if ($.taskList && $.taskList.length > 0) {
console.log(" 任务 进度");
Expand Down Expand Up @@ -548,7 +528,39 @@ async function helpShare(plantUuid) {
console.log(`助力结果的code:${$.helpResult && $.helpResult.code}`);
}
async function plantBeanIndex() {
$.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody
llerror=false;
$.plantBeanIndexResult = await request('plantBeanIndex'); //plantBeanIndexBody
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
llerror=true;
return
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息出错,10秒后重试\n`)
await $.wait(10000);
$.plantBeanIndexResult = await request('plantBeanIndex');
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
llerror=true;
return
}
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息出错,30秒后重试\n`)
await $.wait(30000);
$.plantBeanIndexResult = await request('plantBeanIndex');
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
llerror=true;
return
}
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息失败,活动异常,换个时间再试试吧....`)
console.log("错误代码;" + $.plantBeanIndexResult.errorCode)
llerror=true;
return
}
}
function requireConfig() {
return new Promise(resolve => {
Expand Down
44 changes: 38 additions & 6 deletions jd_plantBean_help.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ let awardState = '';//上期活动的京豆是否收取
let randomCount = $.isNode() ? 20 : 5;
let num;
$.newShareCode = [];
let llerror=false;
let lnrun = 0;
let lnruns = 0;
!(async () => {
Expand Down Expand Up @@ -94,11 +95,10 @@ let lnruns = 0;

async function jdPlantBean() {
try {
await plantBeanIndex();
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
return
}
console.log(`获取任务及基本信息`)
await plantBeanIndex();
if(llerror)
return;
for (let i = 0; i < $.plantBeanIndexResult.data.roundList.length; i++) {
if ($.plantBeanIndexResult.data.roundList[i].roundState === "2") {
num = i
Expand Down Expand Up @@ -280,7 +280,39 @@ async function helpShare(plantUuid) {
//console.log(`助力结果的code:${$.helpResult && $.helpResult.code}`);
}
async function plantBeanIndex() {
$.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody
llerror=false;
$.plantBeanIndexResult = await request('plantBeanIndex'); //plantBeanIndexBody
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
llerror=true;
return
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息出错,10秒后重试\n`)
await $.wait(10000);
$.plantBeanIndexResult = await request('plantBeanIndex');
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
llerror=true;
return
}
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息出错,30秒后重试\n`)
await $.wait(30000);
$.plantBeanIndexResult = await request('plantBeanIndex');
if ($.plantBeanIndexResult.errorCode === 'PB101') {
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
llerror=true;
return
}
}
if ($.plantBeanIndexResult.errorCode) {
console.log(`获取任务及基本信息失败,活动异常,换个时间再试试吧....`)
console.log("错误代码;" + $.plantBeanIndexResult.errorCode)
llerror=true;
return
}
}
function requestGet(function_id, body = {}) {
if (!body.version) {
Expand Down

0 comments on commit d560231

Please sign in to comment.