This commit is contained in:
Faker
2022-03-18 10:44:15 +08:00
parent d98f415f79
commit b04c4342c0

View File

@@ -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 京东种豆得豆 = 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; //Node.js用户请在jdCookie.js处填写京东ck;
//ios等软件用户直接用NobyDa的jd cookie //ios等软件用户直接用NobyDa的jd cookie
let jdNotify = true;//是否开启静默运行。默认true开启 let jdNotify = true;//是否开启静默运行。默认true开启
@@ -44,6 +44,20 @@ let awardState = '';//上期活动的京豆是否收取
let randomCount = $.isNode() ? 20 : 5; let randomCount = $.isNode() ? 20 : 5;
let num; let num;
$.newShareCode = []; $.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 () => { !(async () => {
await requireConfig(); await requireConfig();
if (!cookiesArr[0]) { if (!cookiesArr[0]) {
@@ -74,15 +88,17 @@ $.newShareCode = [];
await showMsg(); await showMsg();
} }
} }
for (let j = 0; j < cookiesArr.length; j++) { if(llhelp){
if (cookiesArr[j]) { for (let j = 0; j < cookiesArr.length; j++) {
cookie = cookiesArr[j]; if (cookiesArr[j]) {
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) cookie = cookiesArr[j];
$.index = j + 1; $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
//await shareCodesFormat(); $.index = j + 1;
await doHelp() //await shareCodesFormat();
} await doHelp()
} }
}
}
if ($.isNode() && allMessage) { if ($.isNode() && allMessage) {
await notify.sendNotify(`${$.name}`, `${allMessage}`) await notify.sendNotify(`${$.name}`, `${allMessage}`)
} }
@@ -269,18 +285,23 @@ async function doTask() {
} }
await shopTaskList(); await shopTaskList();
const { data } = $.shopTaskListRes; const { data } = $.shopTaskListRes;
let goodShopListARR = [], moreShopListARR = [], shopList = []; let goodShopListARR = [],moreShopListARR = [], shopList = [];
const { goodShopList, moreShopList } = data; const { goodShopList, moreShopList } = data;
for (let i of goodShopList) { if (goodShopList) {
if (i.taskState === '2') { for (let i of goodShopList) {
goodShopListARR.push(i); if (i.taskState === '2') {
} goodShopListARR.push(i);
} }
for (let j of moreShopList) { }
if (j.taskState === '2') { }
moreShopListARR.push(j); if (moreShopList) {
} for (let j of moreShopList) {
} if (j.taskState === '2') {
moreShopListARR.push(j);
}
}
}
shopList = goodShopListARR.concat(moreShopListARR); shopList = goodShopListARR.concat(moreShopListARR);
for (let shop of shopList) { for (let shop of shopList) {
const { shopId, shopTaskId } = shop; const { shopId, shopTaskId } = shop;