Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Faker authored and Faker committed Mar 18, 2022
1 parent d98f415 commit b04c434
Showing 1 changed file with 42 additions and 21 deletions.
63 changes: 42 additions & 21 deletions jd_plantBean.js → jd_plantBean_Mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cron "1 7-21/2 * * *" script-path=https://raw.githubusercontent.com/Aaron-lv/syn
京东种豆得豆 = type=cron,script-path=https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_plantBean.js, cronexpr="1 7-21/2 * * *", timeout=3600, enable=true
*/
const $ = new Env('京东种豆得豆_内部互助');
const $ = new Env('种豆得豆互助版');
//Node.js用户请在jdCookie.js处填写京东ck;
//ios等软件用户直接用NobyDa的jd cookie
let jdNotify = true;//是否开启静默运行。默认true开启
Expand All @@ -44,6 +44,20 @@ let awardState = '';//上期活动的京豆是否收取
let randomCount = $.isNode() ? 20 : 5;
let num;
$.newShareCode = [];

let NowHour = new Date().getHours();
let llhelp=true;
if ($.isNode() && process.env.CC_NOHELPAFTER8) {
console.log(NowHour);
if (process.env.CC_NOHELPAFTER8=="true"){
if (NowHour>8){
llhelp=false;
console.log(`现在是9点后时段,不启用互助....`);
}
}
}


!(async () => {
await requireConfig();
if (!cookiesArr[0]) {
Expand Down Expand Up @@ -74,15 +88,17 @@ $.newShareCode = [];
await showMsg();
}
}
for (let j = 0; j < cookiesArr.length; j++) {
if (cookiesArr[j]) {
cookie = cookiesArr[j];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.index = j + 1;
//await shareCodesFormat();
await doHelp()
}
}
if(llhelp){
for (let j = 0; j < cookiesArr.length; j++) {
if (cookiesArr[j]) {
cookie = cookiesArr[j];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.index = j + 1;
//await shareCodesFormat();
await doHelp()
}
}
}
if ($.isNode() && allMessage) {
await notify.sendNotify(`${$.name}`, `${allMessage}`)
}
Expand Down Expand Up @@ -269,18 +285,23 @@ async function doTask() {
}
await shopTaskList();
const { data } = $.shopTaskListRes;
let goodShopListARR = [], moreShopListARR = [], shopList = [];
let goodShopListARR = [],moreShopListARR = [], shopList = [];
const { goodShopList, moreShopList } = data;
for (let i of goodShopList) {
if (i.taskState === '2') {
goodShopListARR.push(i);
}
}
for (let j of moreShopList) {
if (j.taskState === '2') {
moreShopListARR.push(j);
}
}
if (goodShopList) {
for (let i of goodShopList) {
if (i.taskState === '2') {
goodShopListARR.push(i);
}
}
}
if (moreShopList) {
for (let j of moreShopList) {
if (j.taskState === '2') {
moreShopListARR.push(j);
}
}
}

shopList = goodShopListARR.concat(moreShopListARR);
for (let shop of shopList) {
const { shopId, shopTaskId } = shop;
Expand Down

0 comments on commit b04c434

Please sign in to comment.