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,6 +88,7 @@ $.newShareCode = [];
await showMsg(); await showMsg();
} }
} }
if(llhelp){
for (let j = 0; j < cookiesArr.length; j++) { for (let j = 0; j < cookiesArr.length; j++) {
if (cookiesArr[j]) { if (cookiesArr[j]) {
cookie = cookiesArr[j]; cookie = cookiesArr[j];
@@ -83,6 +98,7 @@ $.newShareCode = [];
await doHelp() await doHelp()
} }
} }
}
if ($.isNode() && allMessage) { if ($.isNode() && allMessage) {
await notify.sendNotify(`${$.name}`, `${allMessage}`) await notify.sendNotify(`${$.name}`, `${allMessage}`)
} }
@@ -271,16 +287,21 @@ async function doTask() {
const { data } = $.shopTaskListRes; const { data } = $.shopTaskListRes;
let goodShopListARR = [],moreShopListARR = [], shopList = []; let goodShopListARR = [],moreShopListARR = [], shopList = [];
const { goodShopList, moreShopList } = data; const { goodShopList, moreShopList } = data;
if (goodShopList) {
for (let i of goodShopList) { for (let i of goodShopList) {
if (i.taskState === '2') { if (i.taskState === '2') {
goodShopListARR.push(i); goodShopListARR.push(i);
} }
} }
}
if (moreShopList) {
for (let j of moreShopList) { for (let j of moreShopList) {
if (j.taskState === '2') { if (j.taskState === '2') {
moreShopListARR.push(j); 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;